From nobody Sun Feb 8 13:32:24 2026 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A43BA38BF8F for ; Tue, 13 Jan 2026 11:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768304808; cv=none; b=a+HS/0/Rin8LXqGi+ZTFUJdrEvzLB+em+h76lqw2A+ZBkl/YvwAihE/bwQkuy28n8Y9vyp/2+1Hcm1ox9nVDybQfCQ702QE0lEQTxE+JY23j6IkWdo7Vw+YL06DI/kBIhBCmFgneFlWnwCeBAscgZAGXSPgSW5+A1b222oKgWpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768304808; c=relaxed/simple; bh=XB115G7zIOxRcVCPI+EOl/BvrxltDXuzReUUWKXR/ow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lLZNM08lUAvSvUizLQ+NMIYdCocM74k3ENWnLIyKl5XAkgZ4+HI58+780CZ+7JYUj38jCaY8thnXDtVY5M1k0IpW5jmeyHs0Sq8XRhUBPis1hwwBJgzDnhE7JQfS4iBO3fAIEmhuTSMQPjnL08Ddwt7l3dAv596ddkN7qgrXlnM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=fOb3bjl/; arc=none smtp.client-ip=209.85.128.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="fOb3bjl/" Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-47eddddcdcfso1580705e9.1 for ; Tue, 13 Jan 2026 03:46:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1768304805; x=1768909605; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BTBOAHx8kC/AltJ4R9arhM2oz1nWe3b17NlGYVc9Kto=; b=fOb3bjl/8sAGsWoUtj32ymwhMvvG1bpyEuenxrUvMubUG1ViHCmYaeSA6JdIUSs0P3 BS6NtEI9Hchgs29VFk+N3amcKwwoRyqKkLgwap2x2FmAQYIGXgImawdnBI8kdBiAhCTN 4eIASTOyWYMCb6Jd3JCpDtZ3xFKA7l4nlzgq7AQxt3s7J4t13pfrXV8LbXAmXk6U07Wc y055HsX1j31NGSieh6eHv2y8cH56v67YnPrUYX4yN9EYc+EpyKapOa4r5ni//EMCNro/ 60bMwehR5lz4CkHhRjGycMMAIs7465RFFXkdZUXA8itLfYsxy3nSfgJ2kscUBQCOYTet DPOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768304805; x=1768909605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BTBOAHx8kC/AltJ4R9arhM2oz1nWe3b17NlGYVc9Kto=; b=upzg9jYpfWabJ0Ob5c7jiy/MYNpaDKFyoZBiZYaYAO+2tG8oYW4BGoS11yF1AMV1cW a0wtbTpc3InoLdSt3slfstqUWboggcCl0PhYJi4XgEm5qywtYeIR+wcnLd1Nzjw4GaAO JT9yr1gVKG2pWknmZSJjm6VwYV2E3Jl7RvrgdpqISEjr8YFZ5c3KlKnbM2LGxIOShdC6 I9sW3eoXO+cOHE0O7Pult+k93lf7kTfjhxE3lgt/VCFWc0Ri/Dvzj1Sh+VUO8UkDmXtz cFSSulXF3jTrsbTE/vRgSNX3UZ5du6wY9LCM7y7BDCx+b5t0BBORE+WXUtX7thQuWHzs sofg== X-Gm-Message-State: AOJu0Yxion1ROMEfyFjRF4DTU24o/DpmSdPQsV/6qym6pzScCTy0kv/V Z/FMDMLqB/UJifSkN8vishSFaz/CYpRkmEBgU4++q2ujzDYfUynyVE8/Q4sQqtdwk8hwtA8qoOT 23Vky X-Gm-Gg: AY/fxX5PUK9IprQxLY3nYlaupo1ZKoCCymlXdE50OQcu7SgOXQ+LRfHCiHMZHToGvnh jD9gdJITFdGt3QohUeYyBwt8OWQqLQBpkLeAeS9HRb9EaX3ugERaujLLamocINkTKKsK/fTbwux Z3YT9AmOiP5a4s42Pu5Fi/lgKvdcsknI7gqFFFfEBT39qA51RFQOJS78m6bRm8cCXNOb4JBBfCn pvpom9nvnO4elPfFglmBzPTAfjj2kvIrnDtfrrnSxT8KX+hnJMPeeJ+8TPGW6Dq5bNnEGOZJcnK UU+lYbGO1+dc33OrYzmaY1/KReOfXXqKXEDJXYnjvxoVpTEcUplFCIOYfKKIzeDspleXra7vByS lNeb8OqC4fA9qTWH7grO8W3up2pUvR8/KkL16Kf57i70clRUwKz3ML87QDdYYV1eJvtHp6HjueC +VralUN9UKPq6/xOV7xK0F0tLz X-Google-Smtp-Source: AGHT+IHrIN7h8sV/YRAvc8mKLxh4bW7VACxa553D0Xs9BN+wwOTnKHRzUIKMY9+nEdhfaWK+hmeA5A== X-Received: by 2002:a05:600c:470c:b0:45d:f83b:96aa with SMTP id 5b1f17b1804b1-47d84b0aa1cmr231912065e9.7.1768304804715; Tue, 13 Jan 2026 03:46:44 -0800 (PST) Received: from linux ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f6953fasm391850225e9.5.2026.01.13.03.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 03:46:44 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Andrew Morton Subject: [PATCH v2 1/3] mm: Replace use of system_unbound_wq with system_dfl_wq Date: Tue, 13 Jan 2026 12:46:28 +0100 Message-ID: <20260113114630.152942-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260113114630.152942-1-marco.crivellari@suse.com> References: <20260113114630.152942-1-marco.crivellari@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch continues the effort to refactor workqueue APIs, which has begun with the changes introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The point of the refactoring is to eventually alter the default behavior of workqueues to become unbound by default so that their workload placement is optimized by the scheduler. Before that to happen, workqueue users must be converted to the better named new workqueues with no intended behaviour changes: system_wq -> system_percpu_wq system_unbound_wq -> system_dfl_wq This way the old obsolete workqueues (system_wq, system_unbound_wq) can be removed in the future. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari Reviewed-by: Frederic Weisbecker Reviewed-by: Sebastian Andrzej Siewior --- mm/backing-dev.c | 2 +- mm/kfence/core.c | 6 +++--- mm/memcontrol.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index c5740c6d37a2..2f65b5416228 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -939,7 +939,7 @@ void wb_memcg_offline(struct mem_cgroup *memcg) memcg_cgwb_list->next =3D NULL; /* prevent new wb's */ spin_unlock_irq(&cgwb_lock); =20 - queue_work(system_unbound_wq, &cleanup_offline_cgwbs_work); + queue_work(system_dfl_wq, &cleanup_offline_cgwbs_work); } =20 /** diff --git a/mm/kfence/core.c b/mm/kfence/core.c index 577a1699c553..36cc78ede411 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -878,7 +878,7 @@ static void toggle_allocation_gate(struct work_struct *= work) /* Disable static key and reset timer. */ static_branch_disable(&kfence_allocation_key); #endif - queue_delayed_work(system_unbound_wq, &kfence_timer, + queue_delayed_work(system_dfl_wq, &kfence_timer, msecs_to_jiffies(kfence_sample_interval)); } =20 @@ -928,7 +928,7 @@ static void kfence_init_enable(void) #endif =20 WRITE_ONCE(kfence_enabled, true); - queue_delayed_work(system_unbound_wq, &kfence_timer, 0); + queue_delayed_work(system_dfl_wq, &kfence_timer, 0); =20 pr_info("initialized - using %lu bytes for %d objects at 0x%p-0x%p\n", KF= ENCE_POOL_SIZE, CONFIG_KFENCE_NUM_OBJECTS, (void *)__kfence_pool, @@ -1024,7 +1024,7 @@ static int kfence_enable_late(void) return kfence_init_late(); =20 WRITE_ONCE(kfence_enabled, true); - queue_delayed_work(system_unbound_wq, &kfence_timer, 0); + queue_delayed_work(system_dfl_wq, &kfence_timer, 0); pr_info("re-enabled\n"); return 0; } diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 86f43b7e5f71..6b69b8ee023b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -644,7 +644,7 @@ static void flush_memcg_stats_dwork(struct work_struct = *w) * in latency-sensitive paths is as cheap as possible. */ __mem_cgroup_flush_stats(root_mem_cgroup, true); - queue_delayed_work(system_unbound_wq, &stats_flush_dwork, FLUSH_TIME); + queue_delayed_work(system_dfl_wq, &stats_flush_dwork, FLUSH_TIME); } =20 unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx) @@ -3872,7 +3872,7 @@ static int mem_cgroup_css_online(struct cgroup_subsys= _state *css) goto offline_kmem; =20 if (unlikely(mem_cgroup_is_root(memcg)) && !mem_cgroup_disabled()) - queue_delayed_work(system_unbound_wq, &stats_flush_dwork, + queue_delayed_work(system_dfl_wq, &stats_flush_dwork, FLUSH_TIME); lru_gen_online_memcg(memcg); =20 --=20 2.52.0 From nobody Sun Feb 8 13:32:24 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9449F38BF99 for ; Tue, 13 Jan 2026 11:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768304809; cv=none; b=G3rF3NkAuGkJJ8mXDh2ulfjNOThYfpfDLBNB8N3Q6MyekV1zhMl0uSmXbF8bl/Jp5NLViRNyIxczm1AYw03sRKOk0sQJIOjLlYLD2RlfHn99ER7ZW1i+WkRHnSHmCkwMQNAstFNfPoHSXu8b2JqMaIXjpuLFBZhykcSn/n7FdOY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768304809; c=relaxed/simple; bh=Bu2jWDUnOAEzIUB9h8RtGJpuDvpVND3Y2rICryB1uw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XMdJIKpiVWEO9RA4IA+UE+Aqf+wj9QziHwH//EO7Dz0KrmR9ZzNMJ1r3TkE5HrB68vadrPaSD4U9COwiD0sJ10Y1+Vk4FLx5GwD3rjTT1bTYtMsyh+h5ApkiH8174JsmlDRmSkvon/ZCqhlYARxKG/3kmedSlqX2jbSGbDl6aLo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Fs4tKafQ; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Fs4tKafQ" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-47edffe5540so1448115e9.0 for ; Tue, 13 Jan 2026 03:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1768304805; x=1768909605; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xu2Gd9y2yQd69p5yQxI5o3t1KXuh4CilPfTzgbOnvsQ=; b=Fs4tKafQdNWEBT2G5xDLhjJcTzeHEVUIgZ3Jzf0/bb7SNMxzkXXCKZyqFO8sr9jgsg WhM0UUpxjDN7NVONCP8tXQhp56J99RjJiOqCe8Phn3hXGFQKH7FRffom6BSLyfLgxz/t 3W3mAlmanRRXa0sttmj83TK8YyqRuTu+IeznpbjXXzQma/QyoW0MhBySc9X5JMFgOA+5 7yfgNsR44Of3+VJC1Gf0utjGspCbAE/b/sq3BsueJqFiSWdHcH+xXCryb/V8j21Odxnh W87AinZDcr3JD4phOg7CckmTpt9CcnKShFiyzc0WySYRptdYIaI4CfJC6z+dPGua77wZ wkTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768304805; x=1768909605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Xu2Gd9y2yQd69p5yQxI5o3t1KXuh4CilPfTzgbOnvsQ=; b=o8V0mOh4dJkk96iNkwEdNtU+Iu3gnJIsjYBe88vn957WQbltEBfN5QU55CFIG4vfvl ZSUxykUWrsU1N4OyjC+pKP0p69Nym1fm1DD2j+rHfsmviO6VeADgctrWoy+wRFIjL7sY dLV0VPjBv1ZXkY3bxg8WIYX+ePmmdAqPfLDaRKlzT4I6x1ldV1/vZsi6kqnmcWycSAzl hqSwlmXys10q5WQxh//X4nxAz1VICS3Uf1ujM8X4pkF46szNBjQhPB5ZXAu7pRVixZPB Qi3TY8m7Jr+L9dE46YbgN6wnpSC2lgB7KMVEMgAC0NntKmviV+JPwdmdIxVp6AZe/FVM nPuA== X-Gm-Message-State: AOJu0YxGrKTefK8PnsRYG4bLHeRnrhz+R2H8t/KcqSHD2AiPi2vyUt9I b1dzBupP1W4gGQxLc/I12wuXtQ/I2BzjA4dxkYNqnYcP7E3kO9/p8PHPQIVpqkSya5NO5yPr72t +ELde X-Gm-Gg: AY/fxX49IHZ7jE9ehrTUNG2uBbPFdfNPhbmXmPj7qVKNn1teRXoO9zTzHRDNL9HL0Jf oN9kGuXvs2XyICJfj+v3I1vf0F7ODibJB+WrFgkfbqw0tAq0aoHopGPnIuJ7iaQ2Xbybq+uq0KY mrexv7yH46OxrWABJIY3VJGkqHPJFkCOK094DAjGy2qzN9cg6nqFZBT6TFkkbYIYtwEpGSPuGIY FA3vH6ofNv9YyDoTigeL36musbBenvDAUV3jcz6Djc1DE6k7RBySy8JKDu3+HQfPnzJonnQxVT1 V0GVS1qqBF+2+mI/c37Xc96XcC3cY/GDbSvOkWNixYOtOE1KpWlVzaMjBk/qbqQY1fiYz7/tSqo xH+v3nD8wlNEEwlOlWaF84mKNgROtaUt6M844tEGvXZsY1QGQ2YENocxC+5Os4D24FaasEcY20Z RsPsV0lvQpEv64RQ== X-Google-Smtp-Source: AGHT+IGJVKB1//BjsB27x5bhJ5UTOToFDrmanj64A2Fh/canwPClEtWxgbJynfd2lfSffDVitB+ueA== X-Received: by 2002:a05:600c:45ca:b0:475:e09c:960e with SMTP id 5b1f17b1804b1-47d84b38676mr247391765e9.32.1768304805515; Tue, 13 Jan 2026 03:46:45 -0800 (PST) Received: from linux ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f6953fasm391850225e9.5.2026.01.13.03.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 03:46:45 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Andrew Morton Subject: [PATCH v2 2/3] mm: Replace use of system_wq with system_percpu_wq Date: Tue, 13 Jan 2026 12:46:29 +0100 Message-ID: <20260113114630.152942-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260113114630.152942-1-marco.crivellari@suse.com> References: <20260113114630.152942-1-marco.crivellari@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch continues the effort to refactor workqueue APIs, which has begun with the changes introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The point of the refactoring is to eventually alter the default behavior of workqueues to become unbound by default so that their workload placement is optimized by the scheduler. Before that to happen, workqueue users must be converted to the better named new workqueues with no intended behaviour changes: system_wq -> system_percpu_wq system_unbound_wq -> system_dfl_wq This way the old obsolete workqueues (system_wq, system_unbound_wq) can be removed in the future. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari Reviewed-by: Frederic Weisbecker Reviewed-by: Sebastian Andrzej Siewior --- mm/backing-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 2f65b5416228..4c6f0b85a24e 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -971,7 +971,7 @@ static int __init cgwb_init(void) { /* * There can be many concurrent release work items overwhelming - * system_wq. Put them in a separate wq and limit concurrency. + * system_percpu_wq. Put them in a separate wq and limit concurrency. * There's no point in executing many of these in parallel. */ cgwb_release_wq =3D alloc_workqueue("cgwb_release", 0, 1); --=20 2.52.0 From nobody Sun Feb 8 13:32:24 2026 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4432738B9BD for ; Tue, 13 Jan 2026 11:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768304809; cv=none; b=A61giVNDoBjwD6A3yeh8LAmiiLjmH60KhwRcyhPAwN2NWn9Dlfx6doiqJ/juCvPC/XQWBIlu1YoquqrSspe7BUHXaxHoVZh4tKSmrK9sx6ZMueGdp7+aGbpaV5k4+eZj4nx8sBpI3e2MlY3n932UCl2GGz2igAQayhdPEcQX+mU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768304809; c=relaxed/simple; bh=/w2vN8NMzU7ZNAUgonKXacFRmYxmUvAYLnLsXJ81454=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=m5yKfC4xge+wC1xxPIlVhArQX1zU8pVcMfQkL2ZsyxyCIcIp0ZunNw6nXsXEX6z8+q2Zq1Va0k/RNEBMoZrLylhrHUY5sGWaUs9ghwMJM5wsUjADlGMpI8LkA4LErWYqr7Ul0aZX40YGeuKVTAaqq1wBHj6cRyKZ7ApLrm3vFwY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=X7mfVRGw; arc=none smtp.client-ip=209.85.128.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="X7mfVRGw" Received: by mail-wm1-f68.google.com with SMTP id 5b1f17b1804b1-47d3ffb0f44so51409605e9.3 for ; Tue, 13 Jan 2026 03:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1768304806; x=1768909606; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H0S/SnAeLJoRLsh1t6R81w3NJ1tQDzEXUcdPd54JMaI=; b=X7mfVRGwl5f8yh5QFaG2rTkgOXjeJ8xNB7GGDusjdMFJmKbiGWoUT12Yi6iT82Ru4n 5SKUgJdF54Af42BbiJLF8jbVFRATylZ52/+Eo2/myBl0FpziftkHGrYhi+6I17K7YzNK h31AfHOkLjYWRo+uU+OnEDy0BRLh4D/xov/ZuNOqWZhkrCV8er4jRhFQQ2CoCDvOo41j lWWWkkwCD1UcYGir1EfGKvx95FL8HOtpDTv16dEtZOogXoeQQycg4nZvfbQw63UNZyeK AxZ6pPLkTyqoFcl0mhZtvCEu+Vi82tX+xO9QmTCw1SVGoHuR3a3AVBviVrOUZ9WC4ihZ 1wYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768304806; x=1768909606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=H0S/SnAeLJoRLsh1t6R81w3NJ1tQDzEXUcdPd54JMaI=; b=coTy+UOT5OEz9mnJBc8iBsx4NrY+L1s9qqjqCUz/yY20GFngUIOgaYlZZNVkJAQo+K cUqaOFlp7qv+J7tcvDnUAIqxjv9d8KsqMxNKz8444qe8EfXEBRbVbXk3lgXNPxhuRimI 46WcTk8bXWIF14MuHhHDHmEPnbXoyfzzVI4pXtIBzjiC226lt/1L2PWUdTjK+hcgrUpD SFdtSItcISeZi+N4nSuNcvFKkHBKyWDJBJDgnwkH9/2D/yYx71rHtSQ3RqXwxTPkgYiJ kLgAAHx5UBDjIHwLLtlVa2XR31p1voIRg7kvPo0vb8uSad01bnfJFvKnzXnm5Oapjgy7 N20Q== X-Gm-Message-State: AOJu0Yz3DBuWp2p6zlXlZidPY3C0EUxWHVM+qXx/inPF+wsaUpnWT3Bk 7UVgeMcPh5wKN1QoAcG6f15Jn+xWXRn+rGH9z4GRHUZ56SkZ+IaqneBv+E49QSS6QLqlGIhemeL Bhjob X-Gm-Gg: AY/fxX7AwNK0SAQd7fsMfmOQfV+51jZgklyQg8WluokIPCFzLU7lPAu/oZtFlBJHLY5 k9DRPI7z1ynsP1dFvSDSvwMNiZJqTHYALsDXIHV/EwKDktZgzi7bCAeDwHHt0JikpcrIfhHK5lj tqMLEAB8v9pavLw3EIAuQ2D1Vn9iepFeHEFQDmbBAQKEA3DUceH29u73eA+7DrRTqBFaw3rd65q hasmNXHIjQvIqpuFUY7dzKrFQvX+XqaFsVGiA3I1bfC5lvVZHrwQpMd64ghqapYaSByahR7FPU9 +vYu1tZ/SNc7GF+dMg4kH17OdVh0DL+E1Hf24/9AwD2Dbnq1Syw/cJMr1rmFPzTNJBi5Cvq6DzG GyN0IVyTqZnq1PmKggKjm8hBGz7VblAt+sCk63spLcpZisoRKaZ+1t3Kmxw/9irzYHNSP10XEpZ auh76jF5i2QUn7ng== X-Google-Smtp-Source: AGHT+IFfQ3vfNS1KrR5j/vlrP2qTME5cFlcr9bwTQ2CUBP5eugSGv0mozZL3cEl6WxjgzorKvMpipw== X-Received: by 2002:a05:600c:8b58:b0:477:89d5:fdac with SMTP id 5b1f17b1804b1-47d84b49d53mr236881675e9.31.1768304806355; Tue, 13 Jan 2026 03:46:46 -0800 (PST) Received: from linux ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f6953fasm391850225e9.5.2026.01.13.03.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 03:46:46 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Andrew Morton Subject: [PATCH v2 3/3] mm: add WQ_PERCPU to alloc_workqueue users Date: Tue, 13 Jan 2026 12:46:30 +0100 Message-ID: <20260113114630.152942-4-marco.crivellari@suse.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260113114630.152942-1-marco.crivellari@suse.com> References: <20260113114630.152942-1-marco.crivellari@suse.com> 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 This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The refactoring is going to alter the default behavior of alloc_workqueue() to be unbound by default. With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), any alloc_workqueue() caller that doesn=E2=80=99t explicitly specify WQ_UNB= OUND must now use WQ_PERCPU. For more details see the Link tag below. In order to keep alloc_workqueue() behavior identical, explicitly request WQ_PERCPU. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari Reviewed-by: Frederic Weisbecker Reviewed-by: Sebastian Andrzej Siewior --- mm/backing-dev.c | 2 +- mm/slub.c | 4 +++- mm/vmstat.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 4c6f0b85a24e..861fee5e48b7 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -974,7 +974,7 @@ static int __init cgwb_init(void) * system_percpu_wq. Put them in a separate wq and limit concurrency. * There's no point in executing many of these in parallel. */ - cgwb_release_wq =3D alloc_workqueue("cgwb_release", 0, 1); + cgwb_release_wq =3D alloc_workqueue("cgwb_release", WQ_PERCPU, 1); if (!cgwb_release_wq) return -ENOMEM; =20 diff --git a/mm/slub.c b/mm/slub.c index 861592ac5425..bbaa247dce2a 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -8542,7 +8542,9 @@ void __init kmem_cache_init(void) =20 void __init kmem_cache_init_late(void) { - flushwq =3D alloc_workqueue("slub_flushwq", WQ_MEM_RECLAIM, 0); +#ifndef CONFIG_SLUB_TINY + flushwq =3D alloc_workqueue("slub_flushwq", WQ_MEM_RECLAIM | WQ_PERCPU, + 0); WARN_ON(!flushwq); } =20 diff --git a/mm/vmstat.c b/mm/vmstat.c index 65de88cdf40e..580b5ad293d6 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -2274,7 +2274,8 @@ void __init init_mm_internals(void) { int ret __maybe_unused; =20 - mm_percpu_wq =3D alloc_workqueue("mm_percpu_wq", WQ_MEM_RECLAIM, 0); + mm_percpu_wq =3D alloc_workqueue("mm_percpu_wq", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); =20 #ifdef CONFIG_SMP ret =3D cpuhp_setup_state_nocalls(CPUHP_MM_VMSTAT_DEAD, "mm/vmstat:dead", --=20 2.52.0