From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795920698; b=KhDBJwn4f4+UnRlQm/bezXrt/ddy5ZWWy1cGV/0l+RoxaEi5TARspGbWCrtTN8INDzWP H/wJMSRWz1K6530kpLuEa7+Qck5ti4Vq6rJo7tz7uGz5KjjZqvDOCMX9K1gCK1NCNFpDQ Cpl5u8+zRbcL+mQx3gR47KxICq5Pf+dYHl/s1+wL5wklMqTr06looEN4VgGEsZRfcoaEm JSWOd2dHvhtjd7gEpSa0wUrKj3yY9f4MKUP0nnl1YHgxzKh5MV84CM0hymwSv090wLR1Y 62FCPAuJP+81GAcAcFQF+1aLOJX3hrtBuZvVpVGpASWnM35Xz31An6/nTLVEkgar/sA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795920698; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=JyhROEQ/lo33+4HqpOBLJFRbky6B8My9EJfdchOS3Bw=; b=ibD/farzvVrvktVstWFriw3YTV8yhKZDD/B2SorUEd+taDwlfRNhTK4IFrmSEZAd6sr4 t3YH21wwQj12hbfQeDxW4Y9JCe/Abjtvw+R7yqAonihJ3VTor5a8g1HlEcEBean0F+ku4 h+vvmS4Pj5BqcDTn6wLG81wWkT1gF/CFSN9L8AKPMCBkxBhYL55mSB8vbAGGvYrsaCMqq qSkMxmYBTAnBPQpbacKDkMWJSD4rEMbTo+W8YFuTlAL/mVZJzXk9cKvPSsbaBNwxdwtME p+/JEJ2zRFwI09Ms2+yY7AtTeeD+/xkxuxA7QVP+LUfltktf2GSkcoMkFbvnXqvM0Sg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CVAeY6PO; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A3CB606A31C for ; Sun, 29 Nov 2026 02:51:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CVAeY6PO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95C331F000C1; Sun, 29 Nov 2026 02:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795920697; bh=JyhROEQ/lo33+4HqpOBLJFRbky6B8My9EJfdchOS3Bw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=CVAeY6POOhE5dme3H6L89yXguZdk3MloBjsqP7PuXjCceOyqFKZ9TSU9ktH8pIv0R qh44md367oLKz0RQRYVtWzTUPa25y6XqQjGXWPVLsXShd7FbpmAguDf9gl8BKNQhJr Y9kWm5WOb7tiq99fATjvU8XB3rXwRXpIla7KLBINbXNOr+K8NE3G47ED3Pqspy088A EoNixzhkj9S1exlX/YjQJagcm0BLNU+tD/klQz1ZLdkcg7Exsxmduij4oWi2sG1JUv qCibQPg8hgHIbFyGCgHB4UZ1AVSrC13XdMFydLJV8cNnyzAj4o4zoYxvtPNKxpjL6a pwRrc7Z4TMCuw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] RDMA/rtrs-clt: Fix a lost wakeup in rtrs_clt_put_permit() Reply-To: sashiko-reviews@lists.linux.dev To: "Zhenwen Liang" Cc: linux-rdma@vger.kernel.org In-Reply-To: <20261129024708.279044-1-zhenwenliang@google.com> References: <20261129024708.279044-1-zhenwenliang@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 02:51:37 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > 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. >=20 > 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. >=20 > Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") > Signed-off-by: Zhenwen Liang Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261129024708.2790= 44-1-zhenwenliang@google.com?part=3D1