[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100825182204.GB22671@redhat.com>
Date: Wed, 25 Aug 2010 20:22:04 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Yong Zhang <yong.zhang0@...il.com>
Cc: linux-kernel@...r.kernel.org, tglx@...utronix.de,
akpm@...ux-foundation.org, mingo@...e.hu, peterz@...radead.org
Subject: Re: [RFC V2 PATCH 3/3] timer: warn when del_timer_sync() used in
hardirq context
On 08/25, Yong Zhang wrote:
>
> From: Yong Zhang <yong.zhang@...driver.com>
>
> Add explict warning to prevent del_timer_sync() from using
> in hardirq context.
Agreed, del_timer_sync() from softirq should be OK.
> Signed-off-by: Yong Zhang <yong.zhang0@...il.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Ingo Molnar <mingo@...e.hu>
> ---
> kernel/timer.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/timer.c b/kernel/timer.c
> index 08c9559..1bc4b4a 100644
> --- a/kernel/timer.c
> +++ b/kernel/timer.c
> @@ -996,7 +996,11 @@ int del_timer_sync(struct timer_list *timer)
> lock_map_release(&timer->lockdep_map);
> local_bh_enable();
> #endif
> -
> + /*
> + * don't use it in hardirq context, because it
> + * could lead to deadlock.
> + */
> + WARN_ON(in_irq());
> for (;;) {
> int ret = try_to_del_timer_sync(timer);
> if (ret >= 0)
> --
> 1.7.0.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists