Re: [PATCH] fscache: Use wake_up_var() to wake up pending volume acquisition

From: David Howells
Date: Fri Dec 09 2022 - 06:28:07 EST


Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote:

> > clear_bit(FSCACHE_VOLUME_ACQUIRE_PENDING, &cursor->flags);

Maybe this should be clear_bit_unlock() instead.

And I wonder if:

set_bit(FSCACHE_VOLUME_ACQUIRE_PENDING, &candidate->flags);

in fscache_hash_volume() needs a barrier before it.

> > - wake_up_bit(&cursor->flags, FSCACHE_VOLUME_ACQUIRE_PENDING);
> > + /*
> > + * Paired with barrier in wait_var_event(). Check
> > + * waitqueue_active() and wake_up_var() for details.
> > + */
> > + smp_mb__after_atomic();
> > + wake_up_var(&cursor->flags);

That doesn't seem right.

wake_up_bit() is more selective, so should be preferred to wake_up_var().

David