Re: [PATCH 19/19] mm: filemap: Avoid unnecessary barries and waitqueue lookups in unlock_page fastpath

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/13, Paul E. McKenney wrote:
>
> On Tue, May 13, 2014 at 05:44:35PM +0200, Peter Zijlstra wrote:
> >
> > Ah, yes, so I'll defer to Oleg and Linus to explain that one. As per the
> > name: smp_mb__before_spinlock() should of course imply a full barrier.
>
> How about if I queue a name change to smp_wmb__before_spinlock()?

I agree, this is more accurate, simply because it describes what it
actually does.

But just in case, as for try_to_wake_up() it does not actually need
wmb() between "CONDITION = T" and "task->state = RUNNING". It would
be fine if these 2 STORE's are re-ordered, we can rely on rq->lock.

What it actually needs is a barrier between "CONDITION = T" and
"task->state & state" check. But since we do not have a store-load
barrier, wmb() was added to ensure that "CONDITION = T" can't leak
into the critical section.

But it seems that set_tlb_flush_pending() already assumes that it
acts as wmb(), so probably smp_wmb__before_spinlock() is fine.

Oleg.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]