From: Oleg Nesterov <oleg@tv-sign.ru>
To: Venki Pallipadi <venkatesh.pallipadi@intel.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
akpm@linux-foundation.org, davej@codemonkey.org.uk,
johnstul@us.ibm.com, mingo@elte.hu, tglx@linutronix.de
Subject: Re: [PATCH] Add support for deferrable timers (respun)
Date: Wed, 28 Mar 2007 01:11:45 +0400 [thread overview]
Message-ID: <20070327211145.GB216@tv-sign.ru> (raw)
In-Reply-To: <20070327204344.GA21529@linux-os.sc.intel.com>
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.
next prev parent reply other threads:[~2007-03-27 21:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200703212353.l2LNrNOj007453@shell0.pdx.osdl.net>
[not found] ` <20070322140532.GA120@tv-sign.ru>
[not found] ` <20070322151817.GA29840@linux-os.sc.intel.com>
[not found] ` <20070322161355.GA160@tv-sign.ru>
2007-03-27 20:43 ` Venki Pallipadi
2007-03-27 21:11 ` Oleg Nesterov [this message]
2007-03-27 21:55 ` Venki Pallipadi
2007-03-27 22:22 ` Oleg Nesterov
2007-03-27 22:28 ` Oleg Nesterov
2007-03-27 22:36 ` Venki Pallipadi
2007-03-28 23:00 ` [PATCH] Add support for deferrable timers (respun-Mar28) Venki Pallipadi
2007-03-29 0:01 ` Andrew Morton
2007-03-29 0:59 ` Venki Pallipadi
2007-03-29 11:41 ` Andi Kleen
2007-03-29 11:51 ` Kyle Moffett
2007-03-29 11:58 ` Andi Kleen
2007-03-28 11:06 ` [PATCH] Add support for deferrable timers (respun) Andi Kleen
2007-03-28 16:42 ` Venki Pallipadi
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=20070327211145.GB216@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@linux-foundation.org \
--cc=davej@codemonkey.org.uk \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=venkatesh.pallipadi@intel.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
all inboxes | Powered by JetHome®