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 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: 7bit 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)); if (node == NUMA_NO_NODE) node = nr_node_ids; -- 2.53.0-Meta