Re: [RFC PATCH v2] fs/namespace: use percpu_rw_semaphore for writer holding

From: John Ogness
Date: Mon Jul 20 2020 - 11:35:06 EST


On 2020-07-19, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>> The MNT_WRITE_HOLD flag is used to manually implement a rwsem.
>
> Could you show me where does it currently sleep? Your version does,
> unless I'm misreading it...

You are reading it correctly. This patch introduces new possible
sleeping for__mnt_want_write() when writers for a superblock are being
held.

The RFCv1 [0] is a variant that does not introduce sleeping, but instead
reverts back to per-cpu spinlocks.

Sebastian and I are requesting comments on these two possible
solutions. Or perhaps you have an idea how to solve the potential live
lock situation.

John Ogness

[0] https://lkml.kernel.org/r/20200617104058.14902-2-john.ogness@xxxxxxxxxxxxx