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 E5B5A38333C for ; Wed, 12 Aug 2026 16:06:15 +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=1786550777; cv=none; b=D3ALapS6ymAs2WnnM5i789EuvEHGfaPeTX/XC/uvsJstZ3Q40gBivFu42AJF1iCi5ldOZRp2LFwYEwsQvCZI1SnPrwfl91SU+fS/Ot2cSZBuMO+9X6x5FuctZ29Wx49E9QlGBzKpwUrIdM1rnvXYa1yT7Ki4CO9MG14z9EpxwOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786550777; c=relaxed/simple; bh=ygXa1jw4KskEiotfQPnYEZcEV3+Atekb23fJxWW0kfk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=QMhrXTtluDwuD9/2kIK0He7knRUrcAQPz4Q8eODW9ELUlKIFT4PIhUEfwPSn3STNcB1Xu+skLRxg9MrmLDtAvjIX9w+PK6PgCBo8Gm6dvdVB2py7IPUBl613+IMxusIXNfmxRTBHVy+s7vE1REpeKS3E83WHwEKYwTssoJNNcrs= 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=UWHRvspj; 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="UWHRvspj" 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:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:From:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=GHLv4qXqPMzMvRs81tgEq6fURdrScGX8MDr9YpPVXEM=; b=UWHRvspjBdKGfFZic83pi6xyQY La4TZg9cEqIt5cSfVIE8Xn6lCaJ8vJn7lCzkhPOsFxOz7gk78UTaHs81GQgslAeov1fn44uD11ncU jebOOd5H1aQb03zdIyLuRlh+4bw1TXP0YLCROA3KNrGQs2eHegDKiJ2J8BLWdGh3bbIGmp+KEhPhZ F+zK4sGYaaXTOJk1eRdqe+FiGodIPwboKoJBBYisY7i0+675Cqq+JsyJDaqlmHNyspc1OcLjL2QSi qzgH/qLcLcRl6Rwp9kdb5fk5FHjrFkelIk168xZz0NzBboXoHCwHirM3qpBQ7iqXUfEXLGQEour2m nNfE2QMw==; 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 1wuBSw-004SGE-0z; Wed, 12 Aug 2026 16:06:06 +0000 From: Breno Leitao Subject: [PATCH 0/3] workqueue: sparse and wq_node_nr_active() fixes Date: Wed, 12 Aug 2026 09:03:17 -0700 Message-Id: <20260812-wq_fix-v1-0-f7effcfa8d37@debian.org> 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 X-B4-Tracking: v=1; b=H4sIAEWZfGoC/x3MWwqAIBAF0K0M9zshpSLdSkRUTjU/PRRKkPYed BZwMiIH4QhHGYFviXLscKQLwryN+8pKPBzBlKYpW23Ucw2LJDWx1Xbyra0rg4JwBl4k/VHXv+8 HdAKzOVgAAAA= X-Change-ID: 20260812-wq_fix-be919bd89542 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=1514; i=leitao@debian.org; h=from:subject:message-id; bh=ygXa1jw4KskEiotfQPnYEZcEV3+Atekb23fJxWW0kfk=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqfJnpJcYREgnYF1xcdZwD4uAGqNjNrI6Pu68X3 c7vyYTUOY6JAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCanyZ6QAKCRA1o5Of/Hh3 bVkMEACtnMf+2CyHj0HeItsDJ2glEuNFc8nzyayN1sdASOoQe/Lo4kWwYDMPUU8TGXaBMZs6vYx zBUgMVyVMpjble2A+ixptdjyBr+Lpnzq5FRXBt0e+LevsjmesZ6Y8/tfUCjj85qxdfChWy66ybw FMC00GpfgisB/rC34R/z3F5SP7FkfmPD9kTpIpvi+E5z7cQ1O0sawUb6hAwYKgES1a2SHIevxiw 1BiSUuOusjZ24TVD9ZKOTrVf0MZxP5+76JJuxwXwJT7GVz1B91Q80SukdQ/i4nswc0ocGJXR0EA tSkrSnwRYS49QKU64lErCSiXdsabrYhdzSa41HGyWwMUKQaXzTDNf676ehC63rIC5XcQk9vNwQE K2iK6lqOka7sGfMGaLNg4Y8YBA6omgPaDLgljFkEEgJ5C76a4OSrCovXRjwDIyD1r/z+wKZ1nIR KKyFZ9AZ0RIV3wbAqhJkPLvHCj2xtysVTaG+r8a8HavKxMQCqBu7yy/nY/vyYxyia5HCwGxP0W7 0ctrd8S7TnqWCvqhLChkzFmp/7pONzYc3KfCdSZpR0940BH298tkaRJJ2tE75z5JaT/ZYYecujc 4ntCQuigq0BHHE/VXcqiZmiu51oF6BeG0VpXyrptDcdB1+fasfgUJ5sMu1MEBZnWRkEGnryopTE oqyzOsHkW/VZQTg== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao This is a follow up for the patchset named "workqueue: base pwq pool release and nr_active on the backing pool" Patches 1 and 2 answer a 0-day sparse report against the percpu pwq allocation path, bisected to commit 79f23600bc7b ("workqueue: factor out get_percpu_pool()"). https://lore.kernel.org/all/202608120931.tvTzq1gD-lkp@intel.com/ The warning is not new, that commit only turned the offending assignment into an initializer. wq->cpu_pwq is an array of __rcu pointers, but workqueue_congested(), the allocation path and its error path all go through it with plain loads and stores. Use the matching RCU accessors instead. With the two patches kernel/workqueue.c is sparse clean. Patch 3 is a separate review fix: wq_node_nr_active() warns and returns NULL for a per-cpu workqueue, which only moves the oops into the caller. This has been stress tested with a "debug" kernel and wqtest test-suite: https://github.com/leitao/wqtest Signed-off-by: Breno Leitao --- Breno Leitao (3): workqueue: use rcu_dereference_sched() in workqueue_congested() workqueue: use RCU accessors when populating wq->cpu_pwq workqueue: BUG_ON() instead of returning NULL in wq_node_nr_active() kernel/workqueue.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) --- base-commit: 5e6de6a2b522f659defacb1551d0465ba6ce13cf change-id: 20260812-wq_fix-be919bd89542 Best regards, -- Breno Leitao