From: Waiman Long <llong@redhat.com>
To: Chuyi Zhou <zhouchuyi@bytedance.com>,
tj@kernel.org, mkoutny@suse.com, hannes@cmpxchg.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] cpuset: Don't always flush cpuset_migrate_mm_wq in cpuset_write_resmask
Date: Thu, 4 Sep 2025 11:12:43 -0400 [thread overview]
Message-ID: <5e9efe12-0f59-4836-81cd-d39805f3b243@redhat.com> (raw)
In-Reply-To: <20250904074505.1722678-2-zhouchuyi@bytedance.com>
On 9/4/25 3:45 AM, Chuyi Zhou wrote:
> 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>
> ---
> kernel/cgroup/cpuset.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 27adb04df675d..3d8492581c8c4 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -3256,7 +3256,8 @@ ssize_t cpuset_write_resmask(struct kernfs_open_file *of,
> out_unlock:
> mutex_unlock(&cpuset_mutex);
> cpus_read_unlock();
> - flush_workqueue(cpuset_migrate_mm_wq);
> + if (of_cft(of)->private == FILE_MEMLIST)
> + flush_workqueue(cpuset_migrate_mm_wq);
> return retval ?: nbytes;
> }
>
LGTM
Reviewed-by: Waiman Long <longman@redhat.com>
next prev parent reply other threads:[~2025-09-04 15:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 7:45 [PATCH 0/3] Defer flushing of the cpuset_migrate_mm_wq to task_work Chuyi Zhou
2025-09-04 7:45 ` [PATCH 1/3] cpuset: Don't always flush cpuset_migrate_mm_wq in cpuset_write_resmask Chuyi Zhou
2025-09-04 14:30 ` Michal Koutný
2025-09-04 15:12 ` Waiman Long [this message]
2025-09-04 17:15 ` Tejun Heo
2025-09-04 7:45 ` [PATCH 2/3] cpuset: Defer flushing of the cpuset_migrate_mm_wq to task_work Chuyi Zhou
2025-09-04 15:14 ` Waiman Long
2025-09-04 7:45 ` [PATCH 3/3] cgroup: Remove unused cgroup_subsys::post_attach Chuyi Zhou
2025-09-04 15:17 ` Waiman Long
2025-09-04 17:27 ` [PATCH 0/3] Defer flushing of the cpuset_migrate_mm_wq to task_work Tejun Heo
2025-09-05 2:15 ` Chuyi Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e9efe12-0f59-4836-81cd-d39805f3b243@redhat.com \
--to=llong@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
--cc=zhouchuyi@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®