Re: [PATCH v7 0/5] ceph: reduce mdsc->mutex contention in the cephfs kclient

From: Xiubo Li

Date: Thu Nov 26 2026 - 03:21:52 EST


Hi Alex,

Thanks, both races are real. I reproduced each on v7 (the replay
kworker hangs in wait_on_bit() holding s_mutex; the async create's
touch waits on its own CEPH_DENTRY_ASYNC_CREATE_BIT).

I will post v8 after the perf runs.

Thanks,
Xiubo

On Sun, 22 Nov 2026 at 19:30, Alex Markuze <amarkuze@xxxxxxxxxx> wrote:
>
> Hi Xiubo,
>
> Thanks for updating the replay path and snapshotting the send counters.
> I think two progress races remain:
>
> 1. Replay can miss a wake if dispatch ownership is taken again. Replay
> selects an in-flight request for session A as busy and drops
> mdsc->mutex. An already-dispatched forward sets RESEND, and replay
> sets REPLAY_WAIT. The original sender can then clear DISPATCHING,
> consume REPLAY_WAIT and wake the waiter, before restarting on an open
> session B and reclaiming DISPATCHING. If replay enters wait_on_bit()
> after that reclaim, the second release will not wake it because
> REPLAY_WAIT is already clear. Replay stays blocked while holding A's
> s_mutex.
>
> 2. A fast forward of an async create can make the submitting thread wait
> for itself. If the forward arrives during the first send, the sender
> consumes RESEND and restarts in ceph_mdsc_submit_request(). With an
> already open or hung destination session, it sees the nonzero forward
> count and waits on CEPH_DENTRY_ASYNC_CREATE_BIT. That bit is cleared
> by ceph_finish_async_create(), which the same thread cannot reach
> until ceph_mdsc_submit_request() returns.
>
> Could the replay waiter remain wakeable across a new dispatch claim, and
> could the async-create retry avoid waiting in the submitting thread before
> it has finished the local create?
>
> Thanks,
> Alex
>