cgwb_release_wq was added to isolate and limit the concurrency level of cgwb release work items. The max concurrency was set to 1 per CPU but we do want some level of concurrency as otherwise it ends up calling, through bdi_unregister(), synchronize_sched_expedited() back-to-back for each release work item.
Let's allow them to bunch up a bit. Signed-off-by: Tejun Heo <[email protected]> Suggested-by: Rik van Riel <[email protected]> --- mm/backing-dev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 8fe3ebd..f9a2268 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -790,9 +790,10 @@ static int __init cgwb_init(void) /* * There can be many concurrent release work items overwhelming * system_wq. Put them in a separate wq and limit concurrency. - * There's no point in executing many of these in parallel. + * Allow some level of concurrency so that we can batch on + * synchronize_rcu_expedited() calls in bdi_unregister(). */ - cgwb_release_wq = alloc_workqueue("cgwb_release", 0, 1); + cgwb_release_wq = alloc_workqueue("cgwb_release", 0, 16); if (!cgwb_release_wq) return -ENOMEM;

