Re: [PATCH] fs/dcache: optimize start_dir_add()
From: Dave Chinner
Date: Mon Oct 26 2020 - 17:59:33 EST
On Thu, Oct 22, 2020 at 02:16:50PM -0700, Davidlohr Bueso wrote:
> Considering both end_dir_add() and d_alloc_parallel(), the
> dir->i_dir_seq wants acquire/release semantics, therefore
> micro-optimize for ll/sc archs and use finer grained barriers
> to provide (load)-ACQUIRE ordering (L->S + L->L). This comes
> at no additional cost for most of x86, as sane tso models will
> have a nop for smp_rmb/smp_acquire__after_ctrl_dep.
>
> Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx>
> ---
> Alternatively I guess we could just use cmpxchg_acquire().
Please us cmpxchg_acquire() so that people who have no clue what the
hell smp_acquire__after_ctrl_dep() means or does have some hope of
understanding of what objects the ordering semantics in the function
actually apply to....
Cheers,
Dave.
--
Dave Chinner
david@xxxxxxxxxxxxx