workqueue: WQ_NON_REENTRANT is meaningless and going away
Subsystems (11)
Tejun Heo
maintainerPATCH 1/1 workqueue: WQ_NON_REENTRANT is meaningless and going away
Hello,
dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op but the following patches didn't remove the flag or update the documentation. Let's mark the flag deprecated and update the documentation accordingly and remove the existing usages. We can remove the flag after the next merge window.
This patchset contains the following nine patches.
0001-workqueue-mark-WQ_NON_REENTRANT-deprecated.patch 0002-dm-WQ_NON_REENTRANT-is-meaningless-and-going-away.patch 0003-mmc-WQ_NON_REENTRANT-is-meaningless-and-going-away.patch 0004-firewire-WQ_NON_REENTRANT-is-meaningless-and-going-a.patch 0005-dlm-WQ_NON_REENTRANT-is-meaningless-and-going-away.patch 0006-gfs2-WQ_NON_REENTRANT-is-meaningless-and-going-away.patch 0007-xfs-WQ_NON_REENTRANT-is-meaningless-and-going-away.patch 0008-ceph-WQ_NON_REENTRANT-is-meaningless-and-going-away.patch 0009-l2tp-WQ_NON_REENTRANT-is-meaningless-and-going-away.patch
0001 marks the flag deprecated. The rest remove the exising usages. This patchset as a whole doesn't introduce any behavior changes.
0001 is already applied to wq/for-3.12. The rest will be routed through the respective trees. The patches are also available in the following git branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git review-WQ_NON_REENTRANT-removal
Documentation/workqueue.txt | 18 ++++++------------ drivers/firewire/core-transaction.c | 3 +-- drivers/md/dm-crypt.c | 10 ++-------- drivers/md/dm-kcopyd.c | 3 +-- drivers/md/dm-raid1.c | 3 +-- drivers/md/dm.c | 3 +-- drivers/mmc/host/dw_mmc.c | 2 +- fs/dlm/ast.c | 5 +---- fs/gfs2/main.c | 2 +- fs/xfs/xfs_super.c | 6 +++--- include/linux/workqueue.h | 7 ++++++- net/ceph/messenger.c | 2 +- net/l2tp/l2tp_core.c | 2 +- 13 files changed, 26 insertions(+), 40 deletions(-)
Thanks.
--
tejun
Tejun Heo
maintainerPATCH 1/9 workqueue: mark WQ_NON_REENTRANT deprecated
dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op but the following patches didn't remove the flag or update the documentation. Let's mark the flag deprecated and update the documentation accordingly.
--- Documentation/workqueue.txt | 18 ++++++------------ include/linux/workqueue.h | 7 ++++++- 2 files changed, 12 insertions(+), 13 deletions(-)
Documentation/workqueue.txt +6 -12
@@ -100,8 +100,8 @@ Subsystems and drivers can create and queue work items through special workqueue API functions as they see fit. They can influence some aspects of the way the work items are executed by setting flags on the workqueue they are putting the work item on. These flags include -things like CPU locality, reentrancy, concurrency limits, priority and -more. To get a detailed overview refer to the API description of +things like CPU locality, concurrency limits, priority and more. To +get a detailed overview refer to the API description of alloc_workqueue() below. When a work item is queued to a workqueue, the target gcwq and
@@ -166,16 +166,6 @@ resources, scheduled and executed. @flags: - WQ_NON_REENTRANT - - By default, a wq guarantees non-reentrance only on the same - CPU. A work item may not be executed concurrently on the same - CPU by multiple workers but is allowed to be executed - concurrently on multiple CPUs. This flag makes sure - non-reentrance is enforced across all CPUs. Work items queued - to a non-reentrant wq are guaranteed to be executed by at most - one worker system-wide at any given time. - WQ_UNBOUND Work items queued to an unbound wq are served by a special
@@ -233,6 +223,10 @@ resources, scheduled and executed. This flag is meaningless for unbound wq. +Note that the flag WQ_NON_REENTRANT no longer exists as all workqueues +are now non-reentrant - any work item is guaranteed to be executed by +at most one worker system-wide at any given time. + @max_active: @max_active determines the maximum number of execution contexts per
include/linux/workqueue.h +6 -1
@@ -295,7 +295,12 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }* Documentation/workqueue.txt. */ enum { -WQ_NON_REENTRANT =1 <<0 ,/* guarantee non-reentrance */ +/* +* All wqs are now non-reentrant making the following flag +* meaningless. Will be removed. +*/ +WQ_NON_REENTRANT =1 <<0 ,/* DEPRECATED */ +WQ_UNBOUND =1 <<1 ,/* not bound to any cpu */ WQ_FREEZABLE =1 <<2 ,/* freeze during suspend */ WQ_MEM_RECLAIM =1 <<3 ,/* may be used for memory reclaim */
Signature · 1 line
1.8.3.1
Re: [PATCH 1/9] workqueue: mark WQ_NON_REENTRANT deprecated
Quoted 6 lines · Tejun Heo
dbf2576e37("workqueue: make all workqueues non-reentrant") madeWQ_NON_REENTRANTno-op but the following patches didn't remove the flag or update the documentation. Let's mark the flag deprecated and update the documentation accordingly.Signed-off-by Tejun Heo <[email protected]>
Quoted 66 lines
--- Documentation/workqueue.txt | 18 ++++++------------ include/linux/workqueue.h | 7 ++++++- 2 files changed, 12 insertions(+), 13 deletions(-)Documentation/workqueue.txt +6
-12@@ -100,8 +100,8 @@ Subsystems and drivers can create and queue work items through special workqueue API functions as they see fit. They can influence some aspects of the way the work items are executed by setting flags on the workqueue they are putting the work item on. These flags include -things like CPU locality, reentrancy, concurrency limits, priority and -more. To get a detailed overview refer to the API description of +things like CPU locality, concurrency limits, priority and more. To +get a detailed overview refer to the API description of alloc_workqueue() below. When a work item is queued to a workqueue, the target gcwq and@@ -166,16 +166,6 @@ resources, scheduled and executed. @flags: - WQ_NON_REENTRANT - - By default, a wq guarantees non-reentrance only on the same - CPU. A work item may not be executed concurrently on the same - CPU by multiple workers but is allowed to be executed - concurrently on multiple CPUs. This flag makes sure - non-reentrance is enforced across all CPUs. Work items queued - to a non-reentrant wq are guaranteed to be executed by at most - one worker system-wide at any given time. - WQ_UNBOUND Work items queued to an unbound wq are served by a special@@ -233,6 +223,10 @@ resources, scheduled and executed. This flag is meaningless for unbound wq. +Note that the flag WQ_NON_REENTRANT no longer exists as all workqueues +are now non-reentrant - any work item is guaranteed to be executed by +at most one worker system-wide at any given time. + @max_active: @max_active determines the maximum number of execution contexts perinclude/linux/workqueue.h +6
-1@@ -295,7 +295,12 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }* Documentation/workqueue.txt. */ enum { -WQ_NON_REENTRANT =1 <<0 ,/* guarantee non-reentrance */ +/* +* All wqs are now non-reentrant making the following flag +* meaningless. Will be removed. +*/ +WQ_NON_REENTRANT =1 <<0 ,/* DEPRECATED */ +WQ_UNBOUND =1 <<1 ,/* not bound to any cpu */ WQ_FREEZABLE =1 <<2 ,/* freeze during suspend */ WQ_MEM_RECLAIM =1 <<3 ,/* may be used for memory reclaim */
Tejun Heo
maintainerPATCH 2/9 dm: WQ_NON_REENTRANT is meaningless and going away
In reply to Tejun HeoHello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of WQ_NON_REENTRANT which is already noop.
Thanks.
------ 8< -------dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op and the flag is going away. Remove its usages.
This patch doesn't introduce any behavior changes.
--- drivers/md/dm-crypt.c | 10 ++-------- drivers/md/dm-kcopyd.c | 3 +-- drivers/md/dm-raid1.c | 3 +-- drivers/md/dm.c | 3 +-- 4 files changed, 5 insertions(+), 14 deletions(-)
drivers/md/dm-crypt.c +2 -8
@@ -1645,20 +1645,14 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) } ret = -ENOMEM ; - cc->io_queue =alloc_workqueue ("kcryptd_io" , -WQ_NON_REENTRANT | -WQ_MEM_RECLAIM , -1 ); + cc->io_queue =alloc_workqueue ("kcryptd_io" ,WQ_MEM_RECLAIM ,1 );if (!cc->io_queue) { ti->error ="Couldn't create kcryptd io queue" ; goto bad; } cc->crypt_queue =alloc_workqueue ("kcryptd" , -WQ_NON_REENTRANT | -WQ_CPU_INTENSIVE | -WQ_MEM_RECLAIM , -1 ); +WQ_CPU_INTENSIVE |WQ_MEM_RECLAIM ,1 );if (!cc->crypt_queue) { ti->error ="Couldn't create kcryptd queue" ; goto bad;
drivers/md/dm-kcopyd.c +1 -2
@@ -833,8 +833,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *thro goto bad_slab;INIT_WORK (&kc->kcopyd_work, do_work); - kc->kcopyd_wq =alloc_workqueue ("kcopyd" , -WQ_NON_REENTRANT |WQ_MEM_RECLAIM ,0 ); + kc->kcopyd_wq =alloc_workqueue ("kcopyd" ,WQ_MEM_RECLAIM ,0 );if (!kc->kcopyd_wq) goto bad_workqueue;
drivers/md/dm-raid1.c +1 -2
@@ -1080,8 +1080,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) ti->per_bio_data_size =sizeof (struct dm_raid1_bio_record ); ti->discard_zeroes_data_unsupported = true; - ms->kmirrord_wq =alloc_workqueue ("kmirrord" , -WQ_NON_REENTRANT |WQ_MEM_RECLAIM ,0 ); + ms->kmirrord_wq =alloc_workqueue ("kmirrord" ,WQ_MEM_RECLAIM ,0 );if (!ms->kmirrord_wq) {DMERR ("couldn't start kmirrord" ); r = -ENOMEM ;
drivers/md/dm.c +1 -2
@@ -1946,8 +1946,7 @@ static struct mapped_device *alloc_dev(int minor)add_disk (md->disk);format_dev_t (md->name,MKDEV (_major, minor)); - md->wq =alloc_workqueue ("kdmflush" , -WQ_NON_REENTRANT |WQ_MEM_RECLAIM ,0 ); + md->wq =alloc_workqueue ("kdmflush" ,WQ_MEM_RECLAIM ,0 );if (!md->wq) goto bad_thread;
Signature · 1 line
1.8.3.1
Tejun Heo
maintainerPATCH 3/9 mmc: WQ_NON_REENTRANT is meaningless and going away
In reply to Tejun HeoHello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of WQ_NON_REENTRANT which is already noop.
Thanks.
------ 8< -------dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op and the flag is going away. Remove its usages.
This patch doesn't introduce any behavior changes.
--- drivers/mmc/host/dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc.c +1 -1
@@ -2340,7 +2340,7 @@ int dw_mci_probe(struct dw_mci *host)tasklet_init (&host->tasklet, dw_mci_tasklet_func, (unsigned long )host); host->card_workqueue =alloc_workqueue ("dw-mci-card" , -WQ_MEM_RECLAIM |WQ_NON_REENTRANT ,1 ); +WQ_MEM_RECLAIM ,1 );if (!host->card_workqueue) { ret = -ENOMEM ; goto err_dmaunmap;
Signature · 1 line
1.8.3.1
Tejun Heo
maintainerPATCH 4/9 firewire: WQ_NON_REENTRANT is meaningless and going away
In reply to Tejun HeoHello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of WQ_NON_REENTRANT which is already noop.
Thanks.
------ 8< -------dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op and the flag is going away. Remove its usages.
This patch doesn't introduce any behavior changes.
--- drivers/firewire/core-transaction.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firewire/core-transaction.c +1 -2
@@ -1262,8 +1262,7 @@ static int __init fw_core_init(void) {int ret; - fw_workqueue =alloc_workqueue ("firewire" , -WQ_NON_REENTRANT |WQ_MEM_RECLAIM ,0 ); + fw_workqueue =alloc_workqueue ("firewire" ,WQ_MEM_RECLAIM ,0 );if (!fw_workqueue)return -ENOMEM ;
Signature · 1 line
1.8.3.1
Re: [PATCH 4/9] firewire: WQ_NON_REENTRANT is meaningless and going away
Quoted 3 lines · On Jul 30 Tejun Heo wrote:
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of
WQ_NON_REENTRANTwhich is already noop.
Committed to linux1394.git and pushed out to the for-next branch.
Quoted 27 lines
------ 8< -------
dbf2576e37("workqueue: make all workqueues non-reentrant") madeWQ_NON_REENTRANTno-op and the flag is going away. Remove its usages.This patch doesn't introduce any behavior changes.
Signed-off-by Tejun Heo <[email protected]>Cc Stefan Richter <[email protected]>--- drivers/firewire/core-transaction.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/firewire/core-transaction.c +1
-2@@ -1262,8 +1262,7 @@ static int __init fw_core_init(void) {int ret; - fw_workqueue =alloc_workqueue ("firewire" , -WQ_NON_REENTRANT |WQ_MEM_RECLAIM ,0 ); + fw_workqueue =alloc_workqueue ("firewire" ,WQ_MEM_RECLAIM ,0 );if (!fw_workqueue)return -ENOMEM ;
Signature · 3 lines
Stefan Richter -=====-===-= -=== ====- http://arcgraph.de/sr/
Tejun Heo
maintainerPATCH 5/9 dlm: WQ_NON_REENTRANT is meaningless and going away
In reply to Tejun HeoHello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of WQ_NON_REENTRANT which is already noop.
Thanks.
------ 8< -------dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op and the flag is going away. Remove its usages.
This patch doesn't introduce any behavior changes.
--- fs/dlm/ast.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
fs/dlm/ast.c +1 -4
@@ -267,10 +267,7 @@ void dlm_callback_work(struct work_struct *work)int dlm_callback_start (struct dlm_ls *ls) { ls->ls_callback_wq =alloc_workqueue ("dlm_callback" , -WQ_UNBOUND | -WQ_MEM_RECLAIM | -WQ_NON_REENTRANT , -0 ); +WQ_UNBOUND |WQ_MEM_RECLAIM ,0 );if (!ls->ls_callback_wq) {log_print ("can't start dlm_callback workqueue" );return -ENOMEM ;
Signature · 1 line
1.8.3.1
Tejun Heo
maintainerPATCH 6/9 gfs2: WQ_NON_REENTRANT is meaningless and going away
In reply to Tejun HeoHello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of WQ_NON_REENTRANT which is already noop.
Thanks.
------ 8< -------dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op and the flag is going away. Remove its usages.
This patch doesn't introduce any behavior changes.
--- fs/gfs2/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/main.c +1 -1
@@ -155,7 +155,7 @@ static int __init init_gfs2_fs(void) goto fail_wq; gfs2_control_wq =alloc_workqueue ("gfs2_control" , -WQ_NON_REENTRANT |WQ_UNBOUND |WQ_FREEZABLE ,0 ); +WQ_UNBOUND |WQ_FREEZABLE ,0 );if (!gfs2_control_wq) goto fail_recovery;
Signature · 1 line
1.8.3.1
Re: [PATCH 6/9] gfs2: WQ_NON_REENTRANT is meaningless and going away
Hi,
Quoted 8 lines · Tejun Heo
Hello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of
WQ_NON_REENTRANTwhich is already noop.Thanks.
Now in the GFS2 -nmw tree. Thanks,
Steve.
Quoted 26 lines
------ 8< -------
dbf2576e37("workqueue: make all workqueues non-reentrant") madeWQ_NON_REENTRANTno-op and the flag is going away. Remove its usages.This patch doesn't introduce any behavior changes.
Signed-off-by Tejun Heo <[email protected]>Cc Steven Whitehouse <[email protected]>Cc cluster-devel at redhat.com--- fs/gfs2/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/gfs2/main.c +1
-1@@ -155,7 +155,7 @@ static int __init init_gfs2_fs(void) goto fail_wq; gfs2_control_wq =alloc_workqueue ("gfs2_control" , -WQ_NON_REENTRANT |WQ_UNBOUND |WQ_FREEZABLE ,0 ); +WQ_UNBOUND |WQ_FREEZABLE ,0 );if (!gfs2_control_wq) goto fail_recovery;
Tejun Heo
maintainerPATCH 7/9 xfs: WQ_NON_REENTRANT is meaningless and going away
In reply to Tejun HeoHello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of WQ_NON_REENTRANT which is already noop.
Thanks.
------ 8< -------dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op and the flag is going away. Remove its usages.
This patch doesn't introduce any behavior changes.
--- fs/xfs/xfs_super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/xfs/xfs_super.c +3 -3
@@ -870,17 +870,17 @@ xfs_init_mount_workqueues( goto out_destroy_unwritten; mp->m_reclaim_workqueue =alloc_workqueue ("xfs-reclaim/%s" , -WQ_NON_REENTRANT ,0 , mp->m_fsname); +0 ,0 , mp->m_fsname);if (!mp->m_reclaim_workqueue) goto out_destroy_cil; mp->m_log_workqueue =alloc_workqueue ("xfs-log/%s" , -WQ_NON_REENTRANT ,0 , mp->m_fsname); +0 ,0 , mp->m_fsname);if (!mp->m_log_workqueue) goto out_destroy_reclaim; mp->m_eofblocks_workqueue =alloc_workqueue ("xfs-eofblocks/%s" , -WQ_NON_REENTRANT ,0 , mp->m_fsname); +0 ,0 , mp->m_fsname);if (!mp->m_eofblocks_workqueue) goto out_destroy_log;
Signature · 6 lines
1.8.3.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 7/9] xfs: WQ_NON_REENTRANT is meaningless and going away
Quoted 12 lines · Tejun Heo
Hello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of
WQ_NON_REENTRANTwhich is already noop.Thanks.
------ 8< -------
dbf2576e37("workqueue: make all workqueues non-reentrant") madeWQ_NON_REENTRANTno-op and the flag is going away. Remove its usages.
Quoted 6 lines
This patch doesn't introduce any behavior changes.
Signed-off-by Tejun Heo <[email protected]>Cc Ben Myers <[email protected]>Cc Alex Elder <[email protected]>
Looks good.
Applied.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Tejun Heo
maintainerPATCH 8/9 ceph: WQ_NON_REENTRANT is meaningless and going away
In reply to Tejun HeoHello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of WQ_NON_REENTRANT which is already noop.
Thanks.
------ 8< -------dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op and the flag is going away. Remove its usages.
This patch doesn't introduce any behavior changes.
--- net/ceph/messenger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ceph/messenger.c +1 -1
@@ -290,7 +290,7 @@ int ceph_msgr_init(void)if (ceph_msgr_slab_init ())return -ENOMEM ; - ceph_msgr_wq =alloc_workqueue ("ceph-msgr" ,WQ_NON_REENTRANT ,0 ); + ceph_msgr_wq =alloc_workqueue ("ceph-msgr" ,0 ,0 );if (ceph_msgr_wq)return 0 ;
Signature · 1 line
1.8.3.1
Tejun Heo
maintainerPATCH 9/9 l2tp: WQ_NON_REENTRANT is meaningless and going away
In reply to Tejun HeoHello,
Please route this through the subsystem tree. As written in the description, this shouldn't make any functional difference and just prepares for the removal of WQ_NON_REENTRANT which is already noop.
Thanks.
------ 8< -------dbf2576e37 ("workqueue: make all workqueues non-reentrant") made WQ_NON_REENTRANT no-op and the flag is going away. Remove its usages.
This patch doesn't introduce any behavior changes.
--- net/l2tp/l2tp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/l2tp/l2tp_core.c +1 -1
@@ -1996,7 +1996,7 @@ static int __init l2tp_init(void)if (rc) goto out; - l2tp_wq =alloc_workqueue ("l2tp" ,WQ_NON_REENTRANT |WQ_UNBOUND ,0 ); + l2tp_wq =alloc_workqueue ("l2tp" ,WQ_UNBOUND ,0 );if (!l2tp_wq) {pr_err ("alloc_workqueue failed\n" ); rc = -ENOMEM ;
Signature · 1 line
1.8.3.1