lkml.org 
[lkml]   [2009]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] It may not be assumed that wake_up(), finish_wait() and co. imply a memory barrier


On Thu, 23 Apr 2009, David Howells wrote:
>
> Well, Ingo's point is it could be left up to the caller of wake_up() to supply
> the barrier:
>
> *my_variable = 1234;
> smp_wmb();
> wake_up(&my_queue);

That's bogus.

EVERY SINGLE wake_up() would need it.

There is _always_ a reason for the wakeup. And yes, you can re-order
things, but we normally don't. Just make the rule be that there's an
implied smp_wmb() instead.

It's not like it's going to cost anything on any sane architecture anyway.
So asking people to add "smp_wmb()" calls before their wakups just makes
the source code unreadable and fragile, for no actual advantage.

Linus


\
 
 \ /
  Last update: 2009-04-23 23:21    [W:0.983 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site