From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DB723876BB for ; Wed, 12 Aug 2026 16:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786550778; cv=none; b=fkeaz29R0UQifekro4eNyXO+s5qqqgZE5AXSUD2yGXRZrEJtHpUSpa21lpXySpPoyAsHNPRHyCKOPngWhALsbGnmWkrpGLWOTAtD1Ye/X0i2SwKMC8H1x9bFBEqx6v5IuLqAZ8TSBW0rofRgTBnUMoBwRSFWvtpQbAfIfSAsm+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786550778; c=relaxed/simple; bh=EUCnzMopjFl7Y7T5xg+qdJ6AN3Wgc7zNwIVj8+t4kco=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xse2eyeGSUm0wI+PW2n7kzxwWAaTHLmY282NHJX5wpf7pTPWh+mTdXbliCFMKww0YCynQf47v3F6HHZEFIgGqRyn0jwUOYMAA3lx4Temu9NYRm7KZzcqV1RMxOP/iPJM+UmuKqXLBW0KwzchxuaY5BQ3/HKedYPums/FULeCPXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=qj3Vdla4; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="qj3Vdla4" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=1BmWJCs4U5WEjhhZY93Bsr4zsXs26urEZd+eQL4EKDU=; b=qj3Vdla4QstmWy08BUqCVUorck vCBgEF30nGwhpzukPJn9hZc6xUA3XWoUYL/mmhknv4tMvvpHNrahD6PhWba79YTzLev8SxjccwFW9 LGNyj4i0MJxiiWyRkDfTy+6AcAfFsSZDqyVL4LBbhTgV2uHl+MXfLtXeWa0RagpceOAllFnSv/5GK V6c2KsL7WbOvSWAcNo1maGGeJ13+J3d2kSCdzrpVT53cZ8ktWn+Zby4CJ41cD4NFqRIGzCv70cnam wH/aH6nGCwHv9Vlmkvu21HdJerNa8jmGNqoYjgMhXOMgH+2sEmIWdIb4n7ymZmL6vS4L41Oq2dGqH AXovC3sg==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wuBSz-004SGO-2T; Wed, 12 Aug 2026 16:06:10 +0000 From: Breno Leitao Date: Wed, 12 Aug 2026 09:03:18 -0700 Subject: [PATCH 1/3] workqueue: use rcu_dereference_sched() in workqueue_congested() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260812-wq_fix-v1-1-f7effcfa8d37@debian.org> References: <20260812-wq_fix-v1-0-f7effcfa8d37@debian.org> In-Reply-To: <20260812-wq_fix-v1-0-f7effcfa8d37@debian.org> To: Tejun Heo , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, marco.crivellari@suse.com, Breno Leitao , kernel-team@meta.com, kernel test robot X-Mailer: b4 0.16-dev-f8e9d X-Developer-Signature: v=1; a=openpgp-sha256; l=1413; i=leitao@debian.org; h=from:subject:message-id; bh=EUCnzMopjFl7Y7T5xg+qdJ6AN3Wgc7zNwIVj8+t4kco=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqfJnqsMXgHlWNFsAhpy3qKsec+IkdIt82HZjXz JqO0IvW0XeJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCanyZ6gAKCRA1o5Of/Hh3 bU5JD/4w+JQUus2En7FkO3JStGRLDR6n773yRV0zfq6EpK2Dw/NwsEm7mKhPwinurwt50ZGOFWB bNuwyoFQ6CWcRhJOS506ftp887YmerchR1ArQfY96w5TbOjOYIC9Pi7kP9Q/uG12e6Tc/Xrpxk0 EGttQb4jd2oe+SFefExIQ28meFr9TqGKVLnyJC+6kctPBKQd9/CZ50VmtjmvOUoPwRqKNZUKqx4 y79FC/2yS+FxO6e39fO7l5U3z9KNf7Jf7ntsPKBCe0bgJItWe/5Wd1HPgoQ25QijRypICvEl1FP SXnJqhtf88gZJiQ8RaOtsK0zP2zueYKDDEQhJNAPzgt1akgjnu19l+yforSpSUpi3sAVBBmkl4i tIpqJevAcaLd62AQCl98tpLF0iQK6qhurTWA4nPdsRW8SiEYGRzWliW2fN1flhTJgUBYXykzRUw /x3sTFmSipelcfGPhpwcjiHIoH3Vjcl8jgmBoQsjW4Y38fEHzMjUzEjshaj1MMAK0wNvJi1v8Ed 6tKIrDBW2EvWpWAK7vHvL++K3Y4noYWpJHipxG5Xy1un7N7yUSeWLj8luKvtTgSW7pOkJKNfSTo hq8QJzRldMiFFtxaFtsA1d60dk3N7Wptrc91XjnDWnyXgRXBYrDboRYqmuX+G0MrZCO6a5wbJgR xUcC5El8r5ixgJw== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao workqueue_congested() fetches the pwq out of wq->cpu_pwq with a plain load, so sparse complains about the dropped __rcu: kernel/workqueue.c:6304:13: sparse: incorrect type in assignment (different address spaces) @@ expected struct pool_workqueue *pwq @@ got struct pool_workqueue [noderef] __rcu * @@ A pwq is released with kfree_rcu() and the read is protected by the surrounding preempt_disable(), which is what commit fd5081f4ef33 ("workqueue: Remove redundant rcu_read_lock/unlock() in workqueue_congested()") relied on when it dropped the rcu_read_lock() here. Use the rcu_dereference_sched() helper to make that explicit. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202608120931.tvTzq1gD-lkp@intel.com/ Signed-off-by: Breno Leitao --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index de888e043d115..1748ef5541a26 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -6317,7 +6317,7 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) if (cpu == WORK_CPU_UNBOUND) cpu = smp_processor_id(); - pwq = *per_cpu_ptr(wq->cpu_pwq, cpu); + pwq = rcu_dereference_sched(*per_cpu_ptr(wq->cpu_pwq, cpu)); ret = !list_empty(&pwq->inactive_works); preempt_enable(); -- 2.53.0-Meta