Re: [PATCH 1/2] vmevent: Should not grab mutex in the atomiccontext

From: Pekka Enberg
Date: Wed Apr 18 2012 - 16:02:07 EST


On Wed, 18 Apr 2012, Anton Vorontsov wrote:
> vmevent grabs a mutex in the atomic context, and so this pops up:
>
> BUG: sleeping function called from invalid context at kernel/mutex.c:271
> in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper/0
> 1 lock held by swapper/0/0:
> #0: (&watch->timer){+.-...}, at: [<ffffffff8103eb80>] call_timer_fn+0x0/0xf0
> Pid: 0, comm: swapper/0 Not tainted 3.2.0+ #6
> Call Trace:
> <IRQ> [<ffffffff8102f5da>] __might_sleep+0x12a/0x1e0
> [<ffffffff810bd990>] ? vmevent_match+0xe0/0xe0
> [<ffffffff81321f2c>] mutex_lock_nested+0x3c/0x340
> [<ffffffff81064b33>] ? lock_acquire+0xa3/0xc0
> [<ffffffff8103eb80>] ? internal_add_timer+0x110/0x110
> [<ffffffff810bd990>] ? vmevent_match+0xe0/0xe0
> [<ffffffff810bda21>] vmevent_timer_fn+0x91/0xf0
> [<ffffffff810bd990>] ? vmevent_match+0xe0/0xe0
> [<ffffffff8103ebf5>] call_timer_fn+0x75/0xf0
> [<ffffffff8103eb80>] ? internal_add_timer+0x110/0x110
> [<ffffffff81062fdd>] ? trace_hardirqs_on_caller+0x7d/0x120
> [<ffffffff8103ee9f>] run_timer_softirq+0x10f/0x1e0
> [<ffffffff810bd990>] ? vmevent_match+0xe0/0xe0
> [<ffffffff81038d90>] __do_softirq+0xb0/0x160
> [<ffffffff8105eb0f>] ? tick_program_event+0x1f/0x30
> [<ffffffff8132642c>] call_softirq+0x1c/0x26
> [<ffffffff810036d5>] do_softirq+0x85/0xc0
>
> This patch fixes the issue by removing the mutex and making the logic
> lock-free.
>
> Signed-off-by: Anton Vorontsov <anton.vorontsov@xxxxxxxxxx>

Applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/