[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121009151729.GA3521@redhat.com>
Date: Tue, 9 Oct 2012 17:17:29 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Andi Kleen <andi@...stfloor.org>,
Ivo Sieben <meltedpianoman@...il.com>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
linux-serial@...r.kernel.org, Alan Cox <alan@...ux.intel.com>,
Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [REPOST] RFC: sched: Prevent wakeup to enter critical section
needlessly
On 10/09, Peter Zijlstra wrote:
>
> One thing you might need to consider is the memory ordering, will the
> list_empty -- either careful or not -- observe the right list pointer,
> or could it -- when racing with wait_event()/prepare_to_wait() --
> observe a stale value. Or.. is that all already covered in on the use
> site.
I agree.
Without spin_lock(q->lock) (or some other barriers) wait_event-like
code can miss an event.
wait_event:
prepare_to_wait(wq) // takes wq->lock
if (!CONDITION)
schedule();
Now,
CONDITION = 1;
wake_up(wq);
at least need the full mb() before lits_empty().
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