workqueue: Ordered workqueue creation cleanup
Subsystems (35)
Tejun Heo
maintainerPATCH 1/1 workqueue: Ordered workqueue creation cleanup
Hello,
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary and contains the following 22 patches.
0001-powerpc-workqueue-Use-alloc_ordered_workqueue-to-cre.patch 0002-greybus-Use-alloc_ordered_workqueue-to-create-ordere.patch 0003-IB-hfi1-Use-alloc_ordered_workqueue-to-create-ordere.patch 0004-dm-integrity-Use-alloc_ordered_workqueue-to-create-o.patch 0005-media-amphion-Use-alloc_ordered_workqueue-to-create-.patch 0006-net-thunderx-Use-alloc_ordered_workqueue-to-create-o.patch 0007-net-octeontx2-Use-alloc_ordered_workqueue-to-create-.patch 0008-wifi-ath10-11-12k-Use-alloc_ordered_workqueue-to-cre.patch 0009-wifi-iwlwifi-Use-alloc_ordered_workqueue-to-create-o.patch 0010-wifi-mwifiex-Use-alloc_ordered_workqueue-to-create-o.patch 0011-net-wwan-t7xx-Use-alloc_ordered_workqueue-to-create-.patch 0012-scsi-Use-alloc_ordered_workqueue-to-create-ordered-w.patch 0013-virt-acrn-Use-alloc_ordered_workqueue-to-create-orde.patch 0014-soc-qcom-qmi-Use-alloc_ordered_workqueue-to-create-o.patch 0015-xen-pvcalls-Use-alloc_ordered_workqueue-to-create-or.patch 0016-btrfs-Use-alloc_ordered_workqueue-to-create-ordered-.patch 0017-cifs-Use-alloc_ordered_workqueue-to-create-ordered-w.patch 0018-net-qrtr-Use-alloc_ordered_workqueue-to-create-order.patch 0019-rxrpc-Use-alloc_ordered_workqueue-to-create-ordered-.patch 0020-crypto-octeontx2-Use-alloc_ordered_workqueue-to-crea.patch 0021-media-coda-Use-alloc_ordered_workqueue-to-create-ord.patch 0022-workqueue-Don-t-implicitly-make-UNBOUND-workqueues-w.patch
0001-0021 convert the existing users and 0022 drops the implicit ordered promotion logic from alloc_workqueue(). I'll keep an eye out for a while after merging 0022. Thankfully, these are pretty easy to grep for. The patches can also be found in the following git branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git ordered-cleanup
diffstat follows. Thanks.
arch/powerpc/kernel/tau_6xx.c | 2 - arch/powerpc/platforms/pseries/dlpar.c | 3 -- drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 12 ++++----- drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 6 ++-- drivers/greybus/connection.c | 4 +-- drivers/greybus/svc.c | 2 - drivers/infiniband/hw/hfi1/init.c | 7 ++--- drivers/md/dm-integrity.c | 4 +-- drivers/md/dm.c | 2 - drivers/media/platform/amphion/vpu_core.c | 2 - drivers/media/platform/amphion/vpu_v4l2.c | 2 - drivers/media/platform/chips-media/coda-common.c | 2 - drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 3 -- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 5 +--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 13 ++++------ drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 5 +--- drivers/net/wireless/ath/ath10k/qmi.c | 3 -- drivers/net/wireless/ath/ath11k/qmi.c | 3 -- drivers/net/wireless/ath/ath12k/qmi.c | 3 -- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 4 +-- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 13 ++++------ drivers/net/wireless/marvell/mwifiex/main.c | 22 ++++++++---------- drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 13 +++++----- drivers/net/wwan/t7xx/t7xx_hif_dpmaif_tx.c | 5 ++-- drivers/scsi/NCR5380.c | 5 +--- drivers/scsi/hosts.c | 12 ++++----- drivers/scsi/libiscsi.c | 5 +--- drivers/soc/qcom/qmi_interface.c | 2 - drivers/virt/acrn/ioreq.c | 4 +-- drivers/xen/pvcalls-back.c | 4 +-- fs/btrfs/disk-io.c | 2 - fs/btrfs/scrub.c | 6 +++- fs/cifs/dfs_cache.c | 2 - include/linux/workqueue.h | 4 --- kernel/workqueue.c | 23 +++---------------- net/qrtr/ns.c | 2 - net/rxrpc/af_rxrpc.c | 2 - 37 files changed, 92 insertions(+), 121 deletions(-)
Tejun Heo
maintainerPATCH 1/22 powerpc, workqueue: Use alloc_ordered_workqueue() to create ordered workqueues
BACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- arch/powerpc/kernel/tau_6xx.c | 2 +- arch/powerpc/platforms/pseries/dlpar.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
arch/powerpc/kernel/tau_6xx.c +1 -1
@@ -200,7 +200,7 @@ static int __init TAU_init(void) tau_int_enable =IS_ENABLED (CONFIG_TAU_INT ) && !strcmp (cur_cpu_spec->platform,"ppc750" ); - tau_workq =alloc_workqueue ("tau" ,WQ_UNBOUND ,1 ); + tau_workq =alloc_ordered_workqueue ("tau" ,0 );if (!tau_workq)return -ENOMEM ;
arch/powerpc/platforms/pseries/dlpar.c +1 -2
@@ -564,8 +564,7 @@ int __init dlpar_workqueue_init(void)if (pseries_hp_wq)return 0 ; - pseries_hp_wq =alloc_workqueue ("pseries hotplug workqueue" , -WQ_UNBOUND ,1 ); + pseries_hp_wq =alloc_ordered_workqueue ("pseries hotplug workqueue" ,0 );return pseries_hp_wq ?0 : -ENOMEM ; }
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 3/22 IB/hfi1: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/infiniband/hw/hfi1/init.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/init.c +3 -4
@@ -755,14 +755,13 @@ static int create_workqueues(struct hfi1_devdata *dd) }if (!ppd->link_wq) {/* -* Make the link workqueue single-threaded to enforce +* Make the link workqueue ordered to enforce * serialization. */ ppd->link_wq = -alloc_workqueue ( +alloc_ordered_workqueue ("hfi_link_%d_%d" , -WQ_SYSFS |WQ_MEM_RECLAIM |WQ_UNBOUND , -1 ,/* max_active */ +WQ_SYSFS |WQ_MEM_RECLAIM , dd->unit, pidx);if (!ppd->link_wq) goto wq_error;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 2/22 greybus: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/greybus/connection.c | 4 ++-- drivers/greybus/svc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/greybus/connection.c +2 -2
@@ -187,8 +187,8 @@ _gb_connection_create(struct gb_host_device *hd, int hd_cport_id,spin_lock_init (&connection->lock);INIT_LIST_HEAD (&connection->operations); - connection->wq =alloc_workqueue ("%s:%d" ,WQ_UNBOUND ,1 , -dev_name (&hd->dev), hd_cport_id); + connection->wq =alloc_ordered_workqueue ("%s:%d" ,0 ,dev_name (&hd->dev), + hd_cport_id);if (!connection->wq) { ret = -ENOMEM ; goto err_free_connection;
drivers/greybus/svc.c +1 -1
@@ -1318,7 +1318,7 @@ struct gb_svc *gb_svc_create(struct gb_host_device *hd)if (!svc)return NULL ; - svc->wq =alloc_workqueue ("%s:svc" ,WQ_UNBOUND ,1 ,dev_name (&hd->dev)); + svc->wq =alloc_ordered_workqueue ("%s:svc" ,0 ,dev_name (&hd->dev));if (!svc->wq) {kfree (svc);return NULL ;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 4/22 dm integrity: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/md/dm-integrity.c | 4 ++-- drivers/md/dm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/md/dm-integrity.c +2 -2
@@ -4268,10 +4268,10 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv }/* -* If this workqueue were percpu, it would cause bio reordering +* If this workqueue weren't ordered, it would cause bio reordering * and reduced performance. */ - ic->wait_wq =alloc_workqueue ("dm-integrity-wait" ,WQ_MEM_RECLAIM |WQ_UNBOUND ,1 ); + ic->wait_wq =alloc_ordered_workqueue ("dm-integrity-wait" ,WQ_MEM_RECLAIM );if (!ic->wait_wq) { ti->error ="Cannot allocate workqueue" ; r = -ENOMEM ;
drivers/md/dm.c +1 -1
@@ -207,7 +207,7 @@ static int __init local_init(void)if (r)return r; - deferred_remove_workqueue =alloc_workqueue ("kdmremove" ,WQ_UNBOUND ,1 ); + deferred_remove_workqueue =alloc_ordered_workqueue ("kdmremove" ,0 );if (!deferred_remove_workqueue) { r = -ENOMEM ; goto out_uevent_exit;
Signature · 6 lines
2.40.0 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Tejun Heo
maintainerPATCH 5/22 media: amphion: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/media/platform/amphion/vpu_core.c | 2 +- drivers/media/platform/amphion/vpu_v4l2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/amphion/vpu_core.c +1 -1
@@ -254,7 +254,7 @@ static int vpu_core_register(struct device *dev, struct vpu_core *core)if (vpu_core_is_exist (vpu, core))return 0 ; - core->workqueue =alloc_workqueue ("vpu" ,WQ_UNBOUND |WQ_MEM_RECLAIM ,1 ); + core->workqueue =alloc_ordered_workqueue ("vpu" ,WQ_MEM_RECLAIM );if (!core->workqueue) {dev_err (core->dev,"fail to alloc workqueue\n" );return -ENOMEM ;
drivers/media/platform/amphion/vpu_v4l2.c +1 -1
@@ -740,7 +740,7 @@ int vpu_v4l2_open(struct file *file, struct vpu_inst *inst) inst->fh.ctrl_handler = &inst->ctrl_handler; file->private_data = &inst->fh; inst->state =VPU_CODEC_STATE_DEINIT ; - inst->workqueue =alloc_workqueue ("vpu_inst" ,WQ_UNBOUND |WQ_MEM_RECLAIM ,1 ); + inst->workqueue =alloc_ordered_workqueue ("vpu_inst" ,WQ_MEM_RECLAIM );if (inst->workqueue) {INIT_WORK (&inst->msg_work, vpu_inst_run_work); ret = kfifo_init(&inst->msg_fifo,
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 6/22 net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/cavium/thunder/thunder_bgx.c +1 -2
@@ -1126,8 +1126,7 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid) } poll: - lmac->check_link =alloc_workqueue ("check_link" ,WQ_UNBOUND | -WQ_MEM_RECLAIM ,1 ); + lmac->check_link =alloc_ordered_workqueue ("check_link" ,WQ_MEM_RECLAIM );if (!lmac->check_link)return -ENOMEM ;INIT_DELAYED_WORK (&lmac->dwork, bgx_poll_for_link);
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 7/22 net: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 5 ++--- .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 13 +++++-------- .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 5 ++--- 3 files changed, 9 insertions(+), 14 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +2 -3
@@ -3013,9 +3013,8 @@ static int rvu_flr_init(struct rvu *rvu) cfg | BIT_ULL(22)); } - rvu->flr_wq =alloc_workqueue ("rvu_afpf_flr" , -WQ_UNBOUND |WQ_HIGHPRI |WQ_MEM_RECLAIM , -1 ); + rvu->flr_wq =alloc_ordered_workqueue ("rvu_afpf_flr" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!rvu->flr_wq)return -ENOMEM ;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +5 -8
@@ -271,8 +271,7 @@ static int otx2_pf_flr_init(struct otx2_nic *pf, int num_vfs) {int vf; - pf->flr_wq =alloc_workqueue ("otx2_pf_flr_wq" , -WQ_UNBOUND |WQ_HIGHPRI ,1 ); + pf->flr_wq =alloc_ordered_workqueue ("otx2_pf_flr_wq" ,WQ_HIGHPRI );if (!pf->flr_wq)return -ENOMEM ;
@@ -593,9 +592,8 @@ static int otx2_pfvf_mbox_init(struct otx2_nic *pf, int numvfs)if (!pf->mbox_pfvf)return -ENOMEM ; - pf->mbox_pfvf_wq =alloc_workqueue ("otx2_pfvf_mailbox" , -WQ_UNBOUND |WQ_HIGHPRI | -WQ_MEM_RECLAIM ,1 ); + pf->mbox_pfvf_wq =alloc_ordered_workqueue ("otx2_pfvf_mailbox" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!pf->mbox_pfvf_wq)return -ENOMEM ;
@@ -1063,9 +1061,8 @@ static int otx2_pfaf_mbox_init(struct otx2_nic *pf)int err; mbox->pfvf = pf; - pf->mbox_wq =alloc_workqueue ("otx2_pfaf_mailbox" , -WQ_UNBOUND |WQ_HIGHPRI | -WQ_MEM_RECLAIM ,1 ); + pf->mbox_wq =alloc_ordered_workqueue ("otx2_pfaf_mailbox" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!pf->mbox_wq)return -ENOMEM ;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +2 -3
@@ -297,9 +297,8 @@ static int otx2vf_vfaf_mbox_init(struct otx2_nic *vf)int err; mbox->pfvf = vf; - vf->mbox_wq =alloc_workqueue ("otx2_vfaf_mailbox" , -WQ_UNBOUND |WQ_HIGHPRI | -WQ_MEM_RECLAIM ,1 ); + vf->mbox_wq =alloc_ordered_workqueue ("otx2_vfaf_mailbox" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!vf->mbox_wq)return -ENOMEM ;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 8/22 wifi: ath10/11/12k: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/net/wireless/ath/ath10k/qmi.c | 3 +-- drivers/net/wireless/ath/ath11k/qmi.c | 3 +-- drivers/net/wireless/ath/ath12k/qmi.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/qmi.c +1 -2
@@ -1082,8 +1082,7 @@ int ath10k_qmi_init(struct ath10k *ar, u32 msa_size)if (ret) goto err; - qmi->event_wq =alloc_workqueue ("ath10k_qmi_driver_event" , -WQ_UNBOUND ,1 ); + qmi->event_wq =alloc_ordered_workqueue ("ath10k_qmi_driver_event" ,0 );if (!qmi->event_wq) {ath10k_err (ar,"failed to allocate workqueue\n" ); ret = -EFAULT ;
drivers/net/wireless/ath/ath11k/qmi.c +1 -2
@@ -3256,8 +3256,7 @@ int ath11k_qmi_init_service(struct ath11k_base *ab)return ret; } - ab->qmi.event_wq =alloc_workqueue ("ath11k_qmi_driver_event" , -WQ_UNBOUND ,1 ); + ab->qmi.event_wq =alloc_ordered_workqueue ("ath11k_qmi_driver_event" ,0 );if (!ab->qmi.event_wq) {ath11k_err (ab,"failed to allocate workqueue\n" );return -EFAULT ;
drivers/net/wireless/ath/ath12k/qmi.c +1 -2
@@ -3054,8 +3054,7 @@ int ath12k_qmi_init_service(struct ath12k_base *ab)return ret; } - ab->qmi.event_wq =alloc_workqueue ("ath12k_qmi_driver_event" , -WQ_UNBOUND ,1 ); + ab->qmi.event_wq =alloc_ordered_workqueue ("ath12k_qmi_driver_event" ,0 );if (!ab->qmi.event_wq) {ath12k_err (ab,"failed to allocate workqueue\n" );return -EFAULT ;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 9/22 wifi: iwlwifi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +2 -2
@@ -3576,8 +3576,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,init_waitqueue_head (&trans_pcie->fw_reset_waitq);init_waitqueue_head (&trans_pcie->imr_waitq); - trans_pcie->rba.alloc_wq =alloc_workqueue ("rb_allocator" , -WQ_HIGHPRI |WQ_UNBOUND ,1 ); + trans_pcie->rba.alloc_wq =alloc_ordered_workqueue ("rb_allocator" , +WQ_HIGHPRI );if (!trans_pcie->rba.alloc_wq) { ret = -ENOMEM ; goto out_free_trans;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 15/22 xen/pvcalls: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/xen/pvcalls-back.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/xen/pvcalls-back.c +2 -2
@@ -361,7 +361,7 @@ static struct sock_mapping *pvcalls_new_active_socket( map->data.in = map->bytes; map->data.out = map->bytes +XEN_FLEX_RING_SIZE (map->ring_order); - map->ioworker.wq =alloc_workqueue ("pvcalls_io" ,WQ_UNBOUND ,1 ); + map->ioworker.wq =alloc_ordered_workqueue ("pvcalls_io" ,0 );if (!map->ioworker.wq) goto out;atomic_set (&map->io,1 );
@@ -637,7 +637,7 @@ static int pvcalls_back_bind(struct xenbus_device *dev,INIT_WORK (&map->register_work, __pvcalls_back_accept);spin_lock_init (&map->copy_lock); - map->wq =alloc_workqueue ("pvcalls_wq" ,WQ_UNBOUND ,1 ); + map->wq =alloc_ordered_workqueue ("pvcalls_wq" ,0 );if (!map->wq) { ret = -ENOMEM ; goto out;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 10/22 wifi: mwifiex: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- .../net/wireless/marvell/mwifiex/cfg80211.c | 13 +++++------ drivers/net/wireless/marvell/mwifiex/main.c | 22 +++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-)
drivers/net/wireless/marvell/mwifiex/cfg80211.c +6 -7
@@ -3124,10 +3124,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,SET_NETDEV_DEV (dev, adapter->dev); - priv->dfs_cac_workqueue =alloc_workqueue ("MWIFIEX_DFS_CAC%s" , -WQ_HIGHPRI | -WQ_MEM_RECLAIM | -WQ_UNBOUND ,1 , name); + priv->dfs_cac_workqueue = +alloc_ordered_workqueue ("MWIFIEX_DFS_CAC%s" , +WQ_HIGHPRI |WQ_MEM_RECLAIM , name);if (!priv->dfs_cac_workqueue) {mwifiex_dbg (adapter,ERROR ,"cannot alloc DFS CAC queue\n" ); ret = -ENOMEM ;
@@ -3136,9 +3135,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,INIT_DELAYED_WORK (&priv->dfs_cac_work, mwifiex_dfs_cac_work_queue); - priv->dfs_chan_sw_workqueue =alloc_workqueue ("MWIFIEX_DFS_CHSW%s" , -WQ_HIGHPRI |WQ_UNBOUND | -WQ_MEM_RECLAIM ,1 , name); + priv->dfs_chan_sw_workqueue = +alloc_ordered_workqueue ("MWIFIEX_DFS_CHSW%s" , +WQ_HIGHPRI |WQ_MEM_RECLAIM , name);if (!priv->dfs_chan_sw_workqueue) {mwifiex_dbg (adapter,ERROR ,"cannot alloc DFS channel sw queue\n" ); ret = -ENOMEM ;
drivers/net/wireless/marvell/mwifiex/main.c +10 -12
@@ -1546,18 +1546,17 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter) adapter->rx_work_enabled = true; adapter->workqueue = -alloc_workqueue ("MWIFIEX_WORK_QUEUE" , -WQ_HIGHPRI |WQ_MEM_RECLAIM |WQ_UNBOUND ,1 ); +alloc_ordered_workqueue ("MWIFIEX_WORK_QUEUE" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!adapter->workqueue) goto err_kmalloc;INIT_WORK (&adapter->main_work, mwifiex_main_work_queue);if (adapter->rx_work_enabled) { - adapter->rx_workqueue =alloc_workqueue ("MWIFIEX_RX_WORK_QUEUE" , -WQ_HIGHPRI | -WQ_MEM_RECLAIM | -WQ_UNBOUND ,1 ); + adapter->rx_workqueue = +alloc_ordered_workqueue ("MWIFIEX_RX_WORK_QUEUE" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!adapter->rx_workqueue) goto err_kmalloc;INIT_WORK (&adapter->rx_work, mwifiex_rx_work_queue);
@@ -1701,18 +1700,17 @@ mwifiex_add_card(void *card, struct completion *fw_done, adapter->rx_work_enabled = true; adapter->workqueue = -alloc_workqueue ("MWIFIEX_WORK_QUEUE" , -WQ_HIGHPRI |WQ_MEM_RECLAIM |WQ_UNBOUND ,1 ); +alloc_ordered_workqueue ("MWIFIEX_WORK_QUEUE" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!adapter->workqueue) goto err_kmalloc;INIT_WORK (&adapter->main_work, mwifiex_main_work_queue);if (adapter->rx_work_enabled) { - adapter->rx_workqueue =alloc_workqueue ("MWIFIEX_RX_WORK_QUEUE" , -WQ_HIGHPRI | -WQ_MEM_RECLAIM | -WQ_UNBOUND ,1 ); + adapter->rx_workqueue = +alloc_ordered_workqueue ("MWIFIEX_RX_WORK_QUEUE" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!adapter->rx_workqueue) goto err_kmalloc;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 11/22 net: wwan: t7xx: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 13 +++++++------ drivers/net/wwan/t7xx/t7xx_hif_dpmaif_tx.c | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-)
drivers/net/wwan/t7xx/t7xx_hif_cldma.c +7 -6
@@ -1293,9 +1293,9 @@ int t7xx_cldma_init(struct cldma_ctrl *md_ctrl)for (i =0 ; i <CLDMA_TXQ_NUM ; i++) {md_cd_queue_struct_init (&md_ctrl->txq[i], md_ctrl,MTK_TX , i); md_ctrl->txq[i].worker = -alloc_workqueue ("md_hif%d_tx%d_worker" , -WQ_UNBOUND |WQ_MEM_RECLAIM | (i ?0 :WQ_HIGHPRI ), -1 , md_ctrl->hif_id, i); +alloc_ordered_workqueue ("md_hif%d_tx%d_worker" , +WQ_MEM_RECLAIM | (i ?0 :WQ_HIGHPRI ), + md_ctrl->hif_id, i);if (!md_ctrl->txq[i].worker) goto err_workqueue;
@@ -1306,9 +1306,10 @@ int t7xx_cldma_init(struct cldma_ctrl *md_ctrl)md_cd_queue_struct_init (&md_ctrl->rxq[i], md_ctrl,MTK_RX , i);INIT_WORK (&md_ctrl->rxq[i].cldma_work, t7xx_cldma_rx_done); - md_ctrl->rxq[i].worker =alloc_workqueue ("md_hif%d_rx%d_worker" , -WQ_UNBOUND |WQ_MEM_RECLAIM , -1 , md_ctrl->hif_id, i); + md_ctrl->rxq[i].worker = +alloc_ordered_workqueue ("md_hif%d_rx%d_worker" , +WQ_MEM_RECLAIM , + md_ctrl->hif_id, i);if (!md_ctrl->rxq[i].worker) goto err_workqueue; }
drivers/net/wwan/t7xx/t7xx_hif_dpmaif_tx.c +3 -2
@@ -618,8 +618,9 @@ int t7xx_dpmaif_txq_init(struct dpmaif_tx_queue *txq)return ret; } - txq->worker =alloc_workqueue ("md_dpmaif_tx%d_worker" ,WQ_UNBOUND |WQ_MEM_RECLAIM | - (txq->index ?0 :WQ_HIGHPRI ),1 , txq->index); + txq->worker =alloc_ordered_workqueue ("md_dpmaif_tx%d_worker" , +WQ_MEM_RECLAIM | (txq->index ?0 :WQ_HIGHPRI ), + txq->index);if (!txq->worker)return -ENOMEM ;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 12/22 scsi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/scsi/NCR5380.c | 5 ++--- drivers/scsi/hosts.c | 12 ++++++------ drivers/scsi/libiscsi.c | 5 ++--- 3 files changed, 10 insertions(+), 12 deletions(-)
drivers/scsi/NCR5380.c +2 -3
@@ -415,9 +415,8 @@ static int NCR5380_init(struct Scsi_Host *instance, int flags) hostdata->flags = flags;INIT_WORK (&hostdata->main_task, NCR5380_main); - hostdata->work_q =alloc_workqueue ("ncr5380_%d" , -WQ_UNBOUND |WQ_MEM_RECLAIM , -1 , instance->host_no); + hostdata->work_q =alloc_ordered_workqueue ("ncr5380_%d" , +WQ_MEM_RECLAIM , instance->host_no);if (!hostdata->work_q)return -ENOMEM ;
drivers/scsi/hosts.c +6 -6
@@ -294,9 +294,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,if (shost->transportt->create_work_queue) {snprintf (shost->work_q_name,sizeof (shost->work_q_name),"scsi_wq_%d" , shost->host_no); - shost->work_q =alloc_workqueue ("%s" , -WQ_SYSFS | __WQ_LEGACY |WQ_MEM_RECLAIM |WQ_UNBOUND , -1 , shost->work_q_name); + shost->work_q =alloc_ordered_workqueue ("%s" , +WQ_SYSFS | __WQ_LEGACY |WQ_MEM_RECLAIM , + shost->work_q_name);if (!shost->work_q) { error = -EINVAL ;
@@ -510,9 +510,9 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) goto fail; } - shost->tmf_work_q =alloc_workqueue ("scsi_tmf_%d" , -WQ_UNBOUND |WQ_MEM_RECLAIM |WQ_SYSFS , -1 , shost->host_no); + shost->tmf_work_q =alloc_ordered_workqueue ("scsi_tmf_%d" , +WQ_MEM_RECLAIM |WQ_SYSFS , + shost->host_no);if (!shost->tmf_work_q) {shost_printk (KERN_WARNING , shost,"failed to create tmf workq\n" );
drivers/scsi/libiscsi.c +2 -3
@@ -2907,9 +2907,8 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht, ihost =shost_priv (shost);if (xmit_can_sleep) { - ihost->workq =alloc_workqueue ("iscsi_q_%d" , -WQ_SYSFS | __WQ_LEGACY |WQ_MEM_RECLAIM |WQ_UNBOUND , -1 , shost->host_no); + ihost->workq =alloc_ordered_workqueue ("iscsi_q_%d" , +WQ_SYSFS | __WQ_LEGACY |WQ_MEM_RECLAIM , shost->host_no);if (!ihost->workq) goto free_host; }
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 16/22 btrfs: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- fs/btrfs/disk-io.c | 2 +- fs/btrfs/scrub.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
fs/btrfs/disk-io.c +1 -1
@@ -2218,7 +2218,7 @@ static int btrfs_init_workqueues(struct btrfs_fs_info *fs_info) fs_info->qgroup_rescan_workers =btrfs_alloc_workqueue (fs_info,"qgroup-rescan" , flags,1 ,0 ); fs_info->discard_ctl.discard_workers = -alloc_workqueue ("btrfs_discard" ,WQ_UNBOUND |WQ_FREEZABLE ,1 ); +alloc_ordered_workqueue ("btrfs_discard" ,WQ_FREEZABLE ); if (!(fs_info->workers && fs_info->hipri_workers && fs_info->delalloc_workers && fs_info->flush_workers &&
fs/btrfs/scrub.c +4 -2
@@ -4245,8 +4245,10 @@ static noinline_for_stack int scrub_workers_get(struct btrfs_fs_info *fs_info,if (refcount_inc_not_zero (&fs_info->scrub_workers_refcnt))return 0 ; - scrub_workers =alloc_workqueue ("btrfs-scrub" , flags, - is_dev_replace ?1 : max_active); +if (is_dev_replace) + scrub_workers =alloc_ordered_workqueue ("btrfs-scrub" , flags); +else + scrub_workers =alloc_workqueue ("btrfs-scrub" , flags, max_active);if (!scrub_workers) goto fail_scrub_workers;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 14/22 soc: qcom: qmi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/soc/qcom/qmi_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/qmi_interface.c +1 -1
@@ -650,7 +650,7 @@ int qmi_handle_init(struct qmi_handle *qmi, size_t recv_buf_size,if (!qmi->recv_buf)return -ENOMEM ; - qmi->wq =alloc_workqueue ("qmi_msg_handler" ,WQ_UNBOUND ,1 ); + qmi->wq =alloc_ordered_workqueue ("qmi_msg_handler" ,0 );if (!qmi->wq) { ret = -ENOMEM ; goto err_free_recv_buf;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 13/22 virt: acrn: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/virt/acrn/ioreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/virt/acrn/ioreq.c +2 -2
@@ -576,8 +576,8 @@ static void ioreq_resume(void)int acrn_ioreq_intr_setup (void ) {acrn_setup_intr_handler (ioreq_intr_handler); - ioreq_wq =alloc_workqueue ("ioreq_wq" , -WQ_HIGHPRI |WQ_MEM_RECLAIM |WQ_UNBOUND ,1 ); + ioreq_wq =alloc_ordered_workqueue ("ioreq_wq" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!ioreq_wq) {dev_err (acrn_dev.this_device,"Failed to alloc workqueue!\n" );acrn_remove_intr_handler ();
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 17/22 cifs: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- fs/cifs/dfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/dfs_cache.c +1 -1
@@ -290,7 +290,7 @@ int dfs_cache_init(void)int rc;int i; - dfscache_wq =alloc_workqueue ("cifs-dfscache" ,WQ_FREEZABLE |WQ_UNBOUND ,1 ); + dfscache_wq =alloc_ordered_workqueue ("cifs-dfscache" ,WQ_FREEZABLE );if (!dfscache_wq)return -ENOMEM ;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 18/22 net: qrtr: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- net/qrtr/ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/qrtr/ns.c +1 -1
@@ -783,7 +783,7 @@ int qrtr_ns_init(void) goto err_sock; } - qrtr_ns.workqueue =alloc_workqueue ("qrtr_ns_handler" ,WQ_UNBOUND ,1 ); + qrtr_ns.workqueue =alloc_ordered_workqueue ("qrtr_ns_handler" ,0 );if (!qrtr_ns.workqueue) { ret = -ENOMEM ; goto err_sock;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 19/22 rxrpc: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- net/rxrpc/af_rxrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/rxrpc/af_rxrpc.c +1 -1
@@ -972,7 +972,7 @@ static int __init af_rxrpc_init(void) goto error_call_jar; } - rxrpc_workqueue =alloc_workqueue ("krxrpcd" ,WQ_HIGHPRI |WQ_MEM_RECLAIM |WQ_UNBOUND ,1 ); + rxrpc_workqueue =alloc_ordered_workqueue ("krxrpcd" ,WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!rxrpc_workqueue) {pr_notice ("Failed to allocate work queue\n" ); goto error_work_queue;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 20/22 crypto: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 12 ++++++------ drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c +6 -6
@@ -357,9 +357,9 @@ static int cptpf_vfpf_mbox_init(struct otx2_cptpf_dev *cptpf, int num_vfs)u64 vfpf_mbox_base;int err, i; - cptpf->vfpf_mbox_wq =alloc_workqueue ("cpt_vfpf_mailbox" , -WQ_UNBOUND |WQ_HIGHPRI | -WQ_MEM_RECLAIM ,1 ); + cptpf->vfpf_mbox_wq = +alloc_ordered_workqueue ("cpt_vfpf_mailbox" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!cptpf->vfpf_mbox_wq)return -ENOMEM ;
@@ -453,9 +453,9 @@ static int cptpf_afpf_mbox_init(struct otx2_cptpf_dev *cptpf)resource_size_t offset;int err; - cptpf->afpf_mbox_wq =alloc_workqueue ("cpt_afpf_mailbox" , -WQ_UNBOUND |WQ_HIGHPRI | -WQ_MEM_RECLAIM ,1 ); + cptpf->afpf_mbox_wq = +alloc_ordered_workqueue ("cpt_afpf_mailbox" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!cptpf->afpf_mbox_wq)return -ENOMEM ;
drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c +3 -3
@@ -75,9 +75,9 @@ static int cptvf_pfvf_mbox_init(struct otx2_cptvf_dev *cptvf)resource_size_t offset, size;int ret; - cptvf->pfvf_mbox_wq =alloc_workqueue ("cpt_pfvf_mailbox" , -WQ_UNBOUND |WQ_HIGHPRI | -WQ_MEM_RECLAIM ,1 ); + cptvf->pfvf_mbox_wq = +alloc_ordered_workqueue ("cpt_pfvf_mailbox" , +WQ_HIGHPRI |WQ_MEM_RECLAIM );if (!cptvf->pfvf_mbox_wq)return -ENOMEM ;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 21/22 media: coda: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
--- drivers/media/platform/chips-media/coda-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/chips-media/coda-common.c +1 -1
@@ -3268,7 +3268,7 @@ static int coda_probe(struct platform_device *pdev) &dev->iram.blob); } - dev->workqueue =alloc_workqueue ("coda" ,WQ_UNBOUND |WQ_MEM_RECLAIM ,1 ); + dev->workqueue =alloc_ordered_workqueue ("coda" ,WQ_MEM_RECLAIM );if (!dev->workqueue) {dev_err (&pdev->dev,"unable to alloc workqueue\n" ); ret = -ENOMEM ;
Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 22/22 workqueue: Don't implicitly make UNBOUND workqueues w/ @max_active==1 ordered
In reply to Tejun Heo5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") automoatically promoted UNBOUND workqueues w/ @max_active==1 to ordered workqueues because UNBOUND workqueues w/ @max_active==1 used to be the way to create ordered workqueues and the new NUMA support broke it. These problems can be subtle and the fact that they can only trigger on NUMA machines made them even more difficult to debug.
However, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue udpates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
There aren't that many UNBOUND w/ @max_active==1 users in the tree and the preceding patches audited all and converted them to alloc_ordered_workqueue() as appropriate. This patch removes the implicit promotion of UNBOUND w/ @max_active==1 workqueues to ordered ones.
Workqueue will also add a debug option to make all unordered UNBOUND workqueues to use per-cpu pool_workqueues so that these problems can be surfaced easier on most machines.
--- include/linux/workqueue.h | 4 +--- kernel/workqueue.c | 23 ++++------------------- 2 files changed, 5 insertions(+), 22 deletions(-)
include/linux/workqueue.h +1 -3
@@ -339,7 +339,6 @@ enum { __WQ_DRAINING =1 <<16 ,/* internal: workqueue is draining */ __WQ_ORDERED =1 <<17 ,/* internal: workqueue is ordered */ __WQ_LEGACY =1 <<18 ,/* internal: create*_workqueue() */ - __WQ_ORDERED_EXPLICIT =1 <<19 ,/* internal: alloc_ordered_workqueue() */ WQ_MAX_ACTIVE =512 ,/* I like 512, better ideas? */ WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */
@@ -417,8 +416,7 @@ alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...);* Pointer to the allocated workqueue on success, %NULL on failure. */ #define alloc_ordered_workqueue(fmt, flags, args...) \ - alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | \ - __WQ_ORDERED_EXPLICIT | (flags), 1, ##args) + alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args)#define create_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name))
kernel/workqueue.c +4 -19
@@ -4180,12 +4180,8 @@ static int apply_workqueue_attrs_locked(struct workqueue_struct *wq,return -EINVAL ;/* creating multiple pwqs breaks ordering guarantee */ -if (!list_empty (&wq->pwqs)) { -if (WARN_ON (wq->flags & __WQ_ORDERED_EXPLICIT)) -return -EINVAL ; - - wq->flags &= ~__WQ_ORDERED; - } +if (WARN_ON (wq->flags & __WQ_ORDERED)) +return -EINVAL ; ctx =apply_wqattrs_prepare (wq, attrs, wq_unbound_cpumask);if (!ctx)
@@ -4408,16 +4404,6 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,struct workqueue_struct *wq;struct pool_workqueue *pwq; -/* -* Unbound && max_active == 1 used to imply ordered, which is no -* longer the case on NUMA machines due to per-node pools. While -* alloc_ordered_workqueue() is the right way to create an ordered -* workqueue, keep the previous behavior to avoid subtle breakages -* on NUMA. -*/ -if ((flags &WQ_UNBOUND ) && max_active ==1 ) - flags |= __WQ_ORDERED; -/* see the comment above the definition of WQ_POWER_EFFICIENT */ if ((flags &WQ_POWER_EFFICIENT ) && wq_power_efficient) flags |=WQ_UNBOUND ;
@@ -4625,14 +4611,13 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)struct pool_workqueue *pwq;/* disallow meddling with max_active for ordered workqueues */ -if (WARN_ON (wq->flags & __WQ_ORDERED_EXPLICIT)) +if (WARN_ON (wq->flags & __WQ_ORDERED))return ; max_active =wq_clamp_max_active (max_active, wq->flags, wq->name);mutex_lock (&wq->mutex); - wq->flags &= ~__WQ_ORDERED; wq->saved_max_active = max_active;for_each_pwq (pwq, wq)
@@ -5868,7 +5853,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq)* attributes breaks ordering guarantee. Disallow exposing ordered * workqueues. */ -if (WARN_ON (wq->flags & __WQ_ORDERED_EXPLICIT)) +if (WARN_ON (wq->flags & __WQ_ORDERED))return -EINVAL ; wq->wq_dev = wq_dev =kzalloc (sizeof (*wq_dev),GFP_KERNEL );
Signature · 1 line
2.40.0
Re: [PATCH 02/22] greybus: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 49 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
Quoted 8 lines
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc Johan Hovold <[email protected]>Cc Alex Elder <[email protected]>Cc Greg Kroah-Hartman <[email protected]>
Re: [PATCH 13/22] virt: acrn: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 52 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Quoted 6 lines
Signed-off-by Tejun Heo <[email protected]>Cc Fei Li <[email protected]>Cc Greg Kroah-Hartman <[email protected]>--- drivers/virt/acrn/ioreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Re: [PATCH 01/22] powerpc, workqueue: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 58 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc Michael Ellerman <[email protected]>Cc Nicholas Piggin <[email protected]>Cc Christophe Leroy <[email protected]>Cc Nathan Lynch <[email protected]>
Quoted 4 lines
--- arch/powerpc/kernel/tau_6xx.c | 2 +- arch/powerpc/platforms/pseries/dlpar.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
Quoted 18 lines
arch/powerpc/kernel/tau_6xx.c +1
-1@@ -200,7 +200,7 @@ static int __init TAU_init(void) tau_int_enable =IS_ENABLED (CONFIG_TAU_INT ) && !strcmp (cur_cpu_spec->platform,"ppc750" ); - tau_workq =alloc_workqueue ("tau" ,WQ_UNBOUND ,1 ); + tau_workq =alloc_ordered_workqueue ("tau" ,0 );if (!tau_workq)return -ENOMEM ;arch/powerpc/platforms/pseries/dlpar.c +0
-0
arch/powerpc/platforms/pseries/dlpar.c int __init dlpar_workqueue_init(void) · line 570
Quoted 9 lines
arch/powerpc/platforms/pseries/dlpar.c +1
-2@@ -564,8 +564,7 @@ int __init dlpar_workqueue_init(void)if (pseries_hp_wq)return 0 ; - pseries_hp_wq =alloc_workqueue ("pseries hotplug workqueue" , -WQ_UNBOUND ,1 ); + pseries_hp_wq =alloc_ordered_workqueue ("pseries hotplug workqueue" ,0 );return pseries_hp_wq ?0 : -ENOMEM ; }
The change log of commit 9054619ef54a ("powerpc/pseries: Add pseries hotplug workqueue") makes it fairly clear that this code does explicitly want an ordered queue.
cheers
RE: [EXT] [PATCH 07/22] net: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 83 lines
-----Original Message-----
From: Tejun Heo <[email protected]> On Behalf Of Tejun Heo
Sent: Friday, April 21, 2023 8:21 AM
To: [email protected]
Cc: [email protected]; [email protected]; Tejun Heo <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Sunil Kovvuri Goutham <[email protected]>; Ratheesh Kannoth <[email protected]>; Srujana Challa <[email protected]>; Geethasowjanya Akula <[email protected]>; [email protected]
Subject: [EXT] [PATCH 07/22] net: octeontx2: Usealloc_ordered_workqueue()to create ordered workqueuesExternal Email
----------------------------------------------------------------------
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/
@max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>Cc Sunil Goutham <[email protected]>Cc Ratheesh Kannoth <[email protected]>Cc Srujana Challa <[email protected]>Cc Geetha sowjanya <[email protected]>
Quoted 6 lines
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 5 ++--- .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 13 +++++-------- .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 5 ++--- 3 files changed, 9 insertions(+), 14 deletions(-)
RE: [EXT] [PATCH 06/22] net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 101 lines
-----Original Message-----
From: Tejun Heo <[email protected]> On Behalf Of Tejun Heo
Sent: Friday, April 21, 2023 8:21 AM
To: [email protected]
Cc: [email protected]; [email protected]; Tejun Heo <[email protected]>; Sunil Kovvuri Goutham <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; linux-arm- [email protected]; [email protected]
Subject: [EXT] [PATCH 06/22] net: thunderx: Usealloc_ordered_workqueue()to create ordered workqueuesExternal Email
----------------------------------------------------------------------
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/
@max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc Sunil Goutham <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>--- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/ethernet/cavium/thunder/thunder_bgx.c +2
-3@@ -1126,8 +1126,7 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid) } poll: - lmac->check_link =alloc_workqueue ("check_link" ,WQ_UNBOUND | -WQ_MEM_RECLAIM ,1 ); + lmac->check_link =alloc_ordered_workqueue ("check_link" , +WQ_MEM_RECLAIM );if (!lmac->check_link)return -ENOMEM ;INIT_DELAYED_WORK (&lmac->dwork, bgx_poll_for_link); --
Quoted 1 line
2.40.0
Re: [PATCH 02/22] greybus: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 32 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
Quoted 8 lines
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc Johan Hovold <[email protected]>Cc Alex Elder <[email protected]>Cc Greg Kroah-Hartman <[email protected]>
Re: [PATCH 02/22] greybus: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 45 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
Quoted 6 lines
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Both of the workqueues affected here should be ordered.
Quoted 39 lines
Signed-off-by Tejun Heo <[email protected]>Cc Johan Hovold <[email protected]>Cc Alex Elder <[email protected]>Cc Greg Kroah-Hartman <[email protected]>--- drivers/greybus/connection.c | 4 ++-- drivers/greybus/svc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/greybus/connection.c +2
-2@@ -187,8 +187,8 @@ _gb_connection_create(struct gb_host_device *hd, int hd_cport_id,spin_lock_init (&connection->lock);INIT_LIST_HEAD (&connection->operations); - connection->wq =alloc_workqueue ("%s:%d" ,WQ_UNBOUND ,1 , -dev_name (&hd->dev), hd_cport_id); + connection->wq =alloc_ordered_workqueue ("%s:%d" ,0 ,dev_name (&hd->dev), + hd_cport_id);if (!connection->wq) { ret = -ENOMEM ; goto err_free_connection;drivers/greybus/svc.c +1
-1@@ -1318,7 +1318,7 @@ struct gb_svc *gb_svc_create(struct gb_host_device *hd)if (!svc)return NULL ; - svc->wq =alloc_workqueue ("%s:svc" ,WQ_UNBOUND ,1 ,dev_name (&hd->dev)); + svc->wq =alloc_ordered_workqueue ("%s:svc" ,0 ,dev_name (&hd->dev));if (!svc->wq) {kfree (svc);return NULL ;
Jakub Kicinski
maintainerRe: [PATCH 06/22] net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 8 lines · On Thu, 20 Apr 2023 16:50:30 -1000 Tejun Heo wrote:
Signed-off-by Tejun Heo <[email protected]>Cc Sunil Goutham <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>
You take this via your tree directly to Linus T?
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 03/22] IB/hfi1: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 73 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc Dennis Dalessandro <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Leon Romanovsky <[email protected]>--- drivers/infiniband/hw/hfi1/init.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/infiniband/hw/hfi1/init.c +1
-1@@ -755,14 +755,13 @@ static int create_workqueues(struct hfi1_devdata *dd) }if (!ppd->link_wq) {/* -* Make the link workqueue single-threaded to enforce +* Make the link workqueue ordered to enforce * serialization. */
drivers/infiniband/hw/hfi1/init.c static int create_workqueues(struct hfi1_devdata *dd) · line 767
Quoted 10 lines
drivers/infiniband/hw/hfi1/init.c +2
-3ppd->link_wq = -alloc_workqueue ( +alloc_ordered_workqueue ("hfi_link_%d_%d" , -WQ_SYSFS |WQ_MEM_RECLAIM |WQ_UNBOUND , -1 ,/* max_active */ +WQ_SYSFS |WQ_MEM_RECLAIM , dd->unit, pidx);if (!ppd->link_wq) goto wq_error;
Seems OK to me.
Tejun Heo
maintainerRe: [PATCH 06/22] net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Jakub KicinskiQuoted 11 lines · Jakub Kicinski
Quoted 8 lines · On Thu, 20 Apr 2023 16:50:30 -1000 Tejun Heo wrote:
Signed-off-by Tejun Heo <[email protected]>Cc Sunil Goutham <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>You take this via your tree directly to Linus T?
Yeah, that'd be my preference unless someone is really against it.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 12/22] scsi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 56 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc "James E.J. Bottomley" <[email protected]>Cc "Martin K. Petersen" <[email protected]>
Quoted 6 lines
--- drivers/scsi/NCR5380.c | 5 ++--- drivers/scsi/hosts.c | 12 ++++++------ drivers/scsi/libiscsi.c | 5 ++--- 3 files changed, 10 insertions(+), 12 deletions(-)
The conversions look good to me.
Signature · 4 lines
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy Vors. Aufs.-R.: Gregor Pillen / Geschäftsführung: David Faller Sitz der Ges.: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294
Re: [PATCH 06/22] net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 11 lines · On Fri, 21 Apr 2023 04:13:20 -1000 Tejun Heo wrote:
Quoted 10 lines · Jakub Kicinski
Quoted 8 lines · On Thu, 20 Apr 2023 16:50:30 -1000 Tejun Heo wrote:
Signed-off-by Tejun Heo <[email protected]>Cc Sunil Goutham <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>
Quoted 3 lines
Quoted 1 line
You take this via your tree directly to Linus T?
Yeah, that'd be my preference unless someone is really against it.
Re: [PATCH 17/22] cifs: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 60 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc Steve French <[email protected]>Cc Paulo Alcantara <[email protected]>Cc Ronnie Sahlberg <[email protected]>Cc Shyam Prasad N <[email protected]>Cc Tom Talpey <[email protected]>
Quoted 3 lines
--- fs/cifs/dfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH 22/22] workqueue: Don't implicitly make UNBOUND workqueues w/ @max_active==1 ordered
In reply to Tejun HeoQuoted 4 lines · Tejun Heo
There aren't that many UNBOUND w/ @max_active==1 users in the tree and the preceding patches audited all and converted them to
alloc_ordered_workqueue()as appropriate. This patch removes the implicit promotion of UNBOUND w/ @max_active==1 workqueues to ordered ones.
And because you only Cc'ed me on this patch but not the rest of the series there is no way to make me see it. Either cc me everywhere because it's actually important, or preferably just drop fringe Ccs.
Johannes Berg
reviewerRe: [PATCH 09/22] wifi: iwlwifi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 10 lines · Tejun Heo
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
Quoted 8 lines
to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
This workqueue only has a single work struct queued on it, I'm not _entirely_ sure why there's even a separate workqueue (possibly for priority reasons etc.), but surely with just a single work struct, order cannot really matter.
johannes
Re: [PATCH 10/22] wifi: mwifiex: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 33 lines · Tejun Heo
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc Amitkumar Karwar <[email protected]>Cc Ganapathi Bhat <[email protected]>Cc Sharvari Harisangam <[email protected]>Cc Xinming Hu <[email protected]>Cc Kalle Valo <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>
Quoted 4 lines
--- .../net/wireless/marvell/mwifiex/cfg80211.c | 13 +++++------ drivers/net/wireless/marvell/mwifiex/main.c | 22 +++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-)
These work queues only ever get a single work item on them, so "ordering" can't really matter. This could go either way -- a comment or the current patch; so:
Re: [PATCH 16/22] btrfs: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoHi,
Quoted 45 lines
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
Quoted 6 lines
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Should we add alloc_ordered_workqueue to btrfs_alloc_workqueue() of fs/btrfs/async-thread.c too?
Best Regards
Wang Yugui ([email protected])
2023/04/30
Quoted 43 lines
Signed-off-by Tejun Heo <[email protected]>Cc Chris Mason <[email protected]>Cc Josef Bacik <[email protected]>Cc David Sterba <[email protected]>--- fs/btrfs/disk-io.c | 2 +- fs/btrfs/scrub.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)fs/btrfs/disk-io.c +1
-1@@ -2218,7 +2218,7 @@ static int btrfs_init_workqueues(struct btrfs_fs_info *fs_info) fs_info->qgroup_rescan_workers =btrfs_alloc_workqueue (fs_info,"qgroup-rescan" , flags,1 ,0 ); fs_info->discard_ctl.discard_workers = -alloc_workqueue ("btrfs_discard" ,WQ_UNBOUND |WQ_FREEZABLE ,1 ); +alloc_ordered_workqueue ("btrfs_discard" ,WQ_FREEZABLE ); if (!(fs_info->workers && fs_info->hipri_workers && fs_info->delalloc_workers && fs_info->flush_workers &&fs/btrfs/scrub.c +4
-2@@ -4245,8 +4245,10 @@ static noinline_for_stack int scrub_workers_get(struct btrfs_fs_info *fs_info,if (refcount_inc_not_zero (&fs_info->scrub_workers_refcnt))return 0 ; - scrub_workers =alloc_workqueue ("btrfs-scrub" , flags, - is_dev_replace ?1 : max_active); +if (is_dev_replace) + scrub_workers =alloc_ordered_workqueue ("btrfs-scrub" , flags); +else + scrub_workers =alloc_workqueue ("btrfs-scrub" , flags, max_active);if (!scrub_workers) goto fail_scrub_workers;Signature · 1 line
2.40.0
Tejun Heo
maintainerPATCH 1/1 wifi: iwlwifi: Use default @max_active for trans_pcie->rba.alloc_wq
In reply to Johannes Bergtrans_pcie->rba.alloc_wq only hosts a single work item and thus doesn't need explicit concurrency limit. Let's use the default @max_active. This doesn't cost anything and clearly expresses that @max_active doesn't matter.
---
Hello,
Johannes, do you mind acking this patch instead?
Thanks.
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1 -1
@@ -3577,7 +3577,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(sinit_waitqueue_head (&trans_pcie->imr_waitq); trans_pcie->rba.alloc_wq =alloc_workqueue ("rb_allocator" , -WQ_HIGHPRI |WQ_UNBOUND ,1 ); +WQ_HIGHPRI |WQ_UNBOUND ,0 );if (!trans_pcie->rba.alloc_wq) { ret = -ENOMEM ; goto out_free_trans;
Tejun Heo
maintainerPATCH 1/1 wifi: mwifiex: Use default @max_active for workqueues
In reply to Brian NorrisThese workqueues only host a single work item and thus doen't need explicit concurrency limit. Let's use the default @max_active. This doesn't cost anything and clearly expresses that @max_active doesn't matter.
---
Hello, Brian.
Do you mind acking this patch instead?
Thanks.
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 4 ++-- drivers/net/wireless/marvell/mwifiex/main.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/marvell/mwifiex/cfg80211.c +2 -2
@@ -3127,7 +3127,7 @@ struct wireless_dev *mwifiex_add_virtual priv->dfs_cac_workqueue =alloc_workqueue ("MWIFIEX_DFS_CAC%s" ,WQ_HIGHPRI |WQ_MEM_RECLAIM | -WQ_UNBOUND ,1 , name); +WQ_UNBOUND ,0 , name);if (!priv->dfs_cac_workqueue) {mwifiex_dbg (adapter,ERROR ,"cannot alloc DFS CAC queue\n" ); ret = -ENOMEM ;
@@ -3138,7 +3138,7 @@ struct wireless_dev *mwifiex_add_virtual priv->dfs_chan_sw_workqueue =alloc_workqueue ("MWIFIEX_DFS_CHSW%s" ,WQ_HIGHPRI |WQ_UNBOUND | -WQ_MEM_RECLAIM ,1 , name); +WQ_MEM_RECLAIM ,0 , name);if (!priv->dfs_chan_sw_workqueue) {mwifiex_dbg (adapter,ERROR ,"cannot alloc DFS channel sw queue\n" ); ret = -ENOMEM ;
drivers/net/wireless/marvell/mwifiex/main.c +4 -4
@@ -1547,7 +1547,7 @@ mwifiex_reinit_sw(struct mwifiex_adapter adapter->workqueue =alloc_workqueue ("MWIFIEX_WORK_QUEUE" , -WQ_HIGHPRI |WQ_MEM_RECLAIM |WQ_UNBOUND ,1 ); +WQ_HIGHPRI |WQ_MEM_RECLAIM |WQ_UNBOUND ,0 );if (!adapter->workqueue) goto err_kmalloc;
@@ -1557,7 +1557,7 @@ mwifiex_reinit_sw(struct mwifiex_adapter adapter->rx_workqueue =alloc_workqueue ("MWIFIEX_RX_WORK_QUEUE" ,WQ_HIGHPRI |WQ_MEM_RECLAIM | -WQ_UNBOUND ,1 ); +WQ_UNBOUND ,0 );if (!adapter->rx_workqueue) goto err_kmalloc;INIT_WORK (&adapter->rx_work, mwifiex_rx_work_queue);
@@ -1702,7 +1702,7 @@ mwifiex_add_card(void *card, struct comp adapter->workqueue =alloc_workqueue ("MWIFIEX_WORK_QUEUE" , -WQ_HIGHPRI |WQ_MEM_RECLAIM |WQ_UNBOUND ,1 ); +WQ_HIGHPRI |WQ_MEM_RECLAIM |WQ_UNBOUND ,0 );if (!adapter->workqueue) goto err_kmalloc;
@@ -1712,7 +1712,7 @@ mwifiex_add_card(void *card, struct comp adapter->rx_workqueue =alloc_workqueue ("MWIFIEX_RX_WORK_QUEUE" ,WQ_HIGHPRI |WQ_MEM_RECLAIM | -WQ_UNBOUND ,1 ); +WQ_UNBOUND ,0 );if (!adapter->rx_workqueue) goto err_kmalloc;
Tejun Heo
maintainerPATCH v2 16/22 btrfs: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Wang YuguiBACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
v2: btrfs_alloc_workqueue() updated too as suggested by Wang.
---
Hello,
Wang, yeah, that's a helper that can't tell whether the caller wants an ordered wq or not, so it needs to be updated too. How does this look?
Thanks.
fs/btrfs/async-thread.c | 7 +++++-- fs/btrfs/disk-io.c | 2 +- fs/btrfs/scrub.c | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-)
fs/btrfs/async-thread.c +5 -2
@@ -99,8 +99,11 @@ struct btrfs_workqueue *btrfs_alloc_work ret->thresh = thresh; } - ret->normal_wq =alloc_workqueue ("btrfs-%s" , flags, ret->current_active, - name); +if (ret->current_active ==1 ) + ret->normal_wq =alloc_ordered_workqueue ("btrfs-%s" , flags, name); +else + ret->normal_wq =alloc_workqueue ("btrfs-%s" , flags, + ret->current_active, name);if (!ret->normal_wq) {kfree (ret);return NULL ;
fs/btrfs/disk-io.c +1 -1
@@ -2218,7 +2218,7 @@ static int btrfs_init_workqueues(struct fs_info->qgroup_rescan_workers =btrfs_alloc_workqueue (fs_info,"qgroup-rescan" , flags,1 ,0 ); fs_info->discard_ctl.discard_workers = -alloc_workqueue ("btrfs_discard" ,WQ_UNBOUND |WQ_FREEZABLE ,1 ); +alloc_ordered_workqueue ("btrfs_discard" ,WQ_FREEZABLE ); if (!(fs_info->workers && fs_info->hipri_workers && fs_info->delalloc_workers && fs_info->flush_workers &&
fs/btrfs/scrub.c +4 -2
@@ -4245,8 +4245,10 @@ static noinline_for_stack int scrub_workif (refcount_inc_not_zero (&fs_info->scrub_workers_refcnt))return 0 ; - scrub_workers =alloc_workqueue ("btrfs-scrub" , flags, - is_dev_replace ?1 : max_active); +if (is_dev_replace) + scrub_workers =alloc_ordered_workqueue ("btrfs-scrub" , flags); +else + scrub_workers =alloc_workqueue ("btrfs-scrub" , flags, max_active);if (!scrub_workers) goto fail_scrub_workers;
Re: [PATCH v2 16/22] btrfs: Use alloc_ordered_workqueue() to create ordered workqueues
Hi,
Quoted 79 lines
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
v2:
btrfs_alloc_workqueue()updated too as suggested by Wang.Signed-off-by Tejun Heo <[email protected]>Cc Wang Yugui <[email protected]>Cc Chris Mason <[email protected]>Cc Josef Bacik <[email protected]>Cc David Sterba <[email protected]>---
Hello,Wang, yeah, that's a helper that can't tell whether the caller wants an ordered wq or not, so it needs to be updated too. How does this look?
Thanks.
fs/btrfs/async-thread.c | 7 +++++-- fs/btrfs/disk-io.c | 2 +- fs/btrfs/scrub.c | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-)fs/btrfs/async-thread.c +0
-0@@ -99,8 +99,11 @@ struct btrfs_workqueue *btrfs_alloc_work ret->thresh = thresh; }
fs/btrfs/async-thread.c struct btrfs_workqueue *btrfs_alloc_work · line 109
Quoted 10 lines
fs/btrfs/async-thread.c +5
-2- ret->normal_wq =alloc_workqueue ("btrfs-%s" , flags, ret->current_active, - name); +if (ret->current_active ==1 ) + ret->normal_wq =alloc_ordered_workqueue ("btrfs-%s" , flags, name); +else + ret->normal_wq =alloc_workqueue ("btrfs-%s" , flags, + ret->current_active, name);if (!ret->normal_wq) {kfree (ret);return NULL ;
by test, I noticed some warning caused by
void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)
if (WARN_ON(wq->flags & __WQ_ORDERED_EXPLICIT)) return;
so I tested again with the flowing fix
fs/btrfs/async-thread.c +6 -3
@@ -99,8 +99,11 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info, ret->thresh = thresh; } - ret->normal_wq =alloc_workqueue ("btrfs-%s" , flags, ret->current_active, - name); +if (limit_active ==1 ) + ret->normal_wq =alloc_ordered_workqueue ("btrfs-%s" , flags, name); +else + ret->normal_wq =alloc_workqueue ("btrfs-%s" , flags, + ret->current_active, name);if (!ret->normal_wq) {kfree (ret);return NULL ;
@@ -139,7 +139,7 @@ static inline void thresh_exec_hook(struct btrfs_workqueue *wq)long pending;int need_change =0 ; -if (wq->thresh ==NO_THRESHOLD ) +if (wq->thresh ==NO_THRESHOLD || wq->limit_active ==1 )return ;atomic_dec (&wq->pending);
we need 'limit_active' at 2nd postition, so I used 'limit_active' and 1st postition too.
Best Regards
Wang Yugui ([email protected])
2023/05/06
Quoted 26 lines
fs/btrfs/disk-io.c +1
-1@@ -2218,7 +2218,7 @@ static int btrfs_init_workqueues(struct fs_info->qgroup_rescan_workers =btrfs_alloc_workqueue (fs_info,"qgroup-rescan" , flags,1 ,0 ); fs_info->discard_ctl.discard_workers = -alloc_workqueue ("btrfs_discard" ,WQ_UNBOUND |WQ_FREEZABLE ,1 ); +alloc_ordered_workqueue ("btrfs_discard" ,WQ_FREEZABLE ); if (!(fs_info->workers && fs_info->hipri_workers && fs_info->delalloc_workers && fs_info->flush_workers &&fs/btrfs/scrub.c +4
-2@@ -4245,8 +4245,10 @@ static noinline_for_stack int scrub_workif (refcount_inc_not_zero (&fs_info->scrub_workers_refcnt))return 0 ; - scrub_workers =alloc_workqueue ("btrfs-scrub" , flags, - is_dev_replace ?1 : max_active); +if (is_dev_replace) + scrub_workers =alloc_ordered_workqueue ("btrfs-scrub" , flags); +else + scrub_workers =alloc_workqueue ("btrfs-scrub" , flags, max_active);if (!scrub_workers) goto fail_scrub_workers;
Re: [PATCH 15/22] xen/pvcalls: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 49 lines · Tejun Heo
BACKGROUND
==========When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to
alloc_ordered_workqueue()as necessary.WHAT TO LOOK FOR
================The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)to
alloc_ordered_workqueue(flags, args...)which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress.
If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later.
Quoted 8 lines
As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by Tejun Heo <[email protected]>Cc Juergen Gross <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Oleksandr Tyshchenko <[email protected]>
Juergen
Re: [PATCH] wifi: iwlwifi: Use default @max_active for trans_pcie->rba.alloc_wq
In reply to Tejun HeoQuoted 4 lines · Tejun Heo
trans_pcie->rba.alloc_wqonly hosts a single work item and thus doesn't need explicit concurrency limit. Let's use the default @max_active. This doesn't cost anything and clearly expresses that @max_active doesn't matter.
Quoted 15 lines
Signed-off-by Tejun Heo <[email protected]>Cc Kalle Valo <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>Cc Gregory Greenman <[email protected]>Cc Johannes Berg <[email protected]>Cc Avraham Stern <[email protected]>Cc Kees Cook <[email protected]>Cc Mordechay Goodstein <[email protected]>Cc "Haim, Dreyfuss" <[email protected]>
Sure, that seems fine too.
For whatever that's worth, might better to get Gregory ;-)
johannes
Quoted 12 lines
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1
-1@@ -3577,7 +3577,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(sinit_waitqueue_head (&trans_pcie->imr_waitq); trans_pcie->rba.alloc_wq =alloc_workqueue ("rb_allocator" , -WQ_HIGHPRI |WQ_UNBOUND ,1 ); +WQ_HIGHPRI |WQ_UNBOUND ,0 );if (!trans_pcie->rba.alloc_wq) { ret = -ENOMEM ; goto out_free_trans;
Tejun Heo
maintainerRe: [PATCH v2 16/22] btrfs: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Wang YuguiQuoted 35 lines · Wang Yugui
by test, I noticed some warning caused by
voidworkqueue_set_max_active(struct workqueue_struct *wq, int max_active)if (WARN_ON(wq->flags & __WQ_ORDERED_EXPLICIT)) return;so I tested again with the flowing fix
fs/btrfs/async-thread.c +6
-3@@ -99,8 +99,11 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info, ret->thresh = thresh; } - ret->normal_wq =alloc_workqueue ("btrfs-%s" , flags, ret->current_active, - name); +if (limit_active ==1 ) + ret->normal_wq =alloc_ordered_workqueue ("btrfs-%s" , flags, name); +else + ret->normal_wq =alloc_workqueue ("btrfs-%s" , flags, + ret->current_active, name);if (!ret->normal_wq) {kfree (ret);return NULL ;@@ -139,7 +139,7 @@ static inline void thresh_exec_hook(struct btrfs_workqueue *wq)long pending;int need_change =0 ; -if (wq->thresh ==NO_THRESHOLD ) +if (wq->thresh ==NO_THRESHOLD || wq->limit_active ==1 )return ;atomic_dec (&wq->pending);
Quoted 2 lines
we need '
limit_active' at 2nd postition, so I used 'limit_active' and 1st postition too.
Oh, that most likely means that these workqueues don't need to and shouldn't be ordered. Will update the patch.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 01/22] powerpc, workqueue: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 02/22] greybus: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 03/22] IB/hfi1: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Dennis DalessandroApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 07/22] net: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 06/22] net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 12/22] scsi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Tejun Heo
maintainerRe: [PATCH 17/22] cifs: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Paulo AlcantaraOn Fri, Apr 21, 2023 at 03:38:57PM -0300, Paulo Alcantara wrote:
...
Quoted 4 lines
Quoted 2 lines
fs/cifs/dfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
6be2ea33a409 ("cifs: avoid potential races when handling multiple dfs tcons") made this patch unnecessary. Dropped.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 13/22] virt: acrn: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 15/22] xen/pvcalls: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Re: [PATCH 09/22] wifi: iwlwifi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoApplied to wq/for-6.5-cleanup-ordered.
Thanks.
Signature · 1 line
tejun
Tejun Heo
maintainerRe: [PATCH 12/22] scsi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 1 line · Tejun Heo
Applied to wq/for-6.5-cleanup-ordered.
Oops, strike that. All scsi core workqueues have WQ_SYSFS set which means that their max_active could be adjusted upwards through sysfs. The shouldn't be ordered workqueues. This only leaves NCR5380 the only remaining conversion candidate; however, that one only uses a single work item, so the better thing to do there is using the default @max_active instead.
I'm dropping this patch and will add a patch for NCR5380 in the next round.
Thanks.
Signature · 1 line
tejun
Tejun Heo
maintainerRe: [PATCH 03/22] IB/hfi1: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 1 line · Tejun Heo
Applied to wq/for-6.5-cleanup-ordered.
This has WQ_SYSFS so can't be an ordered workqueue. Sorry, this is a pattern I missed. Dropped the patch.
Thanks.
Signature · 1 line
tejun
Tejun Heo
maintainerRe: [PATCH 09/22] wifi: iwlwifi: Use alloc_ordered_workqueue() to create ordered workqueues
In reply to Tejun HeoQuoted 1 line · Tejun Heo
Applied to wq/for-6.5-cleanup-ordered.
This notification is on the wrong patch. The updated one w/ 0 @max_active was applied.
Thanks.
Signature · 1 line
tejun
Re: (subset) [PATCHSET wq/for-6.5] workqueue: Ordered workqueue creation cleanup
In reply to Tejun HeoQuoted 15 lines · Tejun Heo
When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with
alloc_ordered_workqueue().However,
alloc_ordered_workqueue()was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by4c16bd327c74("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution,5c0338c68706("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues.
Quoted 1 line
[...]
Applied, thanks!
[14/22] soc: qcom: qmi: Use alloc_ordered_workqueue() to create ordered workqueues
commit: 56310520308ab863030e9baa9a8f63bb31c94e27
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>