Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhenwen Liang" <zhenwenliang@google.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/rtrs-clt: Fix a lost wakeup in rtrs_clt_put_permit()
Date: Sun, 29 Nov 2026 02:51:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-239270@kernel.org> (raw)
In-Reply-To: <20261129024708.279044-1-zhenwenliang@google.com>

> rtrs_clt_put_permit() releases a permit with clear_bit_unlock() and then
> calls waitqueue_active() without holding the wait queue lock.
> clear_bit_unlock() is a release operation: it orders earlier accesses
> before the clear, but it does not order the clear before the later
> waitqueue_active() load. The comment on waitqueue_active() in
> include/linux/wait.h requires a full barrier on the waker side for this
> lockless check.
> 
> The waiter, rtrs_clt_get_permit(), calls prepare_to_wait(), which adds
> it to permits_wait and sets the task state (a full barrier), and then
> looks for a free bit in permits_map. Without a barrier on the waker
> side, the waker can see an empty wait queue while the waiter still sees
> the bit set, and the wakeup is lost. The waiter sleeps in
> TASK_UNINTERRUPTIBLE with no timeout; if the freed permit was the last
> outstanding one and no later put follows, nothing wakes it.
> [ ... ]
> the barrier is emitted between the clear and the wait queue load in
> arm64 object code; not runtime-tested beyond the litmus tests.
> 
> Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
> Signed-off-by: Zhenwen Liang <zhenwenliang@google.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129024708.279044-1-zhenwenliang@google.com?part=1

      reply	other threads:[~2026-11-29  2:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  2:47 [PATCH] RDMA/rtrs-clt: Fix a lost wakeup in rtrs_clt_put_permit() Zhenwen Liang
2026-11-29  2:51 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-239270@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zhenwenliang@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox