From nobody Fri Dec 19 12:49:51 2025 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 F0237245008 for ; Wed, 5 Nov 2025 14:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762354259; cv=none; b=mEjdaZAyc3hqj8yjOHLze/NzE1Ofewo10KX4BRer7qF20IZysWR9FAnkzcJTPmTQqf2TRtHcTODRdBYjVc19o9/Dif9MVmDKsL28aour7wR5OXnWc4NSqToLBW1scTUs23ILu6mQmE15UXFgdsHWE8qEb24LTedMzWsoHrrCIG4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762354259; c=relaxed/simple; bh=Kzf3O5Pfv0M6xSM+kEXKJUJ8D5H545XidDJ6k27PEAc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WYhuAgEVFwvcZxxwm6QT3AeLf9C2hNE1S31SkvJnSCWgYcGrlR2XSKrn1AJObADBT+x+6dcNgOQx/F2Uyf0+vyyXMSgR1396NsdN9uEMgNmdz2+aYI+PqwF8tM36Ih1EvbW6+lx1eIS5mvImW76FWFWrAExKvivpqK2G5JU0h7w= 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=FeFHczlX; arc=none smtp.client-ip=209.85.221.47 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="FeFHczlX" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-429c2f6a580so1685184f8f.1 for ; Wed, 05 Nov 2025 06:50:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762354255; x=1762959055; 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=5iqpU7301ZddzKgkBJ5b+qets1xyPEBx6ArgKTOvQVg=; b=FeFHczlXxH385gVhfQit/crSWV+w98r5GrQopgF6J8k1z2JHuflftFGcZffBvnVi93 orO+1P0yiNznRWjwbovh+mznlU49lLk4izxM102Ngm74DX/1rTyg7oX0shELO2psy2Sk jWxTTfgTmGF+eaEZWBiL1NxahyB2WLX1gh/EbHQvu7NdeNP96ZaWmJeC0YaWPBYgupNi z4rHxZ6UzgRaAxjbAOFaR6DtvC2tmdB/PZbBBDA9UcECRGg1/hjl5oFt1Gd/qm+aFIsN DZJfnzitFyO8PYXuVlOut5Hr8mm9Xgk2ohGwhGfgjC//u8QBMH28d7PxvYsyGO2Zkw9A iZTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762354255; x=1762959055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5iqpU7301ZddzKgkBJ5b+qets1xyPEBx6ArgKTOvQVg=; b=mVdUNqyS2MI3KCOP9osFAUi+UGNSqvsntoPdfa1JHppHqc1HxiZng1G4wZl5/QgJ9c U2O2slWeEnFH8alUFtick3SgPlDchubfF64J3Rk+BEdaUUBaatgxlunQC/twXRyOIfxV GQzos3HBOpgfxgMX1VV2m98eRAlsjoZSthqtzaTayqO4nzyWLrRfQ341tOTnYkLer6P0 WK8DbRgVWbr4KvW3NETetOIOcRmI8MbX/EUvOTfMfTNZbh+EycCClYgHTI+RYTQM0lDn ULkcPif6wsBHPBuaLRbXriV7RDsvYJPRqnGWDaVWSR1y8LNDK7Th8JGzuCu9+DXNiSAL nZIg== X-Gm-Message-State: AOJu0YwEIcuzGL/5d0EDKlXCLTkWD07pLwbzNgQDa0HHaXD/egc6EQrD i9lbruI0w69h9vfX/Ah8fFzU3+/I5lYFK4bKWhc/qfQ+hDkUMIt5cpDfcgFcoCWoH7rZ4nuCFzm 5eEer X-Gm-Gg: ASbGncv14WLAjHgw0A1r3aYneq8zeNwotB/rdybz0z1sGPCnfQPHIpSXPzjx8JWd4t9 0fIHMcATWRb24JjoQOnW8Hz+LTL5agSS7y6pl0hUKNEULeglYN07idOmHNPPBzfyKirbC4BBP3Y UNN3IxgACmeI2FMm1/jT5uptrXKyoami5NrVXYobOPVPz/WISotKbcjLIwwxhfdgqgbr45LNB8m 2soxRjS9URpf5KKvTi3IJeg6YLPUxD+N4A/RnrgoddKRvnkFniZ/ApnPVEZAwwFYG2Hxifkc6Mz q5V+SBBEQMemV9epwUmFu+hv8C5nluY8yN0TFR3PHEEyHyreUWLBVuKE25UzW1hJClGh6fFPhHa proJ/PlXje6ooMlykL82pslzHHt0TTCiarx8Wm4WWmqhlGBCmXAvl8yaedN3DL4DabHuNBVvVOa gF8KBrR0VNJLBpKSSb7uDiUY4= X-Google-Smtp-Source: AGHT+IFrhRlSR2BV3K3SsNYVanRi/LbVHaUuwWiyIlYFXbJgyiRM66Wm0VZiulUCa1X98AgblCJWxQ== X-Received: by 2002:a05:6000:210c:b0:429:c851:69b3 with SMTP id ffacd0b85a97d-429e3307472mr2299746f8f.30.1762354254929; Wed, 05 Nov 2025 06:50:54 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc1f5ccasm10662873f8f.25.2025.11.05.06.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Nov 2025 06:50:54 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Coly Li , Kent Overstreet Subject: [PATCH 1/2] bcache: replace use of system_wq with system_percpu_wq Date: Wed, 5 Nov 2025 15:50:42 +0100 Message-ID: <20251105145043.231927-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251105145043.231927-1-marco.crivellari@suse.com> References: <20251105145043.231927-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" Currently if a user enqueues a work item using schedule_delayed_work() the used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to schedule_work() that is using system_wq and queue_work(), that makes use again of WORK_CPU_UNBOUND. This lack of consistency cannot be addressed without refactoring the API. This patch continues the effort to refactor worqueue APIs, which has begun with the change 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") system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq. The old wq (system_wq) will be kept for a few release cycles. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/md/bcache/super.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 6d250e366412..8ce50753ae28 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1388,7 +1388,7 @@ static CLOSURE_CALLBACK(cached_dev_flush) bch_cache_accounting_destroy(&dc->accounting); kobject_del(&d->kobj); =20 - continue_at(cl, cached_dev_free, system_wq); + continue_at(cl, cached_dev_free, system_percpu_wq); } =20 static int cached_dev_init(struct cached_dev *dc, unsigned int block_size) @@ -1400,7 +1400,7 @@ static int cached_dev_init(struct cached_dev *dc, uns= igned int block_size) __module_get(THIS_MODULE); INIT_LIST_HEAD(&dc->list); closure_init(&dc->disk.cl, NULL); - set_closure_fn(&dc->disk.cl, cached_dev_flush, system_wq); + set_closure_fn(&dc->disk.cl, cached_dev_flush, system_percpu_wq); kobject_init(&dc->disk.kobj, &bch_cached_dev_ktype); INIT_WORK(&dc->detach, cached_dev_detach_finish); sema_init(&dc->sb_write_mutex, 1); @@ -1513,7 +1513,7 @@ static CLOSURE_CALLBACK(flash_dev_flush) bcache_device_unlink(d); mutex_unlock(&bch_register_lock); kobject_del(&d->kobj); - continue_at(cl, flash_dev_free, system_wq); + continue_at(cl, flash_dev_free, system_percpu_wq); } =20 static int flash_dev_run(struct cache_set *c, struct uuid_entry *u) @@ -1525,7 +1525,7 @@ static int flash_dev_run(struct cache_set *c, struct = uuid_entry *u) goto err_ret; =20 closure_init(&d->cl, NULL); - set_closure_fn(&d->cl, flash_dev_flush, system_wq); + set_closure_fn(&d->cl, flash_dev_flush, system_percpu_wq); =20 kobject_init(&d->kobj, &bch_flash_dev_ktype); =20 @@ -1833,7 +1833,7 @@ static CLOSURE_CALLBACK(__cache_set_unregister) =20 mutex_unlock(&bch_register_lock); =20 - continue_at(cl, cache_set_flush, system_wq); + continue_at(cl, cache_set_flush, system_percpu_wq); } =20 void bch_cache_set_stop(struct cache_set *c) @@ -1863,10 +1863,10 @@ struct cache_set *bch_cache_set_alloc(struct cache_= sb *sb) =20 __module_get(THIS_MODULE); closure_init(&c->cl, NULL); - set_closure_fn(&c->cl, cache_set_free, system_wq); + set_closure_fn(&c->cl, cache_set_free, system_percpu_wq); =20 closure_init(&c->caching, &c->cl); - set_closure_fn(&c->caching, __cache_set_unregister, system_wq); + set_closure_fn(&c->caching, __cache_set_unregister, system_percpu_wq); =20 /* Maybe create continue_at_noreturn() and use it here? */ closure_set_stopped(&c->cl); @@ -2531,7 +2531,7 @@ static void register_device_async(struct async_reg_ar= gs *args) INIT_DELAYED_WORK(&args->reg_work, register_cache_worker); =20 /* 10 jiffies is enough for a delay */ - queue_delayed_work(system_wq, &args->reg_work, 10); + queue_delayed_work(system_percpu_wq, &args->reg_work, 10); } =20 static void *alloc_holder_object(struct cache_sb *sb) @@ -2912,11 +2912,11 @@ static int __init bcache_init(void) /* * Let's not make this `WQ_MEM_RECLAIM` for the following reasons: * - * 1. It used `system_wq` before which also does no memory reclaim. + * 1. It used `system_percpu_wq` before which also does no memory reclaim. * 2. With `WQ_MEM_RECLAIM` desktop stalls, increased boot times, and * reduced throughput can be observed. * - * We still want to user our own queue to not congest the `system_wq`. + * We still want to user our own queue to not congest the `system_percpu_= wq`. */ bch_flush_wq =3D alloc_workqueue("bch_flush", 0, 0); if (!bch_flush_wq) --=20 2.51.1 From nobody Fri Dec 19 12:49:51 2025 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 CE7332C237C for ; Wed, 5 Nov 2025 14:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762354259; cv=none; b=BKjkmQ9+kMBS/+grLADjIJnK1ASzNbpv/6cetI2Zt2o01TcNYILqiIKrzwpEIB1lMJaH/qXjaQFU0rDpjrmk+FUFzPoYqjHfLYqcyNIOAO1YCe/08ca+fOWNESQwgtmTkCMruMa5g48B5BBLXU3fr+joOqJr3APYemdARJPgl9Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762354259; c=relaxed/simple; bh=ewgCy57GvvNL/4ckT/tDm1bzqS9HtAnggSwRh9X34wk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=isskDDNq1oUEw83nOPuqvzzJeoBWciQXaZhn1dWEQzx8+uJ3q2c1J1/P0fl/xbheFTmgTdTvxf1cLl7eDkjst1BR57bSf8JmRQ68Gc8YKYPvtw6hDU97TtvAKthWRQXYiQh02pLZR3D9E9yl9HmMYfzPn2ay8q5qzKZ4oK4nrA8= 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=Mikref44; arc=none smtp.client-ip=209.85.221.47 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="Mikref44" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-429bcddad32so4290544f8f.3 for ; Wed, 05 Nov 2025 06:50:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762354256; x=1762959056; 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=oSAtykixYoDc8mDqE0NZFVUWNpp9tkRehnUBmieVPhM=; b=Mikref44xLhnzAoTkV32Y1KJQ1UqjarEHeCQKpsFG34Duij+eNf/0WNEl0cFHXTGyD T+mjaKBToX1BCCL9StF1srwbtDyIcpVAhNJ/HBEQJDmI5FGRj+2pFQkVTMGiAQlG09eu pGnyGUHfu6b3hDae66NphwcfozcWxgQLEIbKTUTmJLWuGlptCUdGwZvPFWV9pouvoEYM lMyxQXfGEi2FlqJCZyhS/ilq+qdUrJLk4ob6cQG9i9Ih/N4imCbBTsB0iBOGE3CSpSgR al5yw+vCpCdPQGE1OBCbKBPBwz/C0W7T9TkVOOohuEXonnTa0Cx7K9XBRwQBBBlIemSe 4/tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762354256; x=1762959056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oSAtykixYoDc8mDqE0NZFVUWNpp9tkRehnUBmieVPhM=; b=OyCgP0X1XEQRx0BhzDd3GhpOEQg0Wtd9sEKXUI6lwof+lozJQ4BVYcGI7yZMwkLWSW 8MU5jzPYyayTh6atYVZnHd78OrKFPXPutiVx51WsWYaNGbNGBRsbHo44CyTbHHQbs6MZ exNtxOp19ZwsXfrJzaRagGi3hRPRxQeU9WJDZfYcjNBjZ0DnFZr4PktEudYv5IQMzYHB L1b+S35GwXRD+MiFIGunkS9giJ5vZOzgpyrE5LPT1/QGPcZvZTXlraGwi/x4CyLuNw/L 9J/1LgmzWBZfyJJ7eAwEzmC5h9GZ1ohb/eZ1QAiF+5mvGGri5lvwTcbRMcZAIIgBneNf x+zw== X-Gm-Message-State: AOJu0YxbHt/UkM8tstNBCzHSQKXAfuvi7V92O5fmrbEQb+Jiocj4r79H 8X2CnEJBBHTM+2t6QDLxfyo9brxGfhaNVXCVd5/00OaL+B8y6zHM2UqACh4zuoe1zbs+QEzEp1g cybP6 X-Gm-Gg: ASbGncvWo2Z769DhVC8K3L1DgVPveILgjtHh/NIhgSR4AdEJi5BY466C97yme46LMEM rrnKXVC8/oZTsiN1oHMJRImtOKcuKHnc0w+0aNKr/WXXdfk1P1LFiXS2LYE8Gx5aptsXcybnxTj 41AOHbe7p3j8/ENdaPn+b9XJbQigeZAY2xdjtpqoDtEmRpuz4RdopOn3TeTXmPq1cZlTVwF5aO7 JAElY3cMtJ9yfQdHqJM/8Yur0pMd67QrA8cOEQ6Lq9s5sgDysrPJhbZqpQdFGWLMgp+q+RJJmBG q5LQiloxB8VKP2pVWffBbhmKAr8m7k/Px9+GPQVCrROJ5Aevy8vOUaaNq7IqGFblpLIZe48Ll3S gTsEuvTh6+yG9G2td2tKS0qpEmxM2+NZDyV0RNyOl2lcX4xvIvg3kmXcFfrTDE9ygQB0QwM0Arp 7chL98+FzaC1n+f2s9wYDUSBI= X-Google-Smtp-Source: AGHT+IFIMPHuR2cFy/+vGAJGaRdbo/j8v+7gg3T/Gz/ibk8ShofabyYEEVWonAEzkaYjj7GUmFmuDA== X-Received: by 2002:a05:6000:2282:b0:3e7:5f26:f1e5 with SMTP id ffacd0b85a97d-429e32e4607mr3152625f8f.23.1762354255926; Wed, 05 Nov 2025 06:50:55 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc1f5ccasm10662873f8f.25.2025.11.05.06.50.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Nov 2025 06:50:55 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Coly Li , Kent Overstreet Subject: [PATCH 2/2] bcache: WQ_PERCPU added to alloc_workqueue users Date: Wed, 5 Nov 2025 15:50:43 +0100 Message-ID: <20251105145043.231927-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251105145043.231927-1-marco.crivellari@suse.com> References: <20251105145043.231927-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 Currently if a user enqueue a work item using schedule_delayed_work() the used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to schedule_work() that is using system_wq and queue_work(), that makes use again of WORK_CPU_UNBOUND. This lack of consistentcy cannot be addressed without refactoring the API. alloc_workqueue() treats all queues as per-CPU by default, while unbound workqueues must opt-in via WQ_UNBOUND. This default is suboptimal: most workloads benefit from unbound queues, allowing the scheduler to place worker threads where they=E2=80=99re needed= and reducing noise when CPUs are isolated. This patch continues the effort to refactor worqueue APIs, which has begun with the change 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") This change adds a new WQ_PERCPU flag to explicitly request alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified. 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. Once migration is complete, WQ_UNBOUND can be removed and unbound will become the implicit default. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/md/bcache/btree.c | 3 ++- drivers/md/bcache/super.c | 10 ++++++---- drivers/md/bcache/writeback.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 210b59007d98..e7b8c688d963 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -2822,7 +2822,8 @@ void bch_btree_exit(void) =20 int __init bch_btree_init(void) { - btree_io_wq =3D alloc_workqueue("bch_btree_io", WQ_MEM_RECLAIM, 0); + btree_io_wq =3D alloc_workqueue("bch_btree_io", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!btree_io_wq) return -ENOMEM; =20 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 8ce50753ae28..a0425351c179 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1939,7 +1939,8 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb= *sb) if (!c->uuids) goto err; =20 - c->moving_gc_wq =3D alloc_workqueue("bcache_gc", WQ_MEM_RECLAIM, 0); + c->moving_gc_wq =3D alloc_workqueue("bcache_gc", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!c->moving_gc_wq) goto err; =20 @@ -2905,7 +2906,7 @@ static int __init bcache_init(void) if (bch_btree_init()) goto err; =20 - bcache_wq =3D alloc_workqueue("bcache", WQ_MEM_RECLAIM, 0); + bcache_wq =3D alloc_workqueue("bcache", WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!bcache_wq) goto err; =20 @@ -2918,11 +2919,12 @@ static int __init bcache_init(void) * * We still want to user our own queue to not congest the `system_percpu_= wq`. */ - bch_flush_wq =3D alloc_workqueue("bch_flush", 0, 0); + bch_flush_wq =3D alloc_workqueue("bch_flush", WQ_PERCPU, 0); if (!bch_flush_wq) goto err; =20 - bch_journal_wq =3D alloc_workqueue("bch_journal", WQ_MEM_RECLAIM, 0); + bch_journal_wq =3D alloc_workqueue("bch_journal", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!bch_journal_wq) goto err; =20 diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index 6ba73dc1a3df..ccbd9a8f28f5 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c @@ -1076,7 +1076,7 @@ void bch_cached_dev_writeback_init(struct cached_dev = *dc) int bch_cached_dev_writeback_start(struct cached_dev *dc) { dc->writeback_write_wq =3D alloc_workqueue("bcache_writeback_wq", - WQ_MEM_RECLAIM, 0); + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!dc->writeback_write_wq) return -ENOMEM; =20 --=20 2.51.1