[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070327211145.GB216@tv-sign.ru>
Date: Wed, 28 Mar 2007 01:11:45 +0400
From: Oleg Nesterov <oleg@...sign.ru>
To: Venki Pallipadi <venkatesh.pallipadi@...el.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
akpm@...ux-foundation.org, davej@...emonkey.org.uk,
johnstul@...ibm.com, mingo@...e.hu, tglx@...utronix.de
Subject: Re: [PATCH] Add support for deferrable timers (respun)
On 03/27, Venki Pallipadi wrote:
>
> for (;;) {
> - base = timer->base;
> + tvec_base_t *prelock_base = timer->base;
> + base = timer_get_base(timer);
> if (likely(base != NULL)) {
> spin_lock_irqsave(&base->lock, *flags);
> - if (likely(base == timer->base))
> + if (likely(prelock_base == timer->base))
> return base;
I don't think this is correct, at least in theory.
Suppose that
tvec_base_t *prelock_base = timer->base;
base = timer_get_base(timer);
are re-ordered (the second LOAD happens after the first one), and the timer
changes its base in between. Now, we lock the old base, and return it because
"prelock_base == timer->base" == true.
Oleg.
-
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