diff options
| author | Chuyi Zhou <zhouchuyi@bytedance.com> | 2025-09-04 15:45:03 +0800 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2025-09-04 07:15:30 -1000 |
| commit | c0fb16ef887d364766d03574ec824509939cf9cc (patch) | |
| tree | 1a088154d9cc20777087e819aa9305e047d69a4b | |
| parent | e117ff1129daa7d63536833f39285e50ad52379d (diff) | |
cpuset: Don't always flush cpuset_migrate_mm_wq in cpuset_write_resmask
It is unnecessary to always wait for the flush operation of
cpuset_migrate_mm_wq to complete in cpuset_write_resmask, as modifying
cpuset.cpus or cpuset.exclusive does not trigger mm migrations. The
flush_workqueue can be executed only when cpuset.mems is modified.
Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
Reviewed-by: Michal Koutný <mkoutny@suse.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
| -rw-r--r-- | kernel/cgroup/cpuset.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index c0c281a8860d..9fc20ef97d7e 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -3291,7 +3291,8 @@ ssize_t cpuset_write_resmask(struct kernfs_open_file *of, rebuild_sched_domains_locked(); out_unlock: cpuset_full_unlock(); - flush_workqueue(cpuset_migrate_mm_wq); + if (of_cft(of)->private == FILE_MEMLIST) + flush_workqueue(cpuset_migrate_mm_wq); return retval ?: nbytes; } |
