[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b647ffbd0802231151w481fdcb5hc2a3972e7fd03f69@mail.gmail.com>
Date: Sat, 23 Feb 2008 20:51:23 +0100
From: "Dmitry Adamushko" <dmitry.adamushko@...il.com>
To: "Linus Torvalds" <torvalds@...ux-foundation.org>
Cc: "Oleg Nesterov" <oleg@...sign.ru>,
"Andrew Morton" <akpm@...ux-foundation.org>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
a.p.zijlstra@...llo.nl, apw@...dowen.org,
"Ingo Molnar" <mingo@...e.hu>, nickpiggin@...oo.com.au,
paulmck@...ux.vnet.ibm.com, rusty@...tcorp.com.au,
"Steven Rostedt" <rostedt@...dmis.org>, linux-arch@...r.kernel.org
Subject: Re: + kthread-add-a-missing-memory-barrier-to-kthread_stop.patch added to -mm tree
On 23/02/2008, Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>
>
> On Sat, 23 Feb 2008, Oleg Nesterov wrote:
> >
>
> > Yes, but still I suspect wmb() is not enough. Note that try_to_wake_up()
> > first checks (reads) the task->state,
> >
> > if (!(old_state & state))
> > goto out;
> >
> > without the full mb() it is (in theory) possible that try_to_wake_up()
> > first reads TASK_RUNNING and only then sets CONDITION. IOW, STORE and
> > LOAD could be re-ordered.
>
>
> No. The spinlock can have preceding stores (and loads, for that matter)
> percolate *into* the locked region, but a spinlock can *not* have loads
> (and stores) escape *out* of the region withou being totally broken.
it's not a LOAD that escapes *out* of the region. It's a MODIFY that gets *in*:
(1)
MODIFY(a);
LOCK
LOAD(b);
UNLOCK
can become:
(2)
LOCK
MOFIDY(a)
LOAD(b);
UNLOCK
and (reordered)
(3)
LOCK
LOAD(a)
MODIFY(b)
UNLOCK
and this last one is a problem. No?
>
> Linus
>
--
Best regards,
Dmitry Adamushko
--
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