From nobody Tue Sep 29 04:12:36 2026 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: quoted-printable 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 (differe= nt address spaces) @@ expected struct pool_workqueue *pwq @@ got st= ruct 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@int= el.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_st= ruct *wq) if (cpu =3D=3D WORK_CPU_UNBOUND) cpu =3D smp_processor_id(); =20 - pwq =3D *per_cpu_ptr(wq->cpu_pwq, cpu); + pwq =3D rcu_dereference_sched(*per_cpu_ptr(wq->cpu_pwq, cpu)); ret =3D !list_empty(&pwq->inactive_works); =20 preempt_enable(); --=20 2.53.0-Meta From nobody Tue Sep 29 04:12:36 2026 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 0411338B7BD for ; Wed, 12 Aug 2026 16:06:18 +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=1786550780; cv=none; b=Kb7NpktgZP1mPTsXPsQ+LQiZQBa5hCiCgVIKFGU2Mrg7r/LpT0pw1yJRdI8ierURDk7NecNcAGVpvSZOZCAjm11r/TnY8BEyGXAJio+bkGXDCQnujoLQUM2Z+MZZ8VisiBG6i3yV9H2Y0pSgXY287LI8e5Cay6R7Wh7YRd5TpLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786550780; c=relaxed/simple; bh=/nxG08IJHJnK3T9ujbCs2S4Twnv+7zn3QAKMNGm9VlQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ObbvB097kbw256dlVWZPJYlaQdsb6R1Vyc9RRYcMY0GR6TtKGJIsacSqKaFhi9Rmpa6m7Lu0qHjINmFnDFs+4yA+IncItz4Hee30Q3uRj0cIdF78gplBQFSX7vUsFwb11k57SKh8eBg4MQtrOO+x6o/56y054P2V+N1smcrL0DQ= 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=FjkITe26; 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="FjkITe26" 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=mes2dCXEp9rCBbWGSRp6NQvOEUpVwdisirC8ceYqxHk=; b=FjkITe26mTJ9RjRM0uPhzm/Dvc xdh5j30p9LlvQDgHVwVYxyVx/3rUORt2N6GfOm4OtDmGXltzck0QeQpggUVJHZhLwikWJlVf9eUUX qVPh0oKlsnPvP9CajnmcR/02oNDbIFl6mXtatXtuRdAClOk28GC8Cj2GPfSQ7Luo9p+O7hMucSJFX ZTb8nZcWq1h6NdTXqW2RSbbsnewR/jj46Xfdp8Cy3z4ZysZL8IlsuJWNJO87syR7kym68h1DICOno VqhQwbPeGnlv61E4vgbZE21qrFLG/HkcGrvz1FsIKVQC3btAzSj+HoqTkQDomeOu4ukoUUaBxS+6P OrKnJ1RA==; 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 1wuBT3-004SGU-0e; Wed, 12 Aug 2026 16:06:13 +0000 From: Breno Leitao Date: Wed, 12 Aug 2026 09:03:19 -0700 Subject: [PATCH 2/3] workqueue: use RCU accessors when populating wq->cpu_pwq 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: quoted-printable Message-Id: <20260812-wq_fix-v1-2-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=2665; i=leitao@debian.org; h=from:subject:message-id; bh=/nxG08IJHJnK3T9ujbCs2S4Twnv+7zn3QAKMNGm9VlQ=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqfJnqyhhaQbrzcfXxU/mRC5qRqYNff0jKHkZrO b413AbJrZqJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCanyZ6gAKCRA1o5Of/Hh3 bSfJD/95SnFy8AkO6r0m9bOJO6OjUAEznTp7s5UfKCQFGEqQv9gIXwtmPHNMZQRnRZcnFPOi2Kf +lzWV8EX7WiyOD1sgFUtw1rT6xE5q/s3NGckKK7AqOxVuS0DEykhsEklrZ5dF5wiYOAbjRP7jVC TJtsV2PUcOxyQg/GNZsVOiZ+j1jwY/887SmERmknfhClVjHz591M0MrjfvwfeTR+7vcEgUWXofi Gr2dtqccWmJxq3jXYlpm15WvGx43GHoxXi/CPl9/eW/cv8gM4AzP9AH3txRgA0uUtJ0NasfG/8N V8iB8/PW2vsg8jbKEYs3NaS6d6cV3CV2XyGnozayHU4hRmQ5rM94ihLM7cEY7CHPkmGUDIAmSUR seZloG7W3BCMDKalUbTgyxaQg7L2TeRjIT7Qwr80iToVSlTlOL4n4oiXzx92UVwyqCiNF00wem8 ng7VGCnKvoNFICr0pSo2GQKcUTxn2sIeNhToR7cbXEJkff1xzA/hEzheKvPQxkSx33lmHszD8Ns 7U/f1AfTn2MTHbHtQEdgV5TlQlr3+t3xmQURMQqprtMVwDV8HZBTCud/qj9ymPIJkmhDxGVIhVx XgbNivX2hO4iRBV8lnA/STU+j147OThd1KDzC0Xw3ym2d4FctJ1Skskq7smRyA6f295pvPCP1KV 5aL2ldJz0k1aw+A== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao wq->cpu_pwq holds RCU-protected pwq pointers, but the percpu allocation path fills it in with plain loads and stores, which sparse flags: kernel/workqueue.c:5682:57: sparse: incorrect type in initializer (differ= ent address spaces) @@ expected struct pool_workqueue **pwq_p @@ go= t struct pool_workqueue [noderef] __rcu ** @@ Allocate the array as __rcu pointers and publish each pwq with rcu_assign_pointer() once it is initialized and linked, the order install_unbound_pwq() uses. The warnings are not new: commit 79f23600bc7b ("workqueue: factor out get_percpu_pool()") only turned the flagged assignment into an initializer. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202608120931.tvTzq1gD-lkp@int= el.com/ Signed-off-by: Breno Leitao --- kernel/workqueue.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 1748ef5541a26..83aced28523b5 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5681,21 +5681,23 @@ static void unbound_wq_update_pwq(struct workqueue_= struct *wq, int cpu) =20 static int alloc_and_link_percpu_pwqs(struct workqueue_struct *wq) { + struct pool_workqueue *pwq; int cpu; =20 for_each_possible_cpu(cpu) { - struct pool_workqueue **pwq_p =3D per_cpu_ptr(wq->cpu_pwq, cpu); struct worker_pool *pool =3D get_percpu_pool(wq, cpu); =20 - *pwq_p =3D kmem_cache_alloc_node(pwq_cache, GFP_KERNEL, pool->node); - if (!*pwq_p) + pwq =3D kmem_cache_alloc_node(pwq_cache, GFP_KERNEL, pool->node); + if (!pwq) return -ENOMEM; =20 - init_pwq(*pwq_p, wq, pool); + init_pwq(pwq, wq, pool); =20 mutex_lock(&wq->mutex); - link_pwq(*pwq_p); + link_pwq(pwq); mutex_unlock(&wq->mutex); + + rcu_assign_pointer(*per_cpu_ptr(wq->cpu_pwq, cpu), pwq); } =20 return 0; @@ -5708,7 +5710,7 @@ static int alloc_and_link_pwqs(struct workqueue_struc= t *wq) =20 lockdep_assert_held(&wq_pool_mutex); =20 - wq->cpu_pwq =3D alloc_percpu(struct pool_workqueue *); + wq->cpu_pwq =3D alloc_percpu(struct pool_workqueue __rcu *); if (!wq->cpu_pwq) goto enomem; =20 @@ -5734,8 +5736,11 @@ static int alloc_and_link_pwqs(struct workqueue_stru= ct *wq) enomem: if (wq->cpu_pwq) { for_each_possible_cpu(cpu) { - struct pool_workqueue *pwq =3D *per_cpu_ptr(wq->cpu_pwq, cpu); + struct pool_workqueue __rcu **slot; + struct pool_workqueue *pwq; =20 + slot =3D per_cpu_ptr(wq->cpu_pwq, cpu); + pwq =3D rcu_access_pointer(*slot); if (pwq) { /* * Unlink pwq from wq->pwqs since link_pwq() --=20 2.53.0-Meta From nobody Tue Sep 29 04:12:36 2026 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 E283345C6E7 for ; Wed, 12 Aug 2026 16:06:20 +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=1786550782; cv=none; b=Z6JtQP2Ac5c3A8wHStdECCFinVfS/m9n1nryMHtF36oqTui1Gmbzrs7WtOTV3yJft5IZUB4TGRKbjHGjAT6h2sniqHUJTlmF+H1pcRhr8ZziWax4IqGra3HChJOtR8mLxvEpIXfK3y8+OMaMgyQQRfdYz0mUNO+iX0Hn+0nfpzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786550782; c=relaxed/simple; bh=6wpuII1LQVTWUCwSjm2PS1ZsS/7+Vvy4XqT/pyoDw1k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ll+uDZSnsy3XT4HsxsSy5BWuJA6fPl3qXfS3a+p0U1Wt1Gz3JeFfb+AQSHFtIPqhwZI8Mag/3nrY1P4VyPW737fMVk+uM8K4jqm/pt/6zUDGu1ZGvYPyD5IrX8fjTa601y9UBvxJNa4KDlcfdbgVi68vepgMiDQqpaovMxuxpbs= 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=gKuS4Xgd; 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="gKuS4Xgd" 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=pzQW7NkwmWknZ0N/HxFWuFx3VFrG+o7YjEGzu0WmMts=; b=gKuS4XgdJOGi57lNTTLaRtVBdw k/To+FganM0rgopOWseVyvP0hKhPtcMc2NTqAFeue5P1ADwMZtxgeFxSIT4PKfLnt/kUnAzDPgiIN UrGHzkRRTz1mTkNBWfiNqXdWPKGXekHlMS1PFUMiLtI0J+w7qGE+A5Zmwt4wK52cYyUy3HABicj93 RjzqZUJsK8QLRBn1Z17LECjewbpVs7Qfuphcl+EtgOYrMQfmR+SC8hi0pA2Sn0X2aoP4/IKrLSJ0s n7TVUMfP287LpfBcs3ZNYI2ZiLBZFQ+03xIAPEjERQtPd4sIU8dyBSz0dPTkrj2EnQd/Bt+kN6+2/ 2dJ16nHA==; 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 1wuBT6-004SGl-1U; Wed, 12 Aug 2026 16:06:16 +0000 From: Breno Leitao Date: Wed, 12 Aug 2026 09:03:20 -0700 Subject: [PATCH 3/3] workqueue: BUG_ON() instead of returning NULL in wq_node_nr_active() 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: quoted-printable Message-Id: <20260812-wq_fix-v1-3-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 X-Mailer: b4 0.16-dev-f8e9d X-Developer-Signature: v=1; a=openpgp-sha256; l=1025; i=leitao@debian.org; h=from:subject:message-id; bh=6wpuII1LQVTWUCwSjm2PS1ZsS/7+Vvy4XqT/pyoDw1k=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqfJnqkAymjlTlwbat0Y8l4up2aMp7RF3prLdCW gvG5kvfZbCJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCanyZ6gAKCRA1o5Of/Hh3 bTkTD/4j/aYzZU2pqwGkxgo5ZLIvueVTxMeqMJ1VR2fDdi/cliboSLpXV3cFJ5uBPtJPqJ7OxzI nBJv/W53D/RP4uf4F4MSLpGTKqY8JG/9JuBkyBucNeJaciOvRn+hHZvOtoTY3A5ov8JBer/xxC/ 06Sm3IagNhylyF40ESfriSOMoeulyjfJseHi1qVThr8Tum5QJ9tVYkXhVBsneXR0GjGkZGZ8022 tDAbFox59gEGWKG/dx2wNtQwc3BBGE5VJTgCiPLgSs0jItg5oW5nLxGjbVQbRYF9Tqy0IvNXrdo i4JBykU4t0s6JtDvmQDARXk6niwjVn7ZyvXXb2uyeKmBOsT2nc5q32KMM5bjIhgOsdvVlfoYu4f +PPbPW1R1tB3ytjwH4b6VEKE0X3r3f5dkmp0CC1EQ5eecyxml8pwbJpanya2EYFHv3yYhZvqJMK C9n6HyAqi2ldcO80mbs/t3R74wlwygTAARZOYyLc4au8GE/JE06+cxwVVWB1MBz28t3XSkMCqVJ Tvu04pOqWBHAX8bCAB1XSZfiCPw5N0dXDF8I0pauPjU67qPBXExV/RB8GxC41IU18I2STqbo7me egVICIp7Vn+Kv227q5jHtUKZOhjaVqCa8ohYXN59wFI7Q4WL0HxFXQAPGptGqA9pYhGA/WAp1Qm +/HDH0zwkcuvXhw== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao wq_node_nr_active() warns and returns NULL when @wq is not unbound, but every caller dereferences the result right away, so the WARN_ON_ONCE() only moves the oops one frame up, as raised by Tejun. Fix it by BUGing_ON() instead of this silly WARN_ON_ONCE(); Fixes: b72fdc651056 ("workqueue: account nr_active by the backing pool") Suggested-by: Tejun Heo Signed-off-by: Breno Leitao --- kernel/workqueue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 83aced28523b5..cbc416147dcaa 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1625,8 +1625,7 @@ static bool is_percpu_pool(struct worker_pool *pool) static struct wq_node_nr_active *wq_node_nr_active(struct workqueue_struct= *wq, int node) { - if (WARN_ON_ONCE(!(wq->flags & WQ_UNBOUND))) - return NULL; + BUG_ON(!(wq->flags & WQ_UNBOUND)); =20 if (node =3D=3D NUMA_NO_NODE) node =3D nr_node_ids; --=20 2.53.0-Meta