ceph: make the ceph-cap workqueue UNBOUND
PATCH 1/1 ceph: make the ceph-cap workqueue UNBOUND
From: Xiubo Li <[email protected]>
There is not harm to mark the ceph-cap workqueue unbounded, just like we do in ceph-inode workqueue.
URL: https://www.spinics.net/lists/ceph-users/msg78775.html
URL: https://tracker.ceph.com/issues/64977
--- fs/ceph/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/super.c +1 -1
@@ -851,7 +851,7 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, fsc->inode_wq =alloc_workqueue ("ceph-inode" ,WQ_UNBOUND ,0 );if (!fsc->inode_wq) goto fail_client; - fsc->cap_wq =alloc_workqueue ("ceph-cap" ,0 ,1 ); + fsc->cap_wq =alloc_workqueue ("ceph-cap" ,WQ_UNBOUND ,1 );if (!fsc->cap_wq) goto fail_inode_wq;
Signature · 1 line
2.43.0
Ilya Dryomov
maintainerQuoted 19 lines · On Thu, Mar 21, 2024 at 3:18 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
There is not harm to mark the ceph-cap workqueue unbounded, just like we do in ceph-inode workqueue.
URL: https://www.spinics.net/lists/ceph-users/msg78775.html
URL: https://tracker.ceph.com/issues/64977Reported-by Stefan Kooman <[email protected]>Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/super.c +0
-0
fs/ceph/super.c static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, · line 854
Quoted 5 lines
fs/ceph/super.c +1
-1@@ -851,7 +851,7 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, fsc->inode_wq =alloc_workqueue ("ceph-inode" ,WQ_UNBOUND ,0 );if (!fsc->inode_wq) goto fail_client; - fsc->cap_wq =alloc_workqueue ("ceph-cap" ,0 ,1 ); + fsc->cap_wq =alloc_workqueue ("ceph-cap" ,WQ_UNBOUND ,1 );
Hi Xiubo,
You wrote that there is no harm in making ceph-cap workqueue unbound, but, if it's made unbound, it would be almost the same as ceph-inode workqueue. The only difference would be that max_active parameter for ceph-cap workqueue is 1 instead of 0 (i.e. some default which is pretty high). Given that max_active is interpreted as a per-CPU number even for unbound workqueues, up to $NUM_CPUS work items submitted to ceph-cap workqueue could still be active in a system.
Does CephFS need/rely on $NUM_CPUS limit sowewhere? If not, how about removing ceph-cap workqueue and submitting its work items to ceph-inode workqueue instead?
Thanks,
Ilya
Ilya Dryomov
maintainerQuoted 37 lines · Ilya Dryomov
Quoted 19 lines · On Thu, Mar 21, 2024 at 3:18 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
There is not harm to mark the ceph-cap workqueue unbounded, just like we do in ceph-inode workqueue.
URL: https://www.spinics.net/lists/ceph-users/msg78775.html
URL: https://tracker.ceph.com/issues/64977Reported-by Stefan Kooman <[email protected]>Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/super.c +0
-0fs/ceph/super.c static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, · line 854
Quoted 5 lines
fs/ceph/super.c +1
-1@@ -851,7 +851,7 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, fsc->inode_wq =alloc_workqueue ("ceph-inode" ,WQ_UNBOUND ,0 );if (!fsc->inode_wq) goto fail_client; - fsc->cap_wq =alloc_workqueue ("ceph-cap" ,0 ,1 ); + fsc->cap_wq =alloc_workqueue ("ceph-cap" ,WQ_UNBOUND ,1 );Hi Xiubo,
You wrote that there is no harm in making ceph-cap workqueue unbound, but, if it's made unbound, it would be almost the same as ceph-inode workqueue. The only difference would be that
max_activeparameter for ceph-cap workqueue is 1 instead of 0 (i.e. some default which is pretty high). Given thatmax_activeis interpreted as a per-CPU number even for unbound workqueues, up to $NUM_CPUS work items submitted to ceph-cap workqueue could still be active in a system.
Quoted 3 lines
Does CephFS need/rely on $NUM_CPUS limit sowewhere? If not, how about removing ceph-cap workqueue and submitting its work items to ceph-inode workqueue instead?
Related question: why ceph_force_reconnect() flushes only one of these workqueues (ceph-inode) instead of both? When invalidating everything, aren't we concerned with potential stale work items from before the session is recovered?
Thanks,
Ilya
A message that is not in the archive (sent off-list or not yet received): [email protected]
Ilya Dryomov
maintainerQuoted 40 lines · Xiubo Li
On 5/21/24 03:37, Ilya Dryomov wrote:
On Thu, Mar 21, 2024 at 3:18 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
There is not harm to mark the ceph-cap workqueue unbounded, just like we do in ceph-inode workqueue.
URL: https://www.spinics.net/lists/ceph-users/msg78775.html
URL: https://tracker.ceph.com/issues/64977Reported-by Stefan Kooman <[email protected]>Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/super.c +1
-1@@ -851,7 +851,7 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, fsc->inode_wq =alloc_workqueue ("ceph-inode" ,WQ_UNBOUND ,0 );if (!fsc->inode_wq) goto fail_client; - fsc->cap_wq =alloc_workqueue ("ceph-cap" ,0 ,1 ); + fsc->cap_wq =alloc_workqueue ("ceph-cap" ,WQ_UNBOUND ,1 ); Hi Xiubo,You wrote that there is no harm in making ceph-cap workqueue unbound, but, if it's made unbound, it would be almost the same as ceph-inode workqueue. The only difference would be that
max_activeparameter for ceph-cap workqueue is 1 instead of 0 (i.e. some default which is pretty high). Given thatmax_activeis interpreted as a per-CPU number even for unbound workqueues, up to $NUM_CPUS work items submitted to ceph-cap workqueue could still be active in a system.
Quoted 7 lines
Does CephFS need/rely on $NUM_CPUS limit sowewhere? If not, how about removing ceph-cap workqueue and submitting its work items to ceph-inode workqueue instead?
Checked it again and found that an UNBOUND and max_active==1 combo has a special meaning:
Some users depend on the strict execution ordering of ST wq. The combination of @max_active of 1 and
WQ_UNBOUNDis used to achieve this behavior. Work items on such wq are always queued to the unbound worker-pools and only one work item can be active at any given time thus achieving the same ordering property as ST wq.
This hasn't been true for 10 years, see commit
Thanks,
Ilya
Quoted 44 lines · Ilya Dryomov
Quoted 43 lines · Xiubo Li
On 5/21/24 03:37, Ilya Dryomov wrote:
On Thu, Mar 21, 2024 at 3:18 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
There is not harm to mark the ceph-cap workqueue unbounded, just like we do in ceph-inode workqueue.
URL: https://www.spinics.net/lists/ceph-users/msg78775.html
URL: https://tracker.ceph.com/issues/64977Reported-by Stefan Kooman <[email protected]>Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/super.c +1
-1@@ -851,7 +851,7 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, fsc->inode_wq =alloc_workqueue ("ceph-inode" ,WQ_UNBOUND ,0 );if (!fsc->inode_wq) goto fail_client; - fsc->cap_wq =alloc_workqueue ("ceph-cap" ,0 ,1 ); + fsc->cap_wq =alloc_workqueue ("ceph-cap" ,WQ_UNBOUND ,1 ); Hi Xiubo,You wrote that there is no harm in making ceph-cap workqueue unbound, but, if it's made unbound, it would be almost the same as ceph-inode workqueue. The only difference would be that
max_activeparameter for ceph-cap workqueue is 1 instead of 0 (i.e. some default which is pretty high). Given thatmax_activeis interpreted as a per-CPU number even for unbound workqueues, up to $NUM_CPUS work items submitted to ceph-cap workqueue could still be active in a system.Does CephFS need/rely on $NUM_CPUS limit sowewhere? If not, how about removing ceph-cap workqueue and submitting its work items to ceph-inode workqueue instead?
Quoted 6 lines
Quoted 3 lines
Checked it again and found that an UNBOUND and max_active==1 combo has a special meaning:
Some users depend on the strict execution ordering of ST wq. The combination of @max_active of 1 and
WQ_UNBOUNDis used to achieve this behavior. Work items on such wq are always queued to the unbound worker-pools and only one work item can be active at any given time thus achieving the same ordering property as ST wq.This hasn't been true for 10 years, see commit
Okay, I found the doc I read is out of date.
- Xiubo
Quoted 4 lines
Thanks,
Ilya