From: Eric Dumazet <erdnetdev@gmail.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH RFC] spinlock: split out debugging check from spin_lock_mutex
Date: Thu, 11 Apr 2013 08:57:01 -0700 [thread overview]
Message-ID: <1365695821.3887.167.camel@edumazet-glaptop> (raw)
In-Reply-To: <1365693486-6315-1-git-send-email-nhorman@tuxdriver.com>
On Thu, 2013-04-11 at 11:18 -0400, Neil Horman wrote:
> Bart, this patch should fix your problem. Could you please test it and confirm?
>
> Bart Van Assche recently reported a warning to me:
>
> <IRQ> [<ffffffff8103d79f>] warn_slowpath_common+0x7f/0xc0
> [<ffffffff8103d7fa>] warn_slowpath_null+0x1a/0x20
> [<ffffffff814761dd>] mutex_trylock+0x16d/0x180
> [<ffffffff813968c9>] netpoll_poll_dev+0x49/0xc30
> [<ffffffff8136a2d2>] ? __alloc_skb+0x82/0x2a0
> [<ffffffff81397715>] netpoll_send_skb_on_dev+0x265/0x410
> [<ffffffff81397c5a>] netpoll_send_udp+0x28a/0x3a0
> [<ffffffffa0541843>] ? write_msg+0x53/0x110 [netconsole]
> [<ffffffffa05418bf>] write_msg+0xcf/0x110 [netconsole]
> [<ffffffff8103eba1>] call_console_drivers.constprop.17+0xa1/0x1c0
> [<ffffffff8103fb76>] console_unlock+0x2d6/0x450
> [<ffffffff8104011e>] vprintk_emit+0x1ee/0x510
> [<ffffffff8146f9f6>] printk+0x4d/0x4f
> [<ffffffffa0004f1d>] scsi_print_command+0x7d/0xe0 [scsi_mod]
>
> This resulted from my commit ca99ca14c which introduced a mutex_trylock
> operation in a path that could execute in interrupt context. When mutex
> debugging is enabled, the above warns the user when we are in fact exectuting in
> interrupt context.
>
> I think this is a false positive however. The check is intended to catch users
> who might be issuing sleeping calls in irq context, but the use of mutex_trylock
> here is guaranteed not to sleep.
>
> We could fix this by replacing the DEBUG_LOCK_WARN_ON check in spin_lock_mutex
> with a __might_sleep call in the appropriate parent mutex operations, but for
> the sake of effiency (which It seems is why the check was put in the spin lock
> code only when debug is enabled), lets split the spin_lock_mutex call into two
> components, where the outer component does the debug checking. Then
> mutex_trylock can just call the inner part as its callable from irq context
> safely.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Bart Van Assche <bvanassche@acm.org>
> CC: Bart Van Assche <bvanassche@acm.org>
> CC: David Miller <davem@davemloft.net>
> CC: netdev@vger.kernel.org
Please post your patch to lkml ?
Thanks !
next prev parent reply other threads:[~2013-04-11 15:57 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 13:42 Netpoll triggers soft lockup Bart Van Assche
2013-04-11 14:08 ` Neil Horman
2013-04-11 15:18 ` [PATCH RFC] spinlock: split out debugging check from spin_lock_mutex Neil Horman
2013-04-11 15:54 ` Christoph Paasch
2013-04-11 17:04 ` Neil Horman
2013-04-11 17:51 ` Christoph Paasch
2013-04-11 15:57 ` Eric Dumazet [this message]
2013-04-11 16:56 ` Neil Horman
2013-04-11 17:31 ` Bart Van Assche
2013-04-11 17:52 ` Neil Horman
2013-04-11 19:14 ` Neil Horman
2013-04-12 6:27 ` Bart Van Assche
2013-04-12 11:32 ` Neil Horman
2013-04-12 14:01 ` Bart Van Assche
2013-04-12 18:45 ` Neil Horman
2013-04-13 7:35 ` Bart Van Assche
2013-04-13 12:03 ` Neil Horman
2013-04-15 14:16 ` Neil Horman
[not found] ` <CAO+b5-oBfH3M0dnrQSs-p1BF_5hKy2tsU-dD=EP9+S=iqPs5ew@mail.gmail.com>
2013-04-16 17:24 ` Neil Horman
2013-04-18 19:29 ` Neil Horman
2013-04-22 20:12 ` Neil Horman
[not found] ` <CAO+b5-r5jVJNZWuREUH5MQ3baeSPR8fVV1p9pMnukmiZd9nRhg@mail.gmail.com>
2013-04-23 13:23 ` Neil Horman
[not found] ` <CAO+b5-rQPyO9QE9v+oQTeo+G-ftcsehSB5=63AZ13QW4EJ1X0Q@mail.gmail.com>
2013-04-23 13:44 ` Neil Horman
2013-04-23 17:33 ` David Miller
2013-04-23 17:50 ` Neil Horman
2013-04-27 18:53 ` bvba Bart Van Assche
2013-04-29 18:13 ` Neil Horman
2013-04-29 19:12 ` Bart Van Assche
2013-04-30 15:35 ` [PATCH RFC] netpoll: convert mutex into a semaphore Neil Horman
2013-05-01 19:00 ` David Miller
2013-05-01 19:34 ` Neil Horman
2013-04-19 8:38 ` [PATCH RFC] spinlock: split out debugging check from spin_lock_mutex Ingo Molnar
2013-04-19 12:52 ` Neil Horman
-- strict thread matches above, loose matches on Subject: below --
2013-04-28 2:34 Neil Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1365695821.3887.167.camel@edumazet-glaptop \
--to=erdnetdev@gmail.com \
--cc=bvanassche@acm.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox