Skip to content

Commit 9823634

Browse files
DispatchCodeaxboe
authored andcommitted
block: Add WQ_PERCPU to alloc_workqueue users
This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in: commit 128ea9f ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea ("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’t explicitly specify WQ_UNBOUND 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/[email protected]/ Suggested-by: Tejun Heo <[email protected]> Signed-off-by: Marco Crivellari <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 41c665a commit 9823634

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

block/bio-integrity-auto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int __init blk_integrity_auto_init(void)
125125
* Make it highpri CPU intensive wq with max concurrency of 1.
126126
*/
127127
kintegrityd_wq = alloc_workqueue("kintegrityd", WQ_MEM_RECLAIM |
128-
WQ_HIGHPRI | WQ_CPU_INTENSIVE, 1);
128+
WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_PERCPU, 1);
129129
if (!kintegrityd_wq)
130130
panic("Failed to create kintegrityd\n");
131131
return 0;

block/bio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ int bioset_init(struct bio_set *bs,
19581958

19591959
if (flags & BIOSET_NEED_RESCUER) {
19601960
bs->rescue_workqueue = alloc_workqueue("bioset",
1961-
WQ_MEM_RECLAIM, 0);
1961+
WQ_MEM_RECLAIM | WQ_PERCPU, 0);
19621962
if (!bs->rescue_workqueue)
19631963
goto bad;
19641964
}

block/blk-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ int __init blk_dev_init(void)
12821282

12831283
/* used for unplugging and affects IO latency/throughput - HIGHPRI */
12841284
kblockd_workqueue = alloc_workqueue("kblockd",
1285-
WQ_MEM_RECLAIM | WQ_HIGHPRI, 0);
1285+
WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_PERCPU, 0);
12861286
if (!kblockd_workqueue)
12871287
panic("Failed to create kblockd\n");
12881288

0 commit comments

Comments
 (0)