cgroup/cpuset: Defer sched domain rebuild to common unlock path
Subsystems (2)
PATCH 1/1 cgroup/cpuset: Defer sched domain rebuild to common unlock path
From: Guopeng Zhang <[email protected]>
Both callers of update_prstate(), cpuset_partition_write() and cpuset_css_killed(), call cpuset_update_sd_hk_unlock() immediately afterwards. That helper rebuilds sched domains when force_sd_rebuild is set before releasing the cpuset locks, so the check in update_prstate() is redundant.
Commit 3bfe47967191 ("cgroup/cpuset: Move housekeeping_update()/rebuild_sched_domains() together") removed the same check from cpuset_write_resmask(). Remove the remaining one from update_prstate().
--- kernel/cgroup/cpuset.c | 2 -- 1 file changed, 2 deletions(-)
kernel/cgroup/cpuset.c +0 -2
@@ -3039,8 +3039,6 @@ out:update_partition_sd_lb (cs, old_prs);notify_partition_change (cs, old_prs); -if (force_sd_rebuild) -rebuild_sched_domains_locked ();free_tmpmasks (&tmpmask);return 0 ; }
Signature · 1 line
2.43.0
Ridong Chen
reviewerQuoted 23 lines · Guopeng Zhang
From: Guopeng Zhang <[email protected]>
Both callers of
update_prstate(),cpuset_partition_write()andcpuset_css_killed(), callcpuset_update_sd_hk_unlock()immediately afterwards. That helper rebuilds sched domains whenforce_sd_rebuildis set before releasing the cpuset locks, so the check inupdate_prstate()is redundant.Commit
3bfe47967191("cgroup/cpuset: Move housekeeping_update()/rebuild_sched_domains() together") removed the same check fromcpuset_write_resmask(). Remove the remaining one fromupdate_prstate().Signed-off-by Guopeng Zhang <[email protected]>--- kernel/cgroup/cpuset.c | 2 -- 1 file changed, 2 deletions(-)kernel/cgroup/cpuset.c +0
-0
kernel/cgroup/cpuset.c out: · line 3044
Quoted 8 lines
kernel/cgroup/cpuset.c +0
-2@@ -3039,8 +3039,6 @@ out:update_partition_sd_lb (cs, old_prs);notify_partition_change (cs, old_prs); -if (force_sd_rebuild) -rebuild_sched_domains_locked ();free_tmpmasks (&tmpmask);return 0 ; }
This title is confusing. I thought you were doing some async work, what does "defer" mean here? In fact, it just removes a piece of redundant code.
Signature · 2 lines
Best regards Ridong
Quoted 21 lines · Ridong Chen
Quoted 18 lines · Guopeng Zhang
From: Guopeng Zhang <[email protected]>
Both callers of
update_prstate(),cpuset_partition_write()andcpuset_css_killed(), callcpuset_update_sd_hk_unlock()immediately afterwards. That helper rebuilds sched domains whenforce_sd_rebuildis set before releasing the cpuset locks, so the check inupdate_prstate()is redundant.Commit
3bfe47967191("cgroup/cpuset: Move housekeeping_update()/rebuild_sched_domains() together") removed the same check fromcpuset_write_resmask(). Remove the remaining one fromupdate_prstate().Signed-off-by Guopeng Zhang <[email protected]>---
kernel/cgroup/cpuset.c| 2 --1 file changed, 2 deletions(-)
Quoted 15 lines
kernel/cgroup/cpuset.c out: · line 3043
Quoted 12 lines
kernel/cgroup/cpuset.c +0
-2@@ -3039,8 +3039,6 @@ out: update_partition_sd_lb(cs, old_prs); notify_partition_change(cs, old_prs); - if (force_sd_rebuild) - rebuild_sched_domains_locked(); free_tmpmasks(&tmpmask); return 0; }This title is confusing. I thought you were doing some async work, what does "defer" mean here? In fact, it just removes a piece of redundant code.
Thanks for the review.
I misunderstood this. I used "Defer" because the rebuild still happens later in cpuset_update_sd_hk_unlock().
You're right, the title is confusing. I'll fix it in v2.
Thanks,
Guopeng
Quoted 23 lines · Guopeng Zhang
From: Guopeng Zhang <[email protected]>
Both callers of
update_prstate(),cpuset_partition_write()andcpuset_css_killed(), callcpuset_update_sd_hk_unlock()immediately afterwards. That helper rebuilds sched domains whenforce_sd_rebuildis set before releasing the cpuset locks, so the check inupdate_prstate()is redundant.Commit
3bfe47967191("cgroup/cpuset: Move housekeeping_update()/rebuild_sched_domains() together") removed the same check fromcpuset_write_resmask(). Remove the remaining one fromupdate_prstate().Signed-off-by Guopeng Zhang <[email protected]>--- kernel/cgroup/cpuset.c | 2 -- 1 file changed, 2 deletions(-)kernel/cgroup/cpuset.c +0
-0
kernel/cgroup/cpuset.c out: · line 3044
Quoted 8 lines
kernel/cgroup/cpuset.c +0
-2@@ -3039,8 +3039,6 @@ out:update_partition_sd_lb (cs, old_prs);notify_partition_change (cs, old_prs); -if (force_sd_rebuild) -rebuild_sched_domains_locked ();free_tmpmasks (&tmpmask);return 0 ; }
Thanks.
Signature · 2 lines
Best regards Ridong
Ridong Chen
reviewerQuoted 35 lines · Ridong Chen
Quoted 23 lines · Guopeng Zhang
From: Guopeng Zhang <[email protected]>
Both callers of
update_prstate(),cpuset_partition_write()andcpuset_css_killed(), callcpuset_update_sd_hk_unlock()immediately afterwards. That helper rebuilds sched domains whenforce_sd_rebuildis set before releasing the cpuset locks, so the check inupdate_prstate()is redundant.Commit
3bfe47967191("cgroup/cpuset: Move housekeeping_update()/rebuild_sched_domains() together") removed the same check fromcpuset_write_resmask(). Remove the remaining one fromupdate_prstate().Signed-off-by Guopeng Zhang <[email protected]>---
kernel/cgroup/cpuset.c| 2 --1 file changed, 2 deletions(-)kernel/cgroup/cpuset.c +0
-0kernel/cgroup/cpuset.c out: · line 3043
Quoted 7 lines
kernel/cgroup/cpuset.c +0
-2@@ -3039,8 +3039,6 @@ out: update_partition_sd_lb(cs, old_prs); notify_partition_change(cs, old_prs); - if (force_sd_rebuild) - rebuild_sched_domains_locked(); free_tmpmasks(&tmpmask); return 0; }Reviewed-by Ridong Chen <[email protected]>
Quoted 1 line
Thanks.
Sorry, this was sent by mistake.
Signature · 2 lines
Best regards Ridong