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 F39E130CD95 for ; Fri, 31 Jul 2026 11:57:54 +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=1785499076; cv=none; b=r9p/9WNcSUw+KvnKmHGt+V62EC7ctNOWaSEK4rTWYLy7p65eW9XOd9GigfDqrRUOZipxTTexyNdalzUNoZnk7nvG+2CW4q1JdAXd/ziytlslSOYnXbT4CoMxr3HKkttbm2u1+hv1GfLjSW1ChjIr4QDIZt4u8hRFo1sYX7l2U/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785499076; c=relaxed/simple; bh=cCdLgnBQMg69J3Fs7YVBPH2QpICVQnQBGB4Y9at8DUU=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=ldebup2clpelHCgFwPwo13HBH4sOEE9H0Jq3yn1iSiDugg9pHH/91HNWVs4OG47VDyDIh0Qm+NgMo3fLEEWbdLrNt3TqjplKmWid509e+YQD+mBAVbqX8CvlEQ/W7B0xA7fDu3+/Vy1dZ3ETGo6j0FRtFy7VtnLWk96ceIzwZDs= 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=ZUt70dIT; 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="ZUt70dIT" 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=jxFhsG/MuM/bYr2Be6WgiwdSzMsD3ySDtluW8oNE7WM=; b=ZUt70dIT0c+LBL25Tsh0nYYOzc xdsQxzgZM4x56zMVI4IOPeR34/bNcEVqMr3GUTcW3FP5Z8nmW0CBghy3b/WNks1i0jfiumQV9Cfyu gWSYsGSlmAS3xXuJmmoJvzB+uXpwZDBVmcyL9vmiddNsTuzscWZEVmL4sTzFvAjnMVDKW20CRerCX pps69SJBbQiBSs5WoXw8uty4IBPOh3A0p+GtKIo+dE1gq1wuZIJv1L2tAdTFDT6RtogW2SX4ufRTT Eznkp+eEMV0/K1DvGmPXnPaXJjF9U+V8rux8njByoR3t+hbhTLEVljQsf3ZIzH3usVU/WpRXHDjVi DWcEcruQ==; 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 1wpls7-009zcN-1C; Fri, 31 Jul 2026 11:57:51 +0000 From: Breno Leitao Subject: [PATCH 0/6] workqueue: base pwq pool release and nr_active on the backing pool Date: Fri, 31 Jul 2026 04:57:32 -0700 Message-Id: <20260731-wq-pool-refactor-v1-0-8eaf71cdab5f@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: 8bit X-B4-Tracking: v=1; b=H4sIAK2NbGoC/yXMQQ6CQAwAwK80PdNkqYngfsV4gLXVGsNiF4SE8 HejHucyGxZxk4IRNnR5W7E8YIS6Akz3brgJ2RUjIAc+hoZPtLxozPlJLtqlKTsF7bltuNb2oFg Bji5q6688X/4uc/+QNH0f3PcPk8Qi6HQAAAA= X-Change-ID: 20260729-wq-pool-refactor-0fb28721f83f To: Tejun Heo , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Breno Leitao , kernel-team@meta.com, marco.crivellari@suse.com X-Mailer: b4 0.16-dev-d5d98 X-Developer-Signature: v=1; a=openpgp-sha256; l=1623; i=leitao@debian.org; h=from:subject:message-id; bh=cCdLgnBQMg69J3Fs7YVBPH2QpICVQnQBGB4Y9at8DUU=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqbI281O182BeY8+zYYn9dkjHztd2VBNplb2trH kCx0LS/LK+JAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCamyNvAAKCRA1o5Of/Hh3 baZuEACG6DRU+2CaFlYBOhbb15Dc0SiWl3VjbhC+N59i0T5Y5k+y8euFZvPWuDv9gk4+Frs3FKy 44PBtBU47+SIbgNlkTLjEbXUJlenSmDOWWrrgRBmt4bqxDKg6R4cMVOurxkx18OnHzh5sFZ8Tgg jjFg9kAqyfrfR40ZYFMxv+CbttK308ocbX6yfAT2GrS9pGwwlLqSdw9OqhXj1zVu0NqH3jfsqaJ yMWeMTyvS86CvPnZ0RhxZ3FXjda/XusOa6xd0YTDADaVOUV/szJNP/Z7M/hJhrVnzdjZH1otgd+ N9X247bW+B9ZpSOv5RWQXhWyyuzGwjbn/CrJ5gIGPIT4D6nkpu5sp2WPjSHYekq5cY5OGAlowyz 8dH+HMmDGsYBNtwv5P7NpjD6PLs4o2vHBWgWy6VuELh38Ap7DmaWKENlIc5OnA53Vfnv6M6jGqt UUkdKwo88RsPtLe4N/z6Va00Ln9e/09KD+b6msSpujo3HzEJYs/Aoo8+Ig+D6uWxOrphIylEMEg W147qO+c3eBQo4Bv/wIfqeEtt5EQZzrRsqBLPHezqY0E6IavykpiiljC2OzVvb1t/tY1hgerw/s guP4rg6whtkQtQFUaZJfqzzBiESSIuMVUesjOHigPjLlRytd12DB9t/gBTesB54gprMUXUozvcI gXzDUV2OIAi6C5w== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao The goal is to unify per-cpu and unbound workqueues onto one backend, so an unbound workqueue can run on the concurrency-managed per-cpu pools and WQ_PERCPU just requests that backend [1]. This series is preparation and changes no behaviour on its own. These changes also is a reasonable readability cleanup. What will come later: * Introduce a concurrency-managed per-cpu affinity scope (WQ_AFFN_PERCPU_CM) — percpu as an affinity setting * Direct pool selection (fold the create-then-convert), and rename the helpers that are no longer unbound-specific: install_unbound_pwq(), unbound_pwq(), unbound_pwq_slot() (and alloc_unbound_pwq() -> alloc_pwq()). * Dynamic switching between per-cpu and unbound backing for CPU isolation. Am I on the right path? [1] https://lore.kernel.org/all/ak569WYSm3ygKl1-@slm.duckdns.org Signed-off-by: Breno Leitao --- Breno Leitao (6): workqueue: factor out get_percpu_pool() workqueue: factor out alloc_and_link_percpu_pwqs() workqueue: release pwq pools by pool type workqueue: account nr_active by the backing pool workqueue: add a per-cpu backend for unbound pwqs workqueue: install per-cpu pwqs at creation for __WQ_PERCPU_POOLS include/linux/workqueue.h | 1 + kernel/workqueue.c | 143 +++++++++++++++++++++++++++++++++------------- 2 files changed, 105 insertions(+), 39 deletions(-) --- base-commit: dbff1ec23f68640a743512e8ada125795d1b72c7 change-id: 20260729-wq-pool-refactor-0fb28721f83f Best regards, -- Breno Leitao