Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drivers/block: replace use of system_wq with system_percpu_wq

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.

system_unbound_wq should be the default workqueue so as not to enforce
locality constraints for random work whenever it's not required.

Adding system_dfl_wq to encourage its use when unbound work should be used.

queue_work() / queue_delayed_work() / mod_delayed_work() will now use the
new unbound wq: whether the user still use the old wq a warn will be
printed along with a wq redirect to the new one.

The old system_unbound_wq will be kept for a few release cycles.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Marco Crivellari and committed by
Jens Axboe
51723bf9 6214cadd

+2 -2
+1 -1
drivers/block/nbd.c
··· 311 311 if (args) { 312 312 INIT_WORK(&args->work, nbd_dead_link_work); 313 313 args->index = nbd->index; 314 - queue_work(system_wq, &args->work); 314 + queue_work(system_percpu_wq, &args->work); 315 315 } 316 316 } 317 317 if (!nsock->dead) {
+1 -1
drivers/block/sunvdc.c
··· 1188 1188 } 1189 1189 1190 1190 if (port->ldc_timeout) 1191 - mod_delayed_work(system_wq, &port->ldc_reset_timer_work, 1191 + mod_delayed_work(system_percpu_wq, &port->ldc_reset_timer_work, 1192 1192 round_jiffies(jiffies + HZ * port->ldc_timeout)); 1193 1193 mod_timer(&port->vio.timer, round_jiffies(jiffies + HZ)); 1194 1194 return;