From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752566AbbKBJQu (ORCPT ); Mon, 2 Nov 2015 04:16:50 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:55452 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbbKBJQo (ORCPT ); Mon, 2 Nov 2015 04:16:44 -0500 Date: Mon, 2 Nov 2015 10:16:39 +0100 From: Peter Zijlstra To: Noam Camus Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, talz@ezchip.com, gilf@ezchip.com, cmetcalf@ezchip.com Subject: Re: [PATCH v1 05/20] ARC: rwlock: disable interrupts in !LLSC variant Message-ID: <20151102091639.GK17308@twins.programming.kicks-ass.net> References: <1446297327-16298-1-git-send-email-noamc@ezchip.com> <1446297327-16298-6-git-send-email-noamc@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446297327-16298-6-git-send-email-noamc@ezchip.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 31, 2015 at 03:15:12PM +0200, Noam Camus wrote: > From: Noam Camus > > If we hold rw->lock_mutex and interrupt occures we may > end up spinning on it for ever during softirq. > > Below you may see an example for interrupt we get while > nl_table_lock is holding its rw->lock_mutex and we spinned > on it for ever. > > The concept for the fix was taken from SPARC. > > [2015-05-12 19:16:12] Stack Trace: > [2015-05-12 19:16:12] arc_unwind_core+0xb8/0x11c > [2015-05-12 19:16:12] dump_stack+0x68/0xac > [2015-05-12 19:16:12] _raw_read_lock+0xa8/0xac > [2015-05-12 19:16:12] netlink_broadcast_filtered+0x56/0x35c > [2015-05-12 19:16:12] nlmsg_notify+0x42/0xa4 > [2015-05-12 19:16:13] neigh_update+0x1fe/0x44c > [2015-05-12 19:16:13] neigh_event_ns+0x40/0xa4 > [2015-05-12 19:16:13] arp_process+0x46e/0x5a8 > [2015-05-12 19:16:13] __netif_receive_skb_core+0x358/0x500 > [2015-05-12 19:16:13] process_backlog+0x92/0x154 > [2015-05-12 19:16:13] net_rx_action+0xb8/0x188 > [2015-05-12 19:16:13] __do_softirq+0xda/0x1d8 > [2015-05-12 19:16:14] irq_exit+0x8a/0x8c > [2015-05-12 19:16:14] arch_do_IRQ+0x6c/0xa8 > [2015-05-12 19:16:14] handle_interrupt_level1+0xe4/0xf0 > > Signed-off-by: Noam Camus > Cc: Peter Zijlstra It might make sense to note that this is a lock internal lock and since the lock is free to be used from any context, the lock needs to be IRQ-safe. Acked-by: Peter Zijlstra (Intel)