Skip to content

Commit 72dc6db

Browse files
committed
Merge tag 'wq-for-6.5-cleanup-ordered' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull ordered workqueue creation updates from Tejun Heo: "For historical reasons, unbound workqueues with max concurrency limit of 1 are considered ordered, even though the concurrency limit hasn't been system-wide for a long time. This creates ambiguity around whether ordered execution is actually required for correctness, which was actually confusing for e.g. btrfs (btrfs updates are being routed through the btrfs tree). There aren't that many users in the tree which use the combination and there are pending improvements to unbound workqueue affinity handling which will make inadvertent use of ordered workqueue a bigger loss. This clarifies the situation for most of them by updating the ones which require ordered execution to use alloc_ordered_workqueue(). There are some conversions being routed through subsystem-specific trees and likely a few stragglers. Once they're all converted, workqueue can trigger a warning on unbound + @max_active==1 usages and eventually drop the implicit ordered behavior" * tag 'wq-for-6.5-cleanup-ordered' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: rxrpc: Use alloc_ordered_workqueue() to create ordered workqueues net: qrtr: Use alloc_ordered_workqueue() to create ordered workqueues net: wwan: t7xx: Use alloc_ordered_workqueue() to create ordered workqueues dm integrity: Use alloc_ordered_workqueue() to create ordered workqueues media: amphion: Use alloc_ordered_workqueue() to create ordered workqueues scsi: NCR5380: Use default @max_active for hostdata->work_q media: coda: Use alloc_ordered_workqueue() to create ordered workqueues crypto: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues wifi: ath10/11/12k: Use alloc_ordered_workqueue() to create ordered workqueues wifi: mwifiex: Use default @max_active for workqueues wifi: iwlwifi: Use default @max_active for trans_pcie->rba.alloc_wq xen/pvcalls: Use alloc_ordered_workqueue() to create ordered workqueues virt: acrn: Use alloc_ordered_workqueue() to create ordered workqueues net: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues greybus: Use alloc_ordered_workqueue() to create ordered workqueues powerpc, workqueue: Use alloc_ordered_workqueue() to create ordered workqueues
2 parents 7ab044a + 78ef970 commit 72dc6db

28 files changed

Lines changed: 57 additions & 65 deletions

File tree

arch/powerpc/kernel/tau_6xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static int __init TAU_init(void)
200200
tau_int_enable = IS_ENABLED(CONFIG_TAU_INT) &&
201201
!strcmp(cur_cpu_spec->platform, "ppc750");
202202

203-
tau_workq = alloc_workqueue("tau", WQ_UNBOUND, 1);
203+
tau_workq = alloc_ordered_workqueue("tau", 0);
204204
if (!tau_workq)
205205
return -ENOMEM;
206206

arch/powerpc/platforms/pseries/dlpar.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,7 @@ int __init dlpar_workqueue_init(void)
564564
if (pseries_hp_wq)
565565
return 0;
566566

567-
pseries_hp_wq = alloc_workqueue("pseries hotplug workqueue",
568-
WQ_UNBOUND, 1);
567+
pseries_hp_wq = alloc_ordered_workqueue("pseries hotplug workqueue", 0);
569568

570569
return pseries_hp_wq ? 0 : -ENOMEM;
571570
}

drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,9 @@ static int cptpf_vfpf_mbox_init(struct otx2_cptpf_dev *cptpf, int num_vfs)
357357
u64 vfpf_mbox_base;
358358
int err, i;
359359

360-
cptpf->vfpf_mbox_wq = alloc_workqueue("cpt_vfpf_mailbox",
361-
WQ_UNBOUND | WQ_HIGHPRI |
362-
WQ_MEM_RECLAIM, 1);
360+
cptpf->vfpf_mbox_wq =
361+
alloc_ordered_workqueue("cpt_vfpf_mailbox",
362+
WQ_HIGHPRI | WQ_MEM_RECLAIM);
363363
if (!cptpf->vfpf_mbox_wq)
364364
return -ENOMEM;
365365

@@ -453,9 +453,9 @@ static int cptpf_afpf_mbox_init(struct otx2_cptpf_dev *cptpf)
453453
resource_size_t offset;
454454
int err;
455455

456-
cptpf->afpf_mbox_wq = alloc_workqueue("cpt_afpf_mailbox",
457-
WQ_UNBOUND | WQ_HIGHPRI |
458-
WQ_MEM_RECLAIM, 1);
456+
cptpf->afpf_mbox_wq =
457+
alloc_ordered_workqueue("cpt_afpf_mailbox",
458+
WQ_HIGHPRI | WQ_MEM_RECLAIM);
459459
if (!cptpf->afpf_mbox_wq)
460460
return -ENOMEM;
461461

drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ static int cptvf_pfvf_mbox_init(struct otx2_cptvf_dev *cptvf)
7575
resource_size_t offset, size;
7676
int ret;
7777

78-
cptvf->pfvf_mbox_wq = alloc_workqueue("cpt_pfvf_mailbox",
79-
WQ_UNBOUND | WQ_HIGHPRI |
80-
WQ_MEM_RECLAIM, 1);
78+
cptvf->pfvf_mbox_wq =
79+
alloc_ordered_workqueue("cpt_pfvf_mailbox",
80+
WQ_HIGHPRI | WQ_MEM_RECLAIM);
8181
if (!cptvf->pfvf_mbox_wq)
8282
return -ENOMEM;
8383

drivers/greybus/connection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ _gb_connection_create(struct gb_host_device *hd, int hd_cport_id,
187187
spin_lock_init(&connection->lock);
188188
INIT_LIST_HEAD(&connection->operations);
189189

190-
connection->wq = alloc_workqueue("%s:%d", WQ_UNBOUND, 1,
191-
dev_name(&hd->dev), hd_cport_id);
190+
connection->wq = alloc_ordered_workqueue("%s:%d", 0, dev_name(&hd->dev),
191+
hd_cport_id);
192192
if (!connection->wq) {
193193
ret = -ENOMEM;
194194
goto err_free_connection;

drivers/greybus/svc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ struct gb_svc *gb_svc_create(struct gb_host_device *hd)
13181318
if (!svc)
13191319
return NULL;
13201320

1321-
svc->wq = alloc_workqueue("%s:svc", WQ_UNBOUND, 1, dev_name(&hd->dev));
1321+
svc->wq = alloc_ordered_workqueue("%s:svc", 0, dev_name(&hd->dev));
13221322
if (!svc->wq) {
13231323
kfree(svc);
13241324
return NULL;

drivers/md/dm-integrity.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4268,10 +4268,10 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
42684268
}
42694269

42704270
/*
4271-
* If this workqueue were percpu, it would cause bio reordering
4271+
* If this workqueue weren't ordered, it would cause bio reordering
42724272
* and reduced performance.
42734273
*/
4274-
ic->wait_wq = alloc_workqueue("dm-integrity-wait", WQ_MEM_RECLAIM | WQ_UNBOUND, 1);
4274+
ic->wait_wq = alloc_ordered_workqueue("dm-integrity-wait", WQ_MEM_RECLAIM);
42754275
if (!ic->wait_wq) {
42764276
ti->error = "Cannot allocate workqueue";
42774277
r = -ENOMEM;

drivers/md/dm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static int __init local_init(void)
207207
if (r)
208208
return r;
209209

210-
deferred_remove_workqueue = alloc_workqueue("kdmremove", WQ_UNBOUND, 1);
210+
deferred_remove_workqueue = alloc_ordered_workqueue("kdmremove", 0);
211211
if (!deferred_remove_workqueue) {
212212
r = -ENOMEM;
213213
goto out_uevent_exit;

drivers/media/platform/amphion/vpu_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static int vpu_core_register(struct device *dev, struct vpu_core *core)
254254
if (vpu_core_is_exist(vpu, core))
255255
return 0;
256256

257-
core->workqueue = alloc_workqueue("vpu", WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
257+
core->workqueue = alloc_ordered_workqueue("vpu", WQ_MEM_RECLAIM);
258258
if (!core->workqueue) {
259259
dev_err(core->dev, "fail to alloc workqueue\n");
260260
return -ENOMEM;

drivers/media/platform/amphion/vpu_v4l2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ int vpu_v4l2_open(struct file *file, struct vpu_inst *inst)
740740
inst->fh.ctrl_handler = &inst->ctrl_handler;
741741
file->private_data = &inst->fh;
742742
inst->state = VPU_CODEC_STATE_DEINIT;
743-
inst->workqueue = alloc_workqueue("vpu_inst", WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
743+
inst->workqueue = alloc_ordered_workqueue("vpu_inst", WQ_MEM_RECLAIM);
744744
if (inst->workqueue) {
745745
INIT_WORK(&inst->msg_work, vpu_inst_run_work);
746746
ret = kfifo_init(&inst->msg_fifo,

0 commit comments

Comments
 (0)