Let create*_workqueue() accept a printf-style format string
Subsystems (59)
Bart Van Assche
reviewercover Let create*_workqueue() accept a printf-style format string
Hi Tejun,
A significant amount of kernel code formats the workqueue name before it calls a workqueue creation function. This patch series simplifies such kernel code and modifies the create*_workqueue() macros such that these accept a printf-style format string and argument list.
The approach of this patch series is as follows:
1. Introduce the create*_workqueue2() macros that accept a printf-style format string and argument list.
2. Convert all workqueue creation calls that might pass a name that includes a formatting character from create*_workqueue(name) into create*_workqueue2("%s", name).
3. Convert all workqueue creation code that is preceded by workqueue name formatting code into a create*_workqueue2(fmt, args) call.
4. Convert all create*_workqueue2() calls into create*_workqueue() calls, remove the original create*_workqueue() calls and rename the new create*_workqueue2() macros into create*_workqueue().
Please consider this patch series for the next merge window.
Thanks,
Bart.
Bart Van Assche (53):
workqueue: Introduce the create*_workqueue2() macros
dmaengine: idxd: Switch to create*_workqueue2() drm/amdgpu: Switch to create*_workqueue2()
media: i2c: adv7511: Switch to create*_workqueue2()
media: cobalt: Switch to create*_workqueue2()
media: dm1105: Switch to create*_workqueue2()
misc: bcm_vk: Switch to create*_workqueue2()
net: amd-xgbe: Switch to create*_workqueue2()
net: atlantic: Switch to create*_workqueue2()
net: mvpp2: Switch to create*_workqueue2()
remoteproc: stm32: Switch to create*_workqueue2() mm/z3fold: Switch to create*_workqueue2()
usb: typec: tcpm: Switch to create*_workqueue2() net/qla3xxx: Switch to create*_workqueue2()
sfc: Switch to create*_workqueue2()
wifi: zd1211rw: Switch to create*_workqueue2()
power: supply: mt6370: Switch to create*_workqueue2()
remoteproc: imx_rproc: Switch to create*_workqueue2()
scsi: hisi_sas: Switch to create*_workqueue2()
scsi: mpt3sas: Switch to create*_workqueue2() accel/habanalabs: Simplify the workqueue creation calls
crypto: safexcel - Simplify a create*_workqueue() call
pds_core: Simplify a create*_workqueue() call
net: bna: Simplify a create*_workqueue() call net/mlx5: Simplify the create*_workqueue() calls
net: lan966x: Simplify a create*_workqueue() call
net: sparx5: Simplify the create*_workqueue() calls
net: mscc: ocelot: Simplify a create*_workqueue() call
net: qed: Simplify a create*_workqueue() call
net: stmmac: Simplify a create*_workqueue() call
nfc: mrvl: Simplify a create*_workqueue() call
scsi: ibmvscsi_tgt: Simplify a create*_workqueue() call
scsi: libsas: Simplify the create*_workqueue() calls
scsi: mpi3mr: Simplify a create*_workqueue() call
scsi: qedf: Simplify the create*_workqueue() calls
scsi: qedi: Simplify the create*_workqueue() calls
scsi: qla2xxx: Simplify the create*_workqueue() calls
scsi: qla4xxx: Simplify a create*_workqueue() call
scsi: vmw_pvscsi: Simplify a create*_workqueue() call
scsi: myrb: Simplify the create*_workqueue() calls
scsi: myrs: Simplify the create*_workqueue() calls
scsi: stex: Simplify the create*_workqueue() calls
scsi: fcoe: Simplify the create*_workqueue() calls
scsi: snic: Simplify the create*_workqueue() calls
scsi: scsi_transport_fc: Simplify the create*_workqueue() calls
scsi: core: Simplify the alloc_workqueue() calls
serial: max3100: Simplify a create*_workqueue() call
scsi: ufs: Simplify the create*_workqueue() calls
usb: typec: ucsi: Simplify a create*_workqueue() call
cifs: Simplify a create*_workqueue() call
mac802154: Simplify the create*_workqueue() calls
nfc: nci: Simplify the create*_workqueue() calls
workqueue: Rename create*_workqueue2() into create*_workqueue()
drivers/accel/habanalabs/common/device.c | 25 +++++++++---------- drivers/crypto/inside-secure/safexcel.c | 4 +-- drivers/dma/idxd/cdev.c | 2 +- drivers/dma/idxd/init.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 2 +- drivers/media/i2c/adv7511-v4l2.c | 2 +- drivers/media/pci/cobalt/cobalt-driver.c | 2 +- drivers/media/pci/dm1105/dm1105.c | 2 +- drivers/misc/bcm-vk/bcm_vk_dev.c | 2 +- drivers/net/ethernet/amd/pds_core/main.c | 7 ++---- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 4 +-- .../net/ethernet/aquantia/atlantic/aq_main.c | 2 +- drivers/net/ethernet/brocade/bna/bnad.c | 4 +-- drivers/net/ethernet/brocade/bna/bnad.h | 1 - .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 3 ++- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 12 ++------- .../net/ethernet/mellanox/mlx5/core/health.c | 10 ++------ .../mellanox/mlx5/core/sf/vhca_event.c | 5 ++-- .../microchip/lan966x/lan966x_ethtool.c | 7 ++---- .../microchip/sparx5/sparx5_ethtool.c | 6 ++--- .../ethernet/microchip/sparx5/sparx5_main.c | 6 ++--- drivers/net/ethernet/mscc/ocelot_stats.c | 6 ++--- drivers/net/ethernet/qlogic/qed/qed_sriov.c | 9 +++---- drivers/net/ethernet/qlogic/qla3xxx.c | 2 +- drivers/net/ethernet/sfc/efx_common.c | 3 ++- drivers/net/ethernet/sfc/falcon/efx.c | 3 ++- drivers/net/ethernet/sfc/siena/efx_common.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 - .../net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++----- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 2 +- drivers/nfc/nfcmrvl/fw_dnld.c | 8 +++--- drivers/power/supply/mt6370-charger.c | 2 +- drivers/remoteproc/imx_rproc.c | 2 +- drivers/remoteproc/stm32_rproc.c | 2 +- drivers/scsi/fcoe/fcoe_sysfs.c | 7 +----- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +- drivers/scsi/hosts.c | 9 +++---- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 4 +-- drivers/scsi/libsas/sas_init.c | 9 +++---- drivers/scsi/mpi3mr/mpi3mr_fw.c | 4 +-- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +-- drivers/scsi/myrb.c | 5 ++-- drivers/scsi/myrb.h | 1 - drivers/scsi/myrs.c | 5 ++-- drivers/scsi/myrs.h | 1 - drivers/scsi/qedf/qedf_main.c | 17 +++++-------- drivers/scsi/qedi/qedi_main.c | 8 +++--- drivers/scsi/qla2xxx/qla_os.c | 10 ++++---- drivers/scsi/qla4xxx/ql4_os.c | 5 ++-- drivers/scsi/scsi_transport_fc.c | 4 +-- drivers/scsi/snic/snic_main.c | 5 ++-- drivers/scsi/stex.c | 6 ++--- drivers/scsi/vmw_pvscsi.c | 8 ++---- drivers/tty/serial/max3100.c | 4 +-- drivers/ufs/core/ufshcd.c | 13 +++------- drivers/usb/typec/tcpm/fusb302.c | 2 +- drivers/usb/typec/ucsi/ucsi.c | 9 ++----- fs/smb/client/smbdirect.c | 3 +-- include/linux/mlx5/driver.h | 5 ---- include/linux/workqueue.h | 15 +++++------ include/scsi/fcoe_sysfs.h | 1 - include/scsi/scsi_host.h | 1 - include/scsi/scsi_transport_fc.h | 3 --- mm/z3fold.c | 4 +-- net/mac802154/main.c | 7 +++--- net/nfc/nci/core.c | 13 +++++----- 66 files changed, 135 insertions(+), 223 deletions(-)
Bart Van Assche
reviewerPATCH 1/53 workqueue: Introduce the create*_workqueue2() macros
A common pattern in the Linux kernel is that sprintf(), snprintf() or kasprintf() is used to format the workqueue name that is passed to create_workqueue(), create_freezable_workqueue() or create_singlethread_workqueue(). Prepare for simplifying such code by introducing the create*_workqueue2() macros that accept a printf-style format string and argument list. A later patch will remove the create*_workqueue() macros and will rename the create*_workqueue2() macros into create*_workqueue().
--- include/linux/workqueue.h | 9 +++++++++ 1 file changed, 9 insertions(+)
include/linux/workqueue.h +9 -0
@@ -525,11 +525,20 @@ alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...);#define create_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name)) +#define create_workqueue2(fmt, args...) \ + alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, 1, ##args)#define create_freezable_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ WQ_MEM_RECLAIM, 1, (name)) +#define create_freezable_workqueue2(fmt, args...) \ + alloc_workqueue( \ + fmt, __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, \ + 1, ##args)#define create_singlethread_workqueue (name) \ alloc_ordered_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, name) +#define create_singlethread_workqueue2(fmt, args...) \ + alloc_ordered_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, ##args) +#define from_work (var, callback_work, work_fieldname) \ container_of(callback_work, typeof(*var), work_fieldname)
Lai Jiangshan
reviewerRe: [PATCH 01/53] workqueue: Introduce the create*_workqueue2() macros
Hello
include/linux/workqueue.h alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...); · line 532
Quoted 11 lines · Bart Van Assche
include/linux/workqueue.h +2
-0@@ -525,11 +525,20 @@ alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...);#define create_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name)) +#define create_workqueue2(fmt, args...) \ + alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, 1, ##args)#define create_freezable_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ WQ_MEM_RECLAIM, 1, (name))
Is there any possible preprocessor hack to avoid the renaming of the functions?
Thanks
Lai
Bart Van Assche
reviewerRe: [PATCH 01/53] workqueue: Introduce the create*_workqueue2() macros
Quoted 6 lines · Lai Jiangshan
Quoted 4 lines · Bart Van Assche
include/linux/workqueue.h +0
-0@@ -525,11 +525,20 @@ alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...);
Quoted 9 lines
include/linux/workqueue.h alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...); · line 532
Quoted 7 lines
include/linux/workqueue.h +2
-0#define create_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name)) +#define create_workqueue2(fmt, args...) \ + alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, 1, ##args)#define create_freezable_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ WQ_MEM_RECLAIM, 1, (name))Is there any possible preprocessor hack to avoid the renaming of the functions?
Thanks Lai for having taken a look. As one can see here the last patch of this patch series renames create_workqueue2() back to create_workqueue(): https://lore.kernel.org/linux-kernel/[email protected]/
Bart.
Re: [PATCH 01/53] workqueue: Introduce the create*_workqueue2() macros
Quoted 17 lines · Bart Van Assche
Quoted 6 lines · Lai Jiangshan
Quoted 4 lines · Bart Van Assche
include/linux/workqueue.h +0
-0@@ -525,11 +525,20 @@ alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...);Quoted 9 lines
include/linux/workqueue.h alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...); · line 532
Quoted 7 lines
include/linux/workqueue.h +2
-0#define create_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name)) +#define create_workqueue2(fmt, args...) \ + alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, 1, ##args)#define create_freezable_workqueue (name) \ alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ WQ_MEM_RECLAIM, 1, (name))Is there any possible preprocessor hack to avoid the renaming of the functions?
Quoted 2 lines
Thanks Lai for having taken a look. As one can see here the last patch of
this patch series renamescreate_workqueue2()back tocreate_workqueue(): https://lore.kernel.org/linux-kernel/[email protected]/
This can be done with the preprocessor to detect how many arguments are being used, so then there is no need to do the renaming passes and conversions can land via subsystems:
include/linux/workqueue.h +18 -7
@@ -523,13 +523,24 @@ alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...); #define alloc_ordered_workqueue(fmt, flags, 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)) -#define create_freezable_workqueue (name) \ - alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ - WQ_MEM_RECLAIM, 1, (name)) -#define create_singlethread_workqueue (name) \ - alloc_ordered_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, name) +#define __has_one_arg(args...) __is_defined(COUNT_ARGS(args)) + +#define __create_workqueue1 (flags, name) \ + alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM | (flags), \ + 1, name) +#define __create_workqueue0(flags, fmt, args...) \ + alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM | (flags), \ + 1, args) + +#define create_workqueue(args...) \ + CONCATENATE(__create_workqueue, __has_one_arg(args))\ + (0, args) +#define create_freezeable_workqueue(args...) \ + CONCATENATE(__create_workqueue, __has_one_arg(args))\ + (WQ_UNBOUND | WQ_FREEZABLE, args) +#define create_singlethread_workqueue(args...) \ + CONCATENATE(__create_workqueue, __has_one_arg(args))\ + (WQ_UNBOUND | __WQ_ORDERED, args)#define from_work (var, callback_work, work_fieldname) \ container_of(callback_work, typeof(*var), work_fieldname)
Now conversions are one step, e.g.:
fs/smb/client/smbdirect.c +1 -2
@@ -1458,8 +1458,7 @@ static int allocate_caches_and_workqueue(struct smbd_connection *info)if (!info->response_mempool) goto out3; -scnprintf (name,MAX_NAME_LEN ,"smbd_%p" , info); - info->workqueue =create_workqueue (name); + info->workqueue =create_workqueue ("smbd_%p" , info);if (!info->workqueue) goto out4;
Signature · 1 line
Kees Cook
Bart Van Assche
reviewerRe: [PATCH 01/53] workqueue: Introduce the create*_workqueue2() macros
Quoted 3 lines · Kees Cook
This can be done with the preprocessor to detect how many arguments are being used, so then there is no need to do the renaming passes and conversions can land via subsystems:
Thanks Kees, this is very useful feedback.
As one can see here, Tejun requested not to add support for a format string in the create*_workqueue() macros:
https://lore.kernel.org/linux-kernel/[email protected]/
Hence a different approach for the SCSI create*_workqueue() macros:
https://lore.kernel.org/linux-scsi/[email protected]/
Best regards,
Bart.
Re: [PATCH 01/53] workqueue: Introduce the create*_workqueue2() macros
Quoted 10 lines · Bart Van Assche
Quoted 3 lines · Kees Cook
This can be done with the preprocessor to detect how many arguments are being used, so then there is no need to do the renaming passes and conversions can land via subsystems:
Thanks Kees, this is very useful feedback.
As one can see here, Tejun requested not to add support for a format string in the create*_workqueue() macros:
https://lore.kernel.org/linux-kernel/[email protected]/
Ah! I should have read the thread more fully. :)
Quoted 2 lines
Hence a different approach for the SCSI create*_workqueue() macros:
https://lore.kernel.org/linux-scsi/[email protected]/
Gotcha. Okay, well, that's a lot of flags to open-code, but I guess that's fine? :P
Signature · 1 line
Kees Cook
Tejun Heo
maintainerRe: [PATCH 01/53] workqueue: Introduce the create*_workqueue2() macros
Hello,
Quoted 5 lines · Kees Cook
Quoted 2 lines
Hence a different approach for the SCSI create*_workqueue() macros:
https://lore.kernel.org/linux-scsi/[email protected]/Gotcha. Okay, well, that's a lot of flags to open-code, but I guess that's fine? :P
The flag in question is WQ_MEM_RECLAIM and that flag has a direct cost of creating a dedicated kthread which mostly sits idle, so we want it to be explicit. In SCSI, the naive expansion is likely to be correct for most cases.
It's a bit tricky in that the failure mode of incorrectly missing the flag is critical (system deadlock under memory pressure) but can be difficult to trigger and the depencency chain may not be immediately evident when looking at the code. The upsides are that when it happens, it's usually not too difficult to tell from the backtraces and lockdep annotation sometimes helps with finding missing cases (which is suppressed when using the old interface because it's unclear whether MEM_RECLAIM is there intentionally or not).
Anyways, yeah, we want it to be explicit.
Thanks.
Signature · 1 line
tejun
Bart Van Assche
reviewerPATCH 2/53 dmaengine: idxd: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/dma/idxd/cdev.c | 2 +- drivers/dma/idxd/init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/dma/idxd/cdev.c +1 -1
@@ -619,7 +619,7 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev) goto wq_err; } - wq->wq =create_workqueue (dev_name (wq_confdev (wq))); + wq->wq =create_workqueue2 ("%s" ,dev_name (wq_confdev (wq)));if (!wq->wq) { rc = -ENOMEM ; goto wq_err;
drivers/dma/idxd/init.c +1 -1
@@ -397,7 +397,7 @@ static int idxd_setup_internals(struct idxd_device *idxd)if (rc <0 ) goto err_group; - idxd->wq =create_workqueue (dev_name (dev)); + idxd->wq =create_workqueue2 ("%s" ,dev_name (dev));if (!idxd->wq) { rc = -ENOMEM ; goto err_wkq_create;
Bart Van Assche
reviewerPATCH 3/53 drm/amdgpu: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c +1 -1
@@ -131,7 +131,7 @@ struct amdgpu_reset_domain *amdgpu_reset_create_reset_domain(enum amdgpu_reset_d reset_domain->type = type;kref_init (&reset_domain->refcount); - reset_domain->wq =create_singlethread_workqueue (wq_name); + reset_domain->wq =create_singlethread_workqueue2 ("%s" , wq_name);if (!reset_domain->wq) {DRM_ERROR ("Failed to allocate wq for amdgpu_reset_domain!" );amdgpu_reset_put_reset_domain (reset_domain);
Bart Van Assche
reviewerPATCH 4/53 media: i2c: adv7511: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/media/i2c/adv7511-v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/adv7511-v4l2.c +1 -1
@@ -1885,7 +1885,7 @@ static int adv7511_probe(struct i2c_client *client) goto err_unreg_cec; } - state->work_queue =create_singlethread_workqueue (sd->name); + state->work_queue =create_singlethread_workqueue2 ("%s" , sd->name);if (state->work_queue ==NULL ) {v4l2_err (sd,"could not create workqueue\n" ); err = -ENOMEM ;
Bart Van Assche
reviewerPATCH 5/53 media: cobalt: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/media/pci/cobalt/cobalt-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/cobalt/cobalt-driver.c +1 -1
@@ -683,7 +683,7 @@ static int cobalt_probe(struct pci_dev *pci_dev,cobalt_info ("Initializing card %d\n" , cobalt->instance); cobalt->irq_work_queues = -create_singlethread_workqueue (cobalt->v4l2_dev.name); +create_singlethread_workqueue2 ("%s" , cobalt->v4l2_dev.name);if (cobalt->irq_work_queues ==NULL ) {cobalt_err ("Could not create workqueue\n" ); retval = -ENOMEM ;
Bart Van Assche
reviewerPATCH 6/53 media: dm1105: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/media/pci/dm1105/dm1105.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/dm1105/dm1105.c +1 -1
@@ -1123,7 +1123,7 @@ static int dm1105_probe(struct pci_dev *pdev,INIT_WORK (&dev->work, dm1105_dmx_buffer);sprintf (dev->wqn,"%s/%d" , dvb_adapter->name, dvb_adapter->num); - dev->wq =create_singlethread_workqueue (dev->wqn); + dev->wq =create_singlethread_workqueue2 ("%s" , dev->wqn);if (!dev->wq) { ret = -ENOMEM ; goto err_dvb_net;
Bart Van Assche
reviewerPATCH 7/53 misc: bcm_vk: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/misc/bcm-vk/bcm_vk_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/bcm-vk/bcm_vk_dev.c +1 -1
@@ -1428,7 +1428,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_WORK (&vk->wq_work, bcm_vk_wq_handler);/* create dedicated workqueue */ - vk->wq_thread =create_singlethread_workqueue (name); + vk->wq_thread =create_singlethread_workqueue2 ("%s" , name);if (!vk->wq_thread) {dev_err (dev,"Fail to create workqueue thread\n" ); err = -ENOMEM ;
Bart Van Assche
reviewerPATCH 8/53 net: amd-xgbe: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +2 -2
@@ -1846,14 +1846,14 @@ static int xgbe_open(struct net_device *netdev)/* Create workqueues */ pdata->dev_workqueue = -create_singlethread_workqueue (netdev_name (netdev)); +create_singlethread_workqueue2 ("%s" ,netdev_name (netdev));if (!pdata->dev_workqueue) {netdev_err (netdev,"device workqueue creation failed\n" );return -ENOMEM ; } pdata->an_workqueue = -create_singlethread_workqueue (pdata->an_name); +create_singlethread_workqueue2 ("%s" , pdata->an_name);if (!pdata->an_workqueue) {netdev_err (netdev,"phy workqueue creation failed\n" ); ret = -ENOMEM ;
Bart Van Assche
reviewerPATCH 9/53 net: atlantic: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/aq_main.c +1 -1
@@ -513,7 +513,7 @@ static int __init aq_ndev_init_module(void) {int ret; - aq_ndev_wq =create_singlethread_workqueue (aq_ndev_driver_name); + aq_ndev_wq =create_singlethread_workqueue2 ("%s" , aq_ndev_driver_name);if (!aq_ndev_wq) {pr_err ("Failed to create workqueue\n" );return -ENOMEM ;
Bart Van Assche
reviewerPATCH 10/53 net: mvpp2: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +2 -1
@@ -7635,7 +7635,8 @@ static int mvpp2_probe(struct platform_device *pdev)snprintf (priv->queue_name,sizeof (priv->queue_name),"stats-wq-%s%s" ,netdev_name (priv->port_list[0 ]->dev), priv->port_count >1 ?"+" :"" ); - priv->stats_queue =create_singlethread_workqueue (priv->queue_name); + priv->stats_queue = +create_singlethread_workqueue2 ("%s" , priv->queue_name);if (!priv->stats_queue) { err = -ENOMEM ; goto err_port_probe;
Bart Van Assche
reviewerPATCH 11/53 remoteproc: stm32: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/remoteproc/stm32_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/stm32_rproc.c +1 -1
@@ -867,7 +867,7 @@ static int stm32_rproc_probe(struct platform_device *pdev) rproc->state =RPROC_DETACHED ; rproc->has_iommu = false; - ddata->workqueue =create_workqueue (dev_name (dev)); + ddata->workqueue =create_workqueue2 ("%s" ,dev_name (dev));if (!ddata->workqueue) {dev_err (dev,"cannot create workqueue\n" ); ret = -ENOMEM ;
Bart Van Assche
reviewerPATCH 12/53 mm/z3fold: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- mm/z3fold.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/z3fold.c +2 -2
@@ -934,10 +934,10 @@ static struct z3fold_pool *z3fold_create_pool(const char *name, gfp_t gfp)INIT_LIST_HEAD (&pool->stale);atomic64_set (&pool->pages_nr,0 ); pool->name = name; - pool->compact_wq =create_singlethread_workqueue (pool->name); + pool->compact_wq =create_singlethread_workqueue2 ("%s" , pool->name);if (!pool->compact_wq) goto out_unbuddied; - pool->release_wq =create_singlethread_workqueue (pool->name); + pool->release_wq =create_singlethread_workqueue2 ("%s" , pool->name);if (!pool->release_wq) goto out_wq;INIT_WORK (&pool->work, free_pages_work);
Bart Van Assche
reviewerPATCH 13/53 usb: typec: tcpm: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/usb/typec/tcpm/fusb302.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/fusb302.c +1 -1
@@ -1715,7 +1715,7 @@ static int fusb302_probe(struct i2c_client *client)if (IS_ERR (chip->vbus))return PTR_ERR (chip->vbus); - chip->wq =create_singlethread_workqueue (dev_name (chip->dev)); + chip->wq =create_singlethread_workqueue2 ("%s" ,dev_name (chip->dev));if (!chip->wq)return -ENOMEM ;
Bart Van Assche
reviewerPATCH 14/53 net/qla3xxx: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/net/ethernet/qlogic/qla3xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qla3xxx.c +1 -1
@@ -3862,7 +3862,7 @@ static int ql3xxx_probe(struct pci_dev *pdev,netif_carrier_off (ndev);netif_stop_queue (ndev); - qdev->workqueue =create_singlethread_workqueue (ndev->name); + qdev->workqueue =create_singlethread_workqueue2 ("%s" , ndev->name);if (!qdev->workqueue) {unregister_netdev (ndev); err = -ENOMEM ;
Bart Van Assche
reviewerPATCH 15/53 sfc: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/net/ethernet/sfc/efx_common.c | 3 ++- drivers/net/ethernet/sfc/falcon/efx.c | 3 ++- drivers/net/ethernet/sfc/siena/efx_common.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/sfc/efx_common.c +2 -1
@@ -1035,7 +1035,8 @@ int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev)/* Would be good to use the net_dev name, but we're too early */ snprintf (efx->workqueue_name,sizeof (efx->workqueue_name),"sfc%s" ,pci_name (pci_dev)); - efx->workqueue =create_singlethread_workqueue (efx->workqueue_name); + efx->workqueue = +create_singlethread_workqueue2 ("%s" , efx->workqueue_name);if (!efx->workqueue) { rc = -ENOMEM ; goto fail;
drivers/net/ethernet/sfc/falcon/efx.c +2 -1
@@ -2671,7 +2671,8 @@ static int ef4_init_struct(struct ef4_nic *efx,/* Would be good to use the net_dev name, but we're too early */ snprintf (efx->workqueue_name,sizeof (efx->workqueue_name),"sfc%s" ,pci_name (pci_dev)); - efx->workqueue =create_singlethread_workqueue (efx->workqueue_name); + efx->workqueue = +create_singlethread_workqueue2 ("%s" , efx->workqueue_name);if (!efx->workqueue) goto fail;
drivers/net/ethernet/sfc/siena/efx_common.c +2 -1
@@ -1050,7 +1050,8 @@ int efx_siena_init_struct(struct efx_nic *efx,/* Would be good to use the net_dev name, but we're too early */ snprintf (efx->workqueue_name,sizeof (efx->workqueue_name),"sfc%s" ,pci_name (pci_dev)); - efx->workqueue =create_singlethread_workqueue (efx->workqueue_name); + efx->workqueue = +create_singlethread_workqueue2 ("%s" , efx->workqueue_name);if (!efx->workqueue) { rc = -ENOMEM ; goto fail;
Bart Van Assche
reviewerPATCH 16/53 wifi: zd1211rw: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/zydas/zd1211rw/zd_usb.c +1 -1
@@ -1542,7 +1542,7 @@ static int __init usb_init(void)pr_debug ("%s usb_init()\n" , driver.name); - zd_workqueue =create_singlethread_workqueue (driver.name); + zd_workqueue =create_singlethread_workqueue2 ("%s" , driver.name);if (zd_workqueue ==NULL ) {pr_err ("%s couldn't create workqueue\n" , driver.name);return -ENOMEM ;
Bart Van Assche
reviewerPATCH 17/53 power: supply: mt6370: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/power/supply/mt6370-charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/mt6370-charger.c +1 -1
@@ -908,7 +908,7 @@ static int mt6370_chg_probe(struct platform_device *pdev) priv->attach =MT6370_ATTACH_STAT_DETACH ; - priv->wq =create_singlethread_workqueue (dev_name (priv->dev)); + priv->wq =create_singlethread_workqueue2 ("%s" ,dev_name (priv->dev));if (!priv->wq)return dev_err_probe (dev, -ENOMEM ,"Failed to create workqueue\n" );
Bart Van Assche
reviewerPATCH 18/53 remoteproc: imx_rproc: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/imx_rproc.c +1 -1
@@ -1064,7 +1064,7 @@ static int imx_rproc_probe(struct platform_device *pdev) priv->dev = dev;dev_set_drvdata (dev, rproc); - priv->workqueue =create_workqueue (dev_name (dev)); + priv->workqueue =create_workqueue ("%s" ,dev_name (dev));if (!priv->workqueue) {dev_err (dev,"cannot create workqueue\n" );return -ENOMEM ;
Bart Van Assche
reviewerPATCH 19/53 scsi: hisi_sas: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/hisi_sas/hisi_sas_main.c +1 -1
@@ -2302,7 +2302,7 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) hisi_hba->last_slot_index =0 ; - hisi_hba->wq =create_singlethread_workqueue (dev_name (dev)); + hisi_hba->wq =create_singlethread_workqueue2 ("%s" ,dev_name (dev));if (!hisi_hba->wq) {dev_err (dev,"sas_alloc: failed to create workqueue\n" ); goto err_out;
Bart Van Assche
reviewerPATCH 20/53 scsi: mpt3sas: Switch to create*_workqueue2()
In reply to Bart Van AsschePrepare for removal of the create*_workqueue() macros.
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +2 -2
@@ -846,8 +846,8 @@ mpt3sas_base_start_watchdog(struct MPT3SAS_ADAPTER *ioc)snprintf (ioc->fault_reset_work_q_name,sizeof (ioc->fault_reset_work_q_name),"poll_%s%d_status" , ioc->driver_name, ioc->id); - ioc->fault_reset_work_q = -create_singlethread_workqueue (ioc->fault_reset_work_q_name); + ioc->fault_reset_work_q =create_singlethread_workqueue2 ( +"%s" , ioc->fault_reset_work_q_name);if (!ioc->fault_reset_work_q) {ioc_err (ioc,"%s: failed (line=%d)\n" , __func__, __LINE__);return ;
Bart Van Assche
reviewerPATCH 21/53 accel/habanalabs: Simplify the workqueue creation calls
In reply to Bart Van AsschePass a format string to the workqueue creation calls instead of formatting the workqueue name before a workqueue creation macro is used.
--- drivers/accel/habanalabs/common/device.c | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-)
drivers/accel/habanalabs/common/device.c +12 -13
@@ -831,7 +831,6 @@ static void device_release_watchdog_func(struct work_struct *work)static int device_early_init (struct hl_device *hdev) {int i, rc; -char workq_name[32 ];switch (hdev->asic_type) {case ASIC_GOYA :
@@ -883,8 +882,8 @@ static int device_early_init(struct hl_device *hdev) }for (i =0 ; i < hdev->asic_prop.completion_queues_count ; i++) { -snprintf (workq_name,32 ,"hl%u-free-jobs-%u" , hdev->cdev_idx, (u32 ) i); - hdev->cq_wq[i] =create_singlethread_workqueue (workq_name); + hdev->cq_wq[i] =create_singlethread_workqueue2 ( +"hl%u-free-jobs-%u" , hdev->cdev_idx, i);if (hdev->cq_wq[i] ==NULL ) {dev_err (hdev->dev,"Failed to allocate CQ workqueue\n" ); rc = -ENOMEM ;
@@ -892,16 +891,16 @@ static int device_early_init(struct hl_device *hdev) } } -snprintf (workq_name,32 ,"hl%u-events" , hdev->cdev_idx); - hdev->eq_wq =create_singlethread_workqueue (workq_name); + hdev->eq_wq = +create_singlethread_workqueue2 ("hl%u-events" , hdev->cdev_idx);if (hdev->eq_wq ==NULL ) {dev_err (hdev->dev,"Failed to allocate EQ workqueue\n" ); rc = -ENOMEM ; goto free_cq_wq; } -snprintf (workq_name,32 ,"hl%u-cs-completions" , hdev->cdev_idx); - hdev->cs_cmplt_wq =alloc_workqueue (workq_name,WQ_UNBOUND ,0 ); + hdev->cs_cmplt_wq =alloc_workqueue ("hl%u-cs-completions" ,WQ_UNBOUND , +0 , hdev->cdev_idx);if (!hdev->cs_cmplt_wq) {dev_err (hdev->dev,"Failed to allocate CS completions workqueue\n" );
@@ -909,8 +908,8 @@ static int device_early_init(struct hl_device *hdev) goto free_eq_wq; } -snprintf (workq_name,32 ,"hl%u-ts-free-obj" , hdev->cdev_idx); - hdev->ts_free_obj_wq =alloc_workqueue (workq_name,WQ_UNBOUND ,0 ); + hdev->ts_free_obj_wq =alloc_workqueue ("hl%u-ts-free-obj" ,WQ_UNBOUND , +0 , hdev->cdev_idx);if (!hdev->ts_free_obj_wq) {dev_err (hdev->dev,"Failed to allocate Timestamp registration free workqueue\n" );
@@ -918,8 +917,8 @@ static int device_early_init(struct hl_device *hdev) goto free_cs_cmplt_wq; } -snprintf (workq_name,32 ,"hl%u-prefetch" , hdev->cdev_idx); - hdev->prefetch_wq =alloc_workqueue (workq_name,WQ_UNBOUND ,0 ); + hdev->prefetch_wq = +alloc_workqueue ("hl%u-prefetch" ,WQ_UNBOUND ,0 , hdev->cdev_idx);if (!hdev->prefetch_wq) {dev_err (hdev->dev,"Failed to allocate MMU prefetch workqueue\n" ); rc = -ENOMEM ;
@@ -938,8 +937,8 @@ static int device_early_init(struct hl_device *hdev)hl_mem_mgr_init (hdev->dev, &hdev->kernel_mem_mgr); -snprintf (workq_name,32 ,"hl%u_device_reset" , hdev->cdev_idx); - hdev->reset_wq =create_singlethread_workqueue (workq_name); + hdev->reset_wq =create_singlethread_workqueue2 ("hl%u_device_reset" , + hdev->cdev_idx);if (!hdev->reset_wq) { rc = -ENOMEM ;dev_err (hdev->dev,"Failed to create device reset WQ\n" );
Bart Van Assche
reviewerPATCH 22/53 crypto: safexcel - Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/crypto/inside-secure/safexcel.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/crypto/inside-secure/safexcel.c +1 -3
@@ -1615,7 +1615,6 @@ static int safexcel_probe_generic(void *pdev,return -ENOMEM ;for (i =0 ; i < priv->config.rings; i++) { -char wq_name[9 ] = {0 };int irq;struct safexcel_ring_irq_data *ring_irq;
@@ -1664,9 +1663,8 @@ static int safexcel_probe_generic(void *pdev,INIT_WORK (&priv->ring[i].work_data.work, safexcel_dequeue_work); -snprintf (wq_name,9 ,"wq_ring%d" , i); priv->ring[i].workqueue = -create_singlethread_workqueue (wq_name); +create_singlethread_workqueue2 ("wq_ring%d" , i);if (!priv->ring[i].workqueue) { ret = -ENOMEM ; goto err_cleanup_rings;
Bart Van Assche
reviewerPATCH 23/53 pds_core: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/net/ethernet/amd/pds_core/main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/ethernet/amd/pds_core/main.c +2 -5
@@ -213,12 +213,9 @@ static const struct devlink_param pdsc_dl_params[] = { pdsc_dl_enable_validate), }; -#define PDSC_WQ_NAME_LEN 24 -static int pdsc_init_pf (struct pdsc *pdsc) {struct devlink_health_reporter *hr; -char wq_name[PDSC_WQ_NAME_LEN ];struct devlink *dl;int err;
@@ -236,8 +233,8 @@ static int pdsc_init_pf(struct pdsc *pdsc) goto err_out_release_regions;/* General workqueue and timer, but don't start timer yet */ -snprintf (wq_name,sizeof (wq_name),"%s.%d" ,PDS_CORE_DRV_NAME , pdsc->uid); - pdsc->wq =create_singlethread_workqueue (wq_name); + pdsc->wq =create_singlethread_workqueue2 ("%s.%d" ,PDS_CORE_DRV_NAME , + pdsc->uid);INIT_WORK (&pdsc->health_work, pdsc_health_thread);INIT_WORK (&pdsc->pci_reset_work, pdsc_pci_reset_thread);timer_setup (&pdsc->wdtimer, pdsc_wdtimer_cb,0 );
Re: [PATCH 23/53] pds_core: Simplify a create*_workqueue() call
Quoted 29 lines · Bart Van Assche
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Pass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
Signed-off-by Bart Van Assche <[email protected]>--- drivers/net/ethernet/amd/pds_core/main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)drivers/net/ethernet/amd/pds_core/main.c +0
-3@@ -213,12 +213,9 @@ static const struct devlink_param pdsc_dl_params[] = { pdsc_dl_enable_validate), }; -#define PDSC_WQ_NAME_LEN 24 -static int pdsc_init_pf (struct pdsc *pdsc) {struct devlink_health_reporter *hr; -char wq_name[PDSC_WQ_NAME_LEN ];struct devlink *dl;int err;
drivers/net/ethernet/amd/pds_core/main.c static int pdsc_init_pf(struct pdsc *pdsc) · line 237
Quoted 7 lines
drivers/net/ethernet/amd/pds_core/main.c +2
-2@@ -236,8 +233,8 @@ static int pdsc_init_pf(struct pdsc *pdsc) goto err_out_release_regions;/* General workqueue and timer, but don't start timer yet */ -snprintf (wq_name,sizeof (wq_name),"%s.%d" ,PDS_CORE_DRV_NAME , pdsc->uid); - pdsc->wq =create_singlethread_workqueue (wq_name); + pdsc->wq =create_singlethread_workqueue2 ("%s.%d" ,PDS_CORE_DRV_NAME , + pdsc->uid);
LGTM. Thanks.
BTW, I don't actually see patch 53/53 that renames *workqueue2() -> *workqueue(). Am I missing something here? It's mentioned in the cover letter, but I don't see it on the series thread.
Brett
Quoted 3 lines
drivers/net/ethernet/amd/pds_core/main.c +0
-0INIT_WORK (&pdsc->health_work, pdsc_health_thread);INIT_WORK (&pdsc->pci_reset_work, pdsc_pci_reset_thread);timer_setup (&pdsc->wdtimer, pdsc_wdtimer_cb,0 );
Bart Van Assche
reviewerRe: [PATCH 23/53] pds_core: Simplify a create*_workqueue() call
Quoted 7 lines · Brett Creeley
LGTM. Thanks.
Reviewed-by Brett Creeley <[email protected]>BTW, I don't actually see patch 53/53 that renames
*workqueue2()->*workqueue(). Am I missing something here? It's mentioned in the cover letter, but I don't see it on the series thread.
Hi Brett,
I don't see patch 53/53 either on Lore. Maybe I hit an outgoing mail limit when I sent out this patch series.
Note: as one can see from Tejun's reply to the cover letter I will have to rework this patch series so I'm not sure whether it's useful that I make patch 53/53 available now.
Thanks,
Bart.
Bart Van Assche
reviewerPATCH 24/53 net: bna: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/net/ethernet/brocade/bna/bnad.c | 4 ++-- drivers/net/ethernet/brocade/bna/bnad.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/brocade/bna/bnad.c +2 -2
@@ -3488,8 +3488,8 @@ bnad_init(struct bnad *bnad, bnad->tx_coalescing_timeo =BFI_TX_COALESCING_TIMEO ; bnad->rx_coalescing_timeo =BFI_RX_COALESCING_TIMEO ; -sprintf (bnad->wq_name,"%s_wq_%d" ,BNAD_NAME , bnad->id); - bnad->work_q =create_singlethread_workqueue (bnad->wq_name); + bnad->work_q = +create_singlethread_workqueue2 ("%s_wq_%d" ,BNAD_NAME , bnad->id);if (!bnad->work_q) {iounmap (bnad->bar0);return -ENOMEM ;
drivers/net/ethernet/brocade/bna/bnad.h +0 -1
@@ -346,7 +346,6 @@ struct bnad {char adapter_name[BNAD_NAME_LEN ];char port_name[BNAD_NAME_LEN ];char mbox_irq_name[BNAD_NAME_LEN ]; -char wq_name[BNAD_NAME_LEN ];/* debugfs specific data */ char *regdata;
Bart Van Assche
reviewerPATCH 25/53 net/mlx5: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 12 ++---------- drivers/net/ethernet/mellanox/mlx5/core/health.c | 10 ++-------- .../net/ethernet/mellanox/mlx5/core/sf/vhca_event.c | 5 ++--- include/linux/mlx5/driver.h | 5 ----- 4 files changed, 6 insertions(+), 26 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +2 -10
@@ -1560,14 +1560,6 @@ static const struct file_operations olfops = { .read = outlen_read, }; -static void set_wqname (struct mlx5_core_dev *dev) -{ -struct mlx5_cmd *cmd = &dev->cmd; - -snprintf (cmd->wq_name,sizeof (cmd->wq_name),"mlx5_cmd_%s" , -dev_name (dev->device)); -} -static void clean_debug_files (struct mlx5_core_dev *dev) {struct mlx5_cmd_debug *dbg = &dev->cmd.dbg;
@@ -2292,8 +2284,8 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)spin_lock_init (&cmd->alloc_lock);spin_lock_init (&cmd->token_lock); -set_wqname (dev); - cmd->wq =create_singlethread_workqueue (cmd->wq_name); + cmd->wq =create_singlethread_workqueue2 ("mlx5_cmd_%s" , +dev_name (dev->device));if (!cmd->wq) {mlx5_core_err (dev,"failed to create command workqueue\n" );return -ENOMEM ;
drivers/net/ethernet/mellanox/mlx5/core/health.c +2 -8
@@ -869,7 +869,6 @@ int mlx5_health_init(struct mlx5_core_dev *dev) {struct devlink *devlink =priv_to_devlink (dev);struct mlx5_core_health *health; -char *name;if (!mlx5_dev_is_lightweight (dev)) {devl_lock (devlink);
@@ -879,14 +878,9 @@ int mlx5_health_init(struct mlx5_core_dev *dev)mlx5_reporter_vnic_create (dev); health = &dev->priv.health; - name =kmalloc (64 ,GFP_KERNEL ); -if (!name) - goto out_err; -strcpy (name,"mlx5_health" ); -strcat (name,dev_name (dev->device)); - health->wq =create_singlethread_workqueue (name); -kfree (name); + health->wq =create_singlethread_workqueue2 ("mlx5_health%s" , +dev_name (dev->device));if (!health->wq) goto out_err;INIT_WORK (&health->fatal_report_work, mlx5_fw_fatal_reporter_err_work);
drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c +2 -3
@@ -148,7 +148,6 @@ void mlx5_vhca_state_cap_handle(struct mlx5_core_dev *dev, void *set_hca_cap)int mlx5_vhca_event_init (struct mlx5_core_dev *dev) {struct mlx5_vhca_state_notifier *notifier; -char wq_name[MLX5_CMD_WQ_MAX_NAME ];struct mlx5_vhca_events *events;int err, i;
@@ -162,8 +161,8 @@ int mlx5_vhca_event_init(struct mlx5_core_dev *dev) events->dev = dev; dev->priv.vhca_events = events;for (i =0 ; i <MLX5_DEV_MAX_WQS ; i++) { -snprintf (wq_name,MLX5_CMD_WQ_MAX_NAME ,"mlx5_vhca_event%d" , i); - events->handler[i].wq =create_singlethread_workqueue (wq_name); + events->handler[i].wq = +create_singlethread_workqueue2 ("mlx5_vhca_event%d" , i);if (!events->handler[i].wq) { err = -ENOMEM ; goto err_create_wq;
include/linux/mlx5/driver.h +0 -5
@@ -66,10 +66,6 @@ enum { MLX5_BOARD_ID_LEN = 64, }; -enum { -MLX5_CMD_WQ_MAX_NAME =32 , -}; -enum {CMD_OWNER_SW =0x0 ,CMD_OWNER_HW =0x1 ,
@@ -317,7 +313,6 @@ struct mlx5_cmd {*/ spinlock_t token_lock;u8 token; -char wq_name[MLX5_CMD_WQ_MAX_NAME ];struct workqueue_struct *wq;int mode;u16 allowed_opcode;
Bart Van Assche
reviewerPATCH 26/53 net: lan966x: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c +2 -5
@@ -701,8 +701,6 @@ void lan966x_stats_get(struct net_device *dev,int lan966x_stats_init (struct lan966x *lan966x) { -char queue_name[32 ]; - lan966x->stats_layout = lan966x_stats_layout; lan966x->num_stats =ARRAY_SIZE (lan966x_stats_layout); lan966x->stats = devm_kcalloc(lan966x->dev, lan966x->num_phys_ports *
@@ -713,9 +711,8 @@ int lan966x_stats_init(struct lan966x *lan966x)/* Init stats worker */ mutex_init (&lan966x->stats_lock); -snprintf (queue_name,sizeof (queue_name),"%s-stats" , -dev_name (lan966x->dev)); - lan966x->stats_queue =create_singlethread_workqueue (queue_name); + lan966x->stats_queue =create_singlethread_workqueue2 ( +"%s-stats" ,dev_name (lan966x->dev));if (!lan966x->stats_queue)return -ENOMEM ;
Bart Van Assche
reviewerPATCH 27/53 net: sparx5: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c | 6 ++---- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c +2 -4
@@ -1231,7 +1231,6 @@ const struct ethtool_ops sparx5_ethtool_ops = {int sparx_stats_init (struct sparx5 *sparx5) { -char queue_name[32 ];int portno; sparx5->stats_layout = sparx5_stats_layout;
@@ -1249,9 +1248,8 @@ int sparx_stats_init(struct sparx5 *sparx5)if (sparx5->ports[portno])sparx5_config_port_stats (sparx5, portno); -snprintf (queue_name,sizeof (queue_name),"%s-stats" , -dev_name (sparx5->dev)); - sparx5->stats_queue =create_singlethread_workqueue (queue_name); + sparx5->stats_queue =create_singlethread_workqueue2 ( +"%s-stats" ,dev_name (sparx5->dev));if (!sparx5->stats_queue)return -ENOMEM ;
drivers/net/ethernet/microchip/sparx5/sparx5_main.c +2 -4
@@ -596,7 +596,6 @@ static void sparx5_board_init(struct sparx5 *sparx5)static int sparx5_start (struct sparx5 *sparx5) {u8 broadcast[ETH_ALEN ] = {0xff ,0xff ,0xff ,0xff ,0xff ,0xff }; -char queue_name[32 ];u32 idx;int err;
@@ -661,9 +660,8 @@ static int sparx5_start(struct sparx5 *sparx5)/* Init mact_sw struct */ mutex_init (&sparx5->mact_lock);INIT_LIST_HEAD (&sparx5->mact_entries); -snprintf (queue_name,sizeof (queue_name),"%s-mact" , -dev_name (sparx5->dev)); - sparx5->mact_queue =create_singlethread_workqueue (queue_name); + sparx5->mact_queue = +create_singlethread_workqueue2 ("%s-mact" ,dev_name (sparx5->dev));if (!sparx5->mact_queue)return -ENOMEM ;
Bart Van Assche
reviewerPATCH 28/53 net: mscc: ocelot: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/net/ethernet/mscc/ocelot_stats.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/mscc/ocelot_stats.c +2 -4
@@ -951,7 +951,6 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot)int ocelot_stats_init (struct ocelot *ocelot) { -char queue_name[32 ];int ret; ocelot->stats = devm_kcalloc(ocelot->dev,
@@ -960,9 +959,8 @@ int ocelot_stats_init(struct ocelot *ocelot)if (!ocelot->stats)return -ENOMEM ; -snprintf (queue_name,sizeof (queue_name),"%s-stats" , -dev_name (ocelot->dev)); - ocelot->stats_queue =create_singlethread_workqueue (queue_name); + ocelot->stats_queue =create_singlethread_workqueue2 ( +"%s-stats" ,dev_name (ocelot->dev));if (!ocelot->stats_queue)return -ENOMEM ;
Bart Van Assche
reviewerPATCH 29/53 net: qed: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/net/ethernet/qlogic/qed/qed_sriov.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_sriov.c +3 -6
@@ -5262,7 +5262,6 @@ void qed_iov_wq_stop(struct qed_dev *cdev, bool schedule_first)int qed_iov_wq_start (struct qed_dev *cdev) { -char name[NAME_SIZE ];int i;for_each_hwfn (cdev, i) {
@@ -5274,11 +5273,9 @@ int qed_iov_wq_start(struct qed_dev *cdev)if (IS_PF (p_hwfn->cdev) && !IS_PF_SRIOV (p_hwfn))continue ; -snprintf (name,NAME_SIZE ,"iov-%02x:%02x.%02x" , - cdev->pdev->bus->number, -PCI_SLOT (cdev->pdev->devfn), p_hwfn->abs_pf_id); - - p_hwfn->iov_wq =create_singlethread_workqueue (name); + p_hwfn->iov_wq =create_singlethread_workqueue2 ( +"iov-%02x:%02x.%02x" , cdev->pdev->bus->number, +PCI_SLOT (cdev->pdev->devfn), p_hwfn->abs_pf_id);if (!p_hwfn->iov_wq) {DP_NOTICE (p_hwfn,"Cannot create iov workqueue\n" );return -ENOMEM ;
Bart Van Assche
reviewerPATCH 30/53 net: stmmac: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 - drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac.h +0 -1
@@ -343,7 +343,6 @@ struct stmmac_priv {unsigned long fpe_task_state;struct workqueue_struct *fpe_wq;struct work_struct fpe_task; -char wq_name[IFNAMSIZ +4 ];/* TC Handling */ unsigned int tc_entries_max;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +4 -7
@@ -3362,17 +3362,14 @@ static void stmmac_safety_feat_configuration(struct stmmac_priv *priv)static int stmmac_fpe_start_wq (struct stmmac_priv *priv) { -char *name; -clear_bit (__FPE_TASK_SCHED, &priv->fpe_task_state);clear_bit (__FPE_REMOVING, &priv->fpe_task_state); - name = priv->wq_name; -sprintf (name,"%s-fpe" , priv->dev->name); - - priv->fpe_wq =create_singlethread_workqueue (name); + priv->fpe_wq = +create_singlethread_workqueue2 ("%s-fpe" , priv->dev->name);if (!priv->fpe_wq) { -netdev_err (priv->dev,"%s: Failed to create workqueue\n" , name); +netdev_err (priv->dev,"%s: Failed to create workqueue\n" , + __func__);return -ENOMEM ; }
Bart Van Assche
reviewerPATCH 31/53 nfc: mrvl: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/nfc/nfcmrvl/fw_dnld.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/nfc/nfcmrvl/fw_dnld.c +3 -5
@@ -442,12 +442,10 @@ static void fw_dnld_rx_work(struct work_struct *work)int nfcmrvl_fw_dnld_init (struct nfcmrvl_private *priv) { -char name[32 ]; -INIT_WORK (&priv->fw_dnld.rx_work, fw_dnld_rx_work); -snprintf (name,sizeof (name),"%s_nfcmrvl_fw_dnld_rx_wq" , -dev_name (&priv->ndev->nfc_dev->dev)); - priv->fw_dnld.rx_wq =create_singlethread_workqueue (name); + priv->fw_dnld.rx_wq =create_singlethread_workqueue2 ( +"%s_nfcmrvl_fw_dnld_rx_wq" , +dev_name (&priv->ndev->nfc_dev->dev));if (!priv->fw_dnld.rx_wq)return -ENOMEM ;skb_queue_head_init (&priv->fw_dnld.rx_q);
Re: [PATCH 31/53] nfc: mrvl: Simplify a create*_workqueue() call
Quoted 6 lines · Bart Van Assche
Pass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
Signed-off-by Bart Van Assche <[email protected]>--- drivers/nfc/nfcmrvl/fw_dnld.c | 8 +++-----
I only got this patch, no links to new API being introduced and there is no create_singlethread_workqueue2() call. Looks fine, but tricky to review. Provide first patch or lore link in patch changelog.
Best regards,
Krzysztof
Bart Van Assche
reviewerRe: [PATCH 31/53] nfc: mrvl: Simplify a create*_workqueue() call
Quoted 11 lines · Krzysztof Kozlowski
Quoted 6 lines · Bart Van Assche
Pass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
Signed-off-by Bart Van Assche <[email protected]>--- drivers/nfc/nfcmrvl/fw_dnld.c | 8 +++-----I only got this patch, no links to new API being introduced and there is no
create_singlethread_workqueue2()call. Looks fine, but tricky to review. Provide first patch or lore link in patch changelog.
Thanks for the advice. I will do this if I have to repost this patch series.
This is the link to the entire patch series:
https://lore.kernel.org/linux-kernel/[email protected]/
Further feedback is welcome.
Thanks,
Bart.
Re: [PATCH 31/53] nfc: mrvl: Simplify a create*_workqueue() call
In reply to Bart Van AsscheQuoted 4 lines · Bart Van Assche
Pass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
Signed-off-by Bart Van Assche <[email protected]>
Best regards,
Krzysztof
Bart Van Assche
reviewerPATCH 32/53 scsi: ibmvscsi_tgt: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +1 -3
@@ -3425,7 +3425,6 @@ static int ibmvscsis_probe(struct vio_dev *vdev,struct scsi_info *vscsi;int rc =0 ;long hrc =0 ; -char wq_name[24 ]; vscsi =kzalloc (sizeof (*vscsi),GFP_KERNEL );if (!vscsi) {
@@ -3536,8 +3535,7 @@ static int ibmvscsis_probe(struct vio_dev *vdev,init_completion (&vscsi->wait_idle);init_completion (&vscsi->unconfig); -snprintf (wq_name,24 ,"ibmvscsis%s" ,dev_name (&vdev->dev)); - vscsi->work_q =create_workqueue (wq_name); + vscsi->work_q =create_workqueue2 ("ibmvscsis%s" ,dev_name (&vdev->dev));if (!vscsi->work_q) { rc = -ENOMEM ;dev_err (&vscsi->dev,"create_workqueue failed\n" );
Bart Van Assche
reviewerPATCH 33/53 scsi: libsas: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/libsas/sas_init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/scsi/libsas/sas_init.c +4 -5
@@ -92,7 +92,6 @@ void sas_hash_addr(u8 *hashed, const u8 *sas_addr)int sas_register_ha (struct sas_ha_struct *sas_ha) { -char name[64 ];int error =0 ;mutex_init (&sas_ha->disco_mutex);
@@ -121,13 +120,13 @@ int sas_register_ha(struct sas_ha_struct *sas_ha) } error = -ENOMEM ; -snprintf (name,sizeof (name),"%s_event_q" ,dev_name (sas_ha->dev)); - sas_ha->event_q =create_singlethread_workqueue (name); + sas_ha->event_q =create_singlethread_workqueue2 ("%s_event_q" , +dev_name (sas_ha->dev));if (!sas_ha->event_q) goto Undo_ports; -snprintf (name,sizeof (name),"%s_disco_q" ,dev_name (sas_ha->dev)); - sas_ha->disco_q =create_singlethread_workqueue (name); + sas_ha->disco_q =create_singlethread_workqueue2 ("%s_disco_q" , +dev_name (sas_ha->dev));if (!sas_ha->disco_q) goto Undo_event_q;
Re: [PATCH 33/53] scsi: libsas: Simplify the create*_workqueue() calls
Quoted 5 lines · Bart Van Assche
Pass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
Cc Martin K. Petersen <[email protected]>Signed-off-by Bart Van Assche <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 33/53] scsi: libsas: Simplify the create*_workqueue() calls
In reply to Bart Van AsscheBart Van Assche 於 2024/7/1 6:26 寫道:
Quoted 8 lines
Pass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
Cc Martin K. Petersen <[email protected]>Signed-off-by Bart Van Assche <[email protected]>--- drivers/scsi/libsas/sas_init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
祝一切顺利
Bart Van Assche
reviewerPATCH 34/53 scsi: mpi3mr: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/mpi3mr/mpi3mr_fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mpi3mr/mpi3mr_fw.c +2 -2
@@ -2689,8 +2689,8 @@ void mpi3mr_start_watchdog(struct mpi3mr_ioc *mrioc)snprintf (mrioc->watchdog_work_q_name,sizeof (mrioc->watchdog_work_q_name),"watchdog_%s%d" , mrioc->name, mrioc->id); - mrioc->watchdog_work_q = -create_singlethread_workqueue (mrioc->watchdog_work_q_name); + mrioc->watchdog_work_q =create_singlethread_workqueue2 ( +"%s" , mrioc->watchdog_work_q_name);if (!mrioc->watchdog_work_q) {ioc_err (mrioc,"%s: failed (line=%d)\n" , __func__, __LINE__);return ;
Bart Van Assche
reviewerPATCH 35/53 scsi: qedf: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/qedf/qedf_main.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/scsi/qedf/qedf_main.c +6 -11
@@ -3372,9 +3372,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)QEDF_INFO (&(qedf->dbg_ctx),QEDF_LOG_INFO ,"qedf->io_mempool=%p.\n" , qedf->io_mempool); -sprintf (host_buf,"qedf_%u_link" , - qedf->lport->host->host_no); - qedf->link_update_wq =create_workqueue (host_buf); + qedf->link_update_wq = +create_workqueue2 ("qedf_%u_link" , qedf->lport->host->host_no);INIT_DELAYED_WORK (&qedf->link_update, qedf_handle_link_update);INIT_DELAYED_WORK (&qedf->link_recovery, qedf_link_recovery);INIT_DELAYED_WORK (&qedf->grcdump_work, qedf_wq_grcdump);
@@ -3584,9 +3583,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)ether_addr_copy (params.ll2_mac_address, qedf->mac);/* Start LL2 processing thread */ -snprintf (host_buf,20 ,"qedf_%d_ll2" , host->host_no); - qedf->ll2_recv_wq = -create_workqueue (host_buf); + qedf->ll2_recv_wq =create_workqueue2 ("qedf_%d_ll2" , host->host_no);if (!qedf->ll2_recv_wq) {QEDF_ERR (&(qedf->dbg_ctx),"Failed to LL2 workqueue.\n" ); rc = -ENOMEM ;
@@ -3627,9 +3624,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) } } -sprintf (host_buf,"qedf_%u_timer" , qedf->lport->host->host_no); qedf->timer_work_queue = -create_workqueue (host_buf); +create_workqueue2 ("qedf_%u_timer" , qedf->lport->host->host_no);if (!qedf->timer_work_queue) {QEDF_ERR (&(qedf->dbg_ctx),"Failed to start timer " "workqueue.\n" );
@@ -3639,9 +3635,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)/* DPC workqueue is not reaped during recovery unload */ if (mode !=QEDF_MODE_RECOVERY ) { -sprintf (host_buf,"qedf_%u_dpc" , - qedf->lport->host->host_no); - qedf->dpc_wq =create_workqueue (host_buf); + qedf->dpc_wq =create_workqueue2 ("qedf_%u_dpc" , + qedf->lport->host->host_no); }INIT_DELAYED_WORK (&qedf->recovery_work, qedf_recovery_handler);
Bart Van Assche
reviewerPATCH 36/53 scsi: qedi: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/qedi/qedi_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/qedi/qedi_main.c +4 -4
@@ -2766,8 +2766,8 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) goto free_cid_que; } -sprintf (host_buf,"host_%d" , qedi->shost->host_no); - qedi->tmf_thread =create_singlethread_workqueue (host_buf); + qedi->tmf_thread =create_singlethread_workqueue2 ( +"host_%d" , qedi->shost->host_no);if (!qedi->tmf_thread) {QEDI_ERR (&qedi->dbg_ctx,"Unable to start tmf thread!\n" );
@@ -2775,8 +2775,8 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) goto free_cid_que; } -sprintf (host_buf,"qedi_ofld%d" , qedi->shost->host_no); - qedi->offload_thread =create_workqueue (host_buf); + qedi->offload_thread = +create_workqueue2 ("qedi_ofld%d" , qedi->shost->host_no);if (!qedi->offload_thread) {QEDI_ERR (&qedi->dbg_ctx,"Unable to start offload thread!\n" );
Bart Van Assche
reviewerPATCH 37/53 scsi: qla2xxx: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/qla2xxx/qla_os.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +5 -5
@@ -2915,7 +2915,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)scsi_qla_host_t *base_vha =NULL ;struct qla_hw_data *ha;char pci_info[30 ]; -char fw_str[30 ], wq_name[30 ]; +char fw_str[30 ];struct scsi_host_template *sht;int bars, mem_only =0 ;uint16_t req_length =0 , rsp_length =0 ;
@@ -3505,12 +3505,12 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)INIT_WORK (&ha->board_disable, qla2x00_disable_board_on_pci_error);if (IS_QLA8031 (ha) ||IS_MCTP_CAPABLE (ha)) { -sprintf (wq_name,"qla2xxx_%lu_dpc_lp_wq" , base_vha->host_no); - ha->dpc_lp_wq =create_singlethread_workqueue (wq_name); + ha->dpc_lp_wq =create_singlethread_workqueue2 ( +"qla2xxx_%lu_dpc_lp_wq" , base_vha->host_no);INIT_WORK (&ha->idc_aen, qla83xx_service_idc_aen); -sprintf (wq_name,"qla2xxx_%lu_dpc_hp_wq" , base_vha->host_no); - ha->dpc_hp_wq =create_singlethread_workqueue (wq_name); + ha->dpc_hp_wq =create_singlethread_workqueue2 ( +"qla2xxx_%lu_dpc_hp_wq" , base_vha->host_no);INIT_WORK (&ha->nic_core_reset, qla83xx_nic_core_reset_work);INIT_WORK (&ha->idc_state_handler, qla83xx_idc_state_handler_work);
Bart Van Assche
reviewerPATCH 38/53 scsi: qla4xxx: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/qla4xxx/ql4_os.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/qla4xxx/ql4_os.c +2 -3
@@ -8630,7 +8630,6 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev,struct Scsi_Host *host;struct scsi_qla_host *ha;uint8_t init_retry_count =0 ; -char buf[34 ];struct qla4_8xxx_legacy_intr_set *nx_legacy_intr;uint32_t dev_state;
@@ -8805,8 +8804,8 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev,/* Startup the kernel thread for this host adapter. */ DEBUG2 (printk ("scsi: %s: Starting kernel thread for " "qla4xxx_dpc\n" , __func__)); -sprintf (buf,"qla4xxx_%lu_dpc" , ha->host_no); - ha->dpc_thread =create_singlethread_workqueue (buf); + ha->dpc_thread = +create_singlethread_workqueue2 ("qla4xxx_%lu_dpc" , ha->host_no);if (!ha->dpc_thread) {ql4_printk (KERN_WARNING , ha,"Unable to start DPC thread!\n" ); ret = -ENODEV ;
Bart Van Assche
reviewerPATCH 39/53 scsi: vmw_pvscsi: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/vmw_pvscsi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/scsi/vmw_pvscsi.c +2 -6
@@ -1123,8 +1123,6 @@ static void pvscsi_msg_workqueue_handler(struct work_struct *data)static int pvscsi_setup_msg_workqueue (struct pvscsi_adapter *adapter) { -char name[32 ]; -if (!pvscsi_use_msg)return 0 ;
@@ -1134,10 +1132,8 @@ static int pvscsi_setup_msg_workqueue(struct pvscsi_adapter *adapter)if (pvscsi_reg_read (adapter,PVSCSI_REG_OFFSET_COMMAND_STATUS ) ==-1 )return 0 ; -snprintf (name,sizeof (name), -"vmw_pvscsi_wq_%u" , adapter->host->host_no); - - adapter->workqueue =create_singlethread_workqueue (name); + adapter->workqueue =create_singlethread_workqueue2 ( +"vmw_pvscsi_wq_%u" , adapter->host->host_no);if (!adapter->workqueue) {printk (KERN_ERR "vmw_pvscsi: failed to create work queue\n" );return 0 ;
Bart Van Assche
reviewerPATCH 40/53 scsi: myrb: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/myrb.c | 5 ++--- drivers/scsi/myrb.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/myrb.c +2 -3
@@ -112,9 +112,8 @@ static bool myrb_create_mempools(struct pci_dev *pdev, struct myrb_hba *cb)return false; } -snprintf (cb->work_q_name,sizeof (cb->work_q_name), -"myrb_wq_%d" , cb->host->host_no); - cb->work_q =create_singlethread_workqueue (cb->work_q_name); + cb->work_q = +create_singlethread_workqueue2 ("myrb_wq_%d" , cb->host->host_no);if (!cb->work_q) {dma_pool_destroy (cb->dcdb_pool); cb->dcdb_pool =NULL ;
drivers/scsi/myrb.h +0 -1
@@ -712,7 +712,6 @@ struct myrb_hba {struct Scsi_Host *host;struct workqueue_struct *work_q; -char work_q_name[20 ];struct delayed_work monitor_work;unsigned long primary_monitor_time;unsigned long secondary_monitor_time;
Bart Van Assche
reviewerPATCH 41/53 scsi: myrs: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/myrs.c | 5 ++--- drivers/scsi/myrs.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/myrs.c +2 -3
@@ -2206,9 +2206,8 @@ static bool myrs_create_mempools(struct pci_dev *pdev, struct myrs_hba *cs)return false; } -snprintf (cs->work_q_name,sizeof (cs->work_q_name), -"myrs_wq_%d" , shost->host_no); - cs->work_q =create_singlethread_workqueue (cs->work_q_name); + cs->work_q = +create_singlethread_workqueue2 ("myrs_wq_%d" , shost->host_no);if (!cs->work_q) {dma_pool_destroy (cs->dcdb_pool); cs->dcdb_pool =NULL ;
drivers/scsi/myrs.h +0 -1
@@ -904,7 +904,6 @@ struct myrs_hba {bool disable_enc_msg;struct workqueue_struct *work_q; -char work_q_name[20 ];struct delayed_work monitor_work;unsigned long primary_monitor_time;unsigned long secondary_monitor_time;
Bart Van Assche
reviewerPATCH 42/53 scsi: stex: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/stex.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/stex.c +2 -4
@@ -334,7 +334,6 @@ struct st_hba {struct st_ccb *wait_ccb;__le32 *scratch; -char work_q_name[20 ];struct workqueue_struct *work_q;struct work_struct reset_work;wait_queue_head_t reset_waitq;
@@ -1795,9 +1794,8 @@ static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id) hba->pdev = pdev;init_waitqueue_head (&hba->reset_waitq); -snprintf (hba->work_q_name,sizeof (hba->work_q_name), -"stex_wq_%d" , host->host_no); - hba->work_q =create_singlethread_workqueue (hba->work_q_name); + hba->work_q = +create_singlethread_workqueue2 ("stex_wq_%d" , host->host_no);if (!hba->work_q) { printk(KERN_ERR DRV_NAME "(%s): create workqueue failed\n", pci_name(pdev));
Bart Van Assche
reviewerPATCH 43/53 scsi: fcoe: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/fcoe/fcoe_sysfs.c | 7 +------ include/scsi/fcoe_sysfs.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-)
drivers/scsi/fcoe/fcoe_sysfs.c +1 -6
@@ -45,8 +45,6 @@ MODULE_PARM_DESC(fcf_dev_loss_tmo,*/ #define fcoe_ctlr_id (x) \ ((x)->id) -#define fcoe_ctlr_work_q_name (x) \ - ((x)->work_q_name)#define fcoe_ctlr_work_q (x) \ ((x)->work_q)#define fcoe_ctlr_devloss_work_q_name (x) \
@@ -797,10 +795,7 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent, ctlr->fcf_dev_loss_tmo = fcoe_fcf_dev_loss_tmo; -snprintf (ctlr->work_q_name,sizeof (ctlr->work_q_name), -"ctlr_wq_%d" , ctlr->id); - ctlr->work_q =create_singlethread_workqueue ( - ctlr->work_q_name); + ctlr->work_q =create_singlethread_workqueue2 ("ctlr_wq_%d" , ctlr->id);if (!ctlr->work_q) goto out_del;
include/scsi/fcoe_sysfs.h +0 -1
@@ -50,7 +50,6 @@ struct fcoe_ctlr_device {struct fcoe_sysfs_function_template *f;struct list_head fcfs; -char work_q_name[20 ];struct workqueue_struct *work_q;char devloss_work_q_name[20 ];struct workqueue_struct *devloss_work_q;
Bart Van Assche
reviewerPATCH 44/53 scsi: snic: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called. Not setting shost->work_q_name is safe because there is no code that reads this struct member. Additionally, a later patch removes this struct member.
--- drivers/scsi/snic/snic_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/snic/snic_main.c +2 -3
@@ -300,9 +300,8 @@ snic_add_host(struct Scsi_Host *shost, struct pci_dev *pdev) }SNIC_BUG_ON (shost->work_q !=NULL ); -snprintf (shost->work_q_name,sizeof (shost->work_q_name),"scsi_wq_%d" , - shost->host_no); - shost->work_q =create_singlethread_workqueue (shost->work_q_name); + shost->work_q = +create_singlethread_workqueue2 ("scsi_wq_%d" , shost->host_no);if (!shost->work_q) {SNIC_HOST_ERR (shost,"Failed to Create ScsiHost wq.\n" );
Bart Van Assche
reviewerPATCH 45/53 scsi: scsi_transport_fc: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/scsi/scsi_transport_fc.c | 4 +--- include/scsi/scsi_transport_fc.h | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/scsi/scsi_transport_fc.c +1 -3
@@ -441,9 +441,7 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev, fc_host->next_vport_number =0 ; fc_host->npiv_vports_inuse =0 ; -snprintf (fc_host->work_q_name,sizeof (fc_host->work_q_name), -"fc_wq_%d" , shost->host_no); - fc_host->work_q =alloc_workqueue ("%s" ,0 ,0 , fc_host->work_q_name); + fc_host->work_q =alloc_workqueue ("fc_wq_%d" ,0 ,0 , shost->host_no);if (!fc_host->work_q)return -ENOMEM ;
include/scsi/scsi_transport_fc.h +0 -3
@@ -575,7 +575,6 @@ struct fc_host_attrs {u16 npiv_vports_inuse;/* work queues for rport state manipulation */ -char work_q_name[20 ];struct workqueue_struct *work_q;char devloss_work_q_name[20 ];struct workqueue_struct *devloss_work_q;
@@ -654,8 +653,6 @@ struct fc_host_attrs { (((struct fc_host_attrs *)(x)->shost_data)->next_vport_number)#define fc_host_npiv_vports_inuse (x) \ (((struct fc_host_attrs *)(x)->shost_data)->npiv_vports_inuse) -#define fc_host_work_q_name (x) \ - (((struct fc_host_attrs *)(x)->shost_data)->work_q_name)#define fc_host_work_q (x) \ (((struct fc_host_attrs *)(x)->shost_data)->work_q)#define fc_host_devloss_work_q_name (x) \
Bart Van Assche
reviewerPATCH 46/53 scsi: core: Simplify the alloc_workqueue() calls
In reply to Bart Van AsschePass a format string to alloc_workqueue2() instead of formatting the workqueue name before alloc_workqueue() is called.
--- drivers/scsi/hosts.c | 9 ++++----- include/scsi/scsi_host.h | 1 - 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/scsi/hosts.c +4 -5
@@ -292,11 +292,10 @@ 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_workqueue ( +"scsi_wq_%d" , +WQ_SYSFS | __WQ_LEGACY |WQ_MEM_RECLAIM |WQ_UNBOUND ,1 , + shost->host_no);if (!shost->work_q) { error = -EINVAL ;
include/scsi/scsi_host.h +0 -1
@@ -677,7 +677,6 @@ struct Scsi_Host {/* * Optional work queue to be utilized by the transport */ -char work_q_name[20 ];struct workqueue_struct *work_q;/*
Bart Van Assche
reviewerPATCH 47/53 serial: max3100: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/tty/serial/max3100.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/max3100.c +1 -3
@@ -548,7 +548,6 @@ static void max3100_shutdown(struct uart_port *port)static int max3100_startup (struct uart_port *port) {struct max3100_port *s =to_max3100_port (port); -char b[12 ];int ret;dev_dbg (&s->spi->dev,"%s\n" , __func__);
@@ -564,8 +563,7 @@ static int max3100_startup(struct uart_port *port) s->parity =0 ; s->rts =0 ; -sprintf (b,"max3100-%d" , s->minor); - s->workqueue =create_freezable_workqueue (b); + s->workqueue =create_freezable_workqueue2 ("max3100-%d" , s->minor);if (!s->workqueue) {dev_warn (&s->spi->dev,"cannot create workqueue\n" );return -EBUSY ;
Re: [PATCH 47/53] serial: max3100: Simplify a create*_workqueue() call
Quoted 2 lines · Bart Van Assche
Pass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Bart Van Assche
reviewerPATCH 48/53 scsi: ufs: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/ufs/core/ufshcd.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/ufs/core/ufshcd.c +4 -9
@@ -1783,8 +1783,6 @@ static void ufshcd_remove_clk_scaling_sysfs(struct ufs_hba *hba)static void ufshcd_init_clk_scaling (struct ufs_hba *hba) { -char wq_name[sizeof ("ufs_clkscaling_00" )]; -if (!ufshcd_is_clkscaling_supported (hba))return ;
@@ -1796,9 +1794,8 @@ static void ufshcd_init_clk_scaling(struct ufs_hba *hba)INIT_WORK (&hba->clk_scaling.resume_work, ufshcd_clk_scaling_resume_work); -snprintf (wq_name,sizeof (wq_name),"ufs_clkscaling_%d" , - hba->host->host_no); - hba->clk_scaling.workq =create_singlethread_workqueue (wq_name); + hba->clk_scaling.workq =create_singlethread_workqueue2 ( +"ufs_clkscaling_%d" , hba->host->host_no); hba->clk_scaling.is_initialized = true; }
@@ -10328,7 +10325,6 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)int err;struct Scsi_Host *host = hba->host;struct device *dev = hba->dev; -char eh_wq_name[sizeof ("ufs_eh_wq_00" )];/* * dev_set_drvdata() must be called before any callbacks are registered
@@ -10395,9 +10391,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) hba->max_pwr_info.is_valid = false;/* Initialize work queues */ -snprintf (eh_wq_name,sizeof (eh_wq_name),"ufs_eh_wq_%d" , - hba->host->host_no); - hba->eh_wq =create_singlethread_workqueue (eh_wq_name); + hba->eh_wq =create_singlethread_workqueue2 ("ufs_eh_wq_%d" , + hba->host->host_no);if (!hba->eh_wq) {dev_err (hba->dev,"%s: failed to create eh workqueue\n" , __func__);
Bart Van Assche
reviewerPATCH 49/53 usb: typec: ucsi: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- drivers/usb/typec/ucsi/ucsi.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/usb/typec/ucsi/ucsi.c +2 -7
@@ -1504,15 +1504,10 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)enum typec_accessory *accessory = cap->accessory;enum usb_role u_role =USB_ROLE_NONE ;u64 command; -char *name;int ret; - name =kasprintf (GFP_KERNEL ,"%s-con%d" ,dev_name (ucsi->dev), con->num); -if (!name) -return -ENOMEM ; - - con->wq =create_singlethread_workqueue (name); -kfree (name); + con->wq =create_singlethread_workqueue2 ("%s-con%d" , +dev_name (ucsi->dev), con->num);if (!con->wq)return -ENOMEM ;
Bart Van Assche
reviewerPATCH 50/53 cifs: Simplify a create*_workqueue() call
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- fs/smb/client/smbdirect.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/smb/client/smbdirect.c +1 -2
@@ -1458,8 +1458,7 @@ static int allocate_caches_and_workqueue(struct smbd_connection *info)if (!info->response_mempool) goto out3; -scnprintf (name,MAX_NAME_LEN ,"smbd_%p" , info); - info->workqueue =create_workqueue (name); + info->workqueue =create_workqueue2 ("smbd_%p" , info);if (!info->workqueue) goto out4;
Bart Van Assche
reviewerPATCH 51/53 mac802154: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue2() instead of formatting the workqueue name before create*_workqueue() is called.
--- net/mac802154/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
net/mac802154/main.c +3 -4
@@ -193,19 +193,18 @@ static void ieee802154_setup_wpan_phy_pib(struct wpan_phy *wpan_phy)int ieee802154_register_hw (struct ieee802154_hw *hw) {struct ieee802154_local *local =hw_to_local (hw); -char mac_wq_name[IFNAMSIZ +10 ] = {};struct net_device *dev;int rc = -ENOSYS ; local->workqueue = -create_singlethread_workqueue (wpan_phy_name (local->phy)); +create_singlethread_workqueue2 ("%s" ,wpan_phy_name (local->phy));if (!local->workqueue) { rc = -ENOMEM ; goto out; } -snprintf (mac_wq_name,IFNAMSIZ +10 ,"%s-mac-cmds" ,wpan_phy_name (local->phy)); - local->mac_wq =create_singlethread_workqueue (mac_wq_name); + local->mac_wq =create_singlethread_workqueue2 ( +"%s-mac-cmds" ,wpan_phy_name (local->phy));if (!local->mac_wq) { rc = -ENOMEM ; goto out_wq;
Bart Van Assche
reviewerPATCH 52/53 nfc: nci: Simplify the create*_workqueue() calls
In reply to Bart Van AsschePass a format string to create*_workqueue() instead of formatting the workqueue name before create*_workqueue() is called.
--- net/nfc/nci/core.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
net/nfc/nci/core.c +6 -7
@@ -1225,29 +1225,28 @@ int nci_register_device(struct nci_dev *ndev) {int rc;struct device *dev = &ndev->nfc_dev->dev; -char name[32 ]; ndev->flags =0 ;INIT_WORK (&ndev->cmd_work, nci_cmd_work); -snprintf (name,sizeof (name),"%s_nci_cmd_wq" ,dev_name (dev)); - ndev->cmd_wq =create_singlethread_workqueue (name); + ndev->cmd_wq = +create_singlethread_workqueue2 ("%s_nci_cmd_wq" ,dev_name (dev));if (!ndev->cmd_wq) { rc = -ENOMEM ; goto exit; }INIT_WORK (&ndev->rx_work, nci_rx_work); -snprintf (name,sizeof (name),"%s_nci_rx_wq" ,dev_name (dev)); - ndev->rx_wq =create_singlethread_workqueue (name); + ndev->rx_wq = +create_singlethread_workqueue2 ("%s_nci_rx_wq" ,dev_name (dev));if (!ndev->rx_wq) { rc = -ENOMEM ; goto destroy_cmd_wq_exit; }INIT_WORK (&ndev->tx_work, nci_tx_work); -snprintf (name,sizeof (name),"%s_nci_tx_wq" ,dev_name (dev)); - ndev->tx_wq =create_singlethread_workqueue (name); + ndev->tx_wq = +create_singlethread_workqueue2 ("%s_nci_tx_wq" ,dev_name (dev));if (!ndev->tx_wq) { rc = -ENOMEM ; goto destroy_rx_wq_exit;
Re: [PATCH 52/53] nfc: nci: Simplify the create*_workqueue() calls
Quoted 4 lines · Bart Van Assche
Pass a format string to create*_workqueue() instead of formatting the workqueue name before create*_workqueue() is called.
Signed-off-by Bart Van Assche <[email protected]>
Best regards,
Krzysztof
Tejun Heo
maintainerHello, Bart.
Quoted 2 lines · Bart Van Assche
1. Introduce the create*_workqueue2() macros that accept a printf-style format string and argument list.
I don't think we want to update create_workqueue() interface at all. Please convert them to use alloc_workqueue() instead. Once we convert all create_workqueue() users then we can just drop the old interface.
The challenge with converging to alloc_workqueue() interface is that the conversion needs to explicitly decide whether WQ_MEM_RECLAIM is needed or not but that shouldn't be *too* difficult.
Thanks.
Signature · 1 line
tejun
Bart Van Assche
reviewerQuoted 11 lines · Tejun Heo
Quoted 2 lines · Bart Van Assche
1. Introduce the create*_workqueue2() macros that accept a printf-style format string and argument list.
I don't think we want to update
create_workqueue()interface at all. Please convert them to usealloc_workqueue()instead. Once we convert allcreate_workqueue()users then we can just drop the old interface.The challenge with converging to
alloc_workqueue()interface is that the conversion needs to explicitly decide whetherWQ_MEM_RECLAIMis needed or not but that shouldn't be *too* difficult.
The create*_workqueue() macros are used about 270 times in the Linux kernel (the macro names also occur in some comments):
$ git grep -nHEw 'create_workqueue|create_freezable_workqueue|create_singlethread_workqueue' | grep -Ev 'Documentation/|include/linux/workqueue' | wc -l
271That's too much for a single patch series. I can start with converting the SCSI workqueue creation code.
Thanks,
Bart.
Tejun Heo
maintainerHello, Bart.
Quoted 10 lines · Bart Van Assche
The create*_workqueue() macros are used about 270 times in the Linux kernel (the macro names also occur in some comments):
$ git grep -nHEw 'create_workqueue|create_freezable_workqueue|create_singlethread_workqueue' | grep -Ev 'Documentation/|include/linux/workqueue' | wc -l 271That's too much for a single patch series. I can start with converting the SCSI workqueue creation code.
Yeah, it's been on the to-do list for a long time. Starting with SCSI sounds great.
Thank you.
Signature · 1 line
tejun