mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Bug #10326] inconsistent lock state in net_rx_action
@ 2008-04-08 23:02 Rafael J. Wysocki
  2008-04-08 23:56 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2008-04-08 23:02 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Marcus Better

This message has been generated automatically as a part of a report
of recent regressions.

The following bug entry is on the current list of known regressions
from 2.6.24.  Please verify if it still should be listed.


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=10326
Subject		: inconsistent lock state in net_rx_action
Submitter	: Marcus Better <marcus@better.se>
Date		: 2008-03-25 13:21 (15 days old)
Patch		: http://bugzilla.kernel.org/show_bug.cgi?id=10326#c20



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug #10326] inconsistent lock state in net_rx_action
  2008-04-08 23:02 [Bug #10326] inconsistent lock state in net_rx_action Rafael J. Wysocki
@ 2008-04-08 23:56 ` David Miller
  2008-04-09  0:00   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2008-04-08 23:56 UTC (permalink / raw)
  To: rjw; +Cc: linux-kernel, marcus

From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Wed,  9 Apr 2008 01:02:09 +0200 (CEST)

> Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=10326
> Subject		: inconsistent lock state in net_rx_action
> Submitter	: Marcus Better <marcus@better.se>
> Date		: 2008-03-25 13:21 (15 days old)
> Patch		: http://bugzilla.kernel.org/show_bug.cgi?id=10326#c20

This is already fixed by:

commit 50fd4407b8bfbde7c1a0bfe4f24de7df37164342
Author: David S. Miller <davem@davemloft.net>
Date:   Thu Mar 27 17:42:50 2008 -0700

    [NET]: Use local_irq_{save,restore}() in napi_complete().
    
    Based upon a lockdep report.
    
    Since ->poll() can be invoked from netpoll with interrupts
    disabled, we must not unconditionally enable interrupts
    in napi_complete().
    
    Instead we must use local_irq_{save,restore}().
    
    Noticed by Peter Zijlstra:
    
    <irqs disabled>
    
      netpoll_poll()
        poll_napi()
          spin_trylock(&napi->poll_lock)
          poll_one_napi()
            napi->poll() := sky2_poll()
              napi_complete()
                local_irq_disable()
                local_irq_enable() <--- *BUG*
    
      <irq>
        irq_exit()
          do_softirq()
            net_rx_action()
              spin_lock(&napi->poll_lock) <--- Deadlock!
    
    Because we still hold the lock....
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a2f0032..fae6a7e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -383,9 +383,11 @@ static inline void __napi_complete(struct napi_struct *n)
 
 static inline void napi_complete(struct napi_struct *n)
 {
-	local_irq_disable();
+	unsigned long flags;
+
+	local_irq_save(flags);
 	__napi_complete(n);
-	local_irq_enable();
+	local_irq_restore(flags);
 }
 
 /**

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug #10326] inconsistent lock state in net_rx_action
  2008-04-08 23:56 ` David Miller
@ 2008-04-09  0:00   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2008-04-09  0:00 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, marcus

On Wednesday, 9 of April 2008, David Miller wrote:
> From: "Rafael J. Wysocki" <rjw@sisk.pl>
> Date: Wed,  9 Apr 2008 01:02:09 +0200 (CEST)
> 
> > Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=10326
> > Subject		: inconsistent lock state in net_rx_action
> > Submitter	: Marcus Better <marcus@better.se>
> > Date		: 2008-03-25 13:21 (15 days old)
> > Patch		: http://bugzilla.kernel.org/show_bug.cgi?id=10326#c20
> 
> This is already fixed by:
> 
> commit 50fd4407b8bfbde7c1a0bfe4f24de7df37164342
> Author: David S. Miller <davem@davemloft.net>
> Date:   Thu Mar 27 17:42:50 2008 -0700
> 
>     [NET]: Use local_irq_{save,restore}() in napi_complete().

Thanks, closed.

Rafael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-09  0:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-08 23:02 [Bug #10326] inconsistent lock state in net_rx_action Rafael J. Wysocki
2008-04-08 23:56 ` David Miller
2008-04-09  0:00   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®