Skip to contentSkip to conversation

cgroup/cpuset: Remove redundant sched domain rebuild from update_prstate()

PATCH Applied Guopeng Zhang 4 participants 4 messages Sep 20 – Sep 21

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cgroup/cpuset: Remove redundant sched domain rebuild from update_prstate()

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().

---
Changes in v2:
- Rename the patch to avoid the misleading "defer" wording.

 kernel/cgroup/cpuset.c | 2 --
 1 file changed, 2 deletions(-)
kernel/cgroup/cpuset.c +0 -2
index 8f24171b6055..d58ecf56f384 100644
@@ -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
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 26 lines · Guopeng Zhang

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().

---
Changes in v2:
- Rename the patch to avoid the misleading "defer" wording.

  kernel/cgroup/cpuset.c | 2 --
  1 file changed, 2 deletions(-)
kernel/cgroup/cpuset.c +0 -0
index 8f24171b6055..d58ecf56f384 100644

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
maintainer Reviewed-by on v2 1/1
#2 lore raw
In reply to Guopeng Zhang
Quoted 26 lines · Guopeng Zhang

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().

---
Changes in v2:
- Rename the patch to avoid the misleading "defer" wording.

  kernel/cgroup/cpuset.c | 2 --
  1 file changed, 2 deletions(-)
kernel/cgroup/cpuset.c +0 -0
index 8f24171b6055..d58ecf56f384 100644

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;
  }

LKTM