From: Michal Hocko <mhocko@suse.com>
To: Zhongkun He <hezhongkun.hzk@bytedance.com>
Cc: hannes@cmpxchg.org, roman.gushchin@linux.dev,
linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
linux-mm@kvack.org, lizefan.x@bytedance.com,
wuyun.abel@bytedance.com
Subject: Re: [External] Re: [PATCH] cgroup/cpuset: Add a new isolated mems.policy type.
Date: Fri, 23 Sep 2022 09:29:03 +0200 [thread overview]
Message-ID: <Yy1gP7wcoCqzRa0B@dhcp22.suse.cz> (raw)
In-Reply-To: <120cb50d-d617-a60a-ec24-915f826318f1@bytedance.com>
On Wed 14-09-22 23:10:47, Zhongkun He wrote:
> > >
> > > > Back to the previous question.
> > > > > The question is how to implement that with a sensible semantic.
> > > >
> > > > Thanks for your analysis and suggestions.It is really difficult to add
> > > > policy directly to cgroup for the hierarchical enforcement. It
> > > > would be a good idea to add pidfd_set_mempolicy.
> > >
> > > Are you going to pursue that path?
>
> > Hi Michal, thanks for your suggestion and reply.
> >
> > > Are you going to pursue that path?
> >
> > Yes,I'll give it a try as it makes sense to modify the policy dynamically.
> >
> > Thanks.
>
> Hi Michal, i have a question about pidfd_set_mempolicy, it would be better
> if you have some suggestions.
>
> The task_struct of processes and threads are independent. If we change the
> mempolicy of the process through pidfd_set_mempolicy, the mempolicy of its
> thread will not change. Of course users can set the mempolicy of all threads
> by iterating through /proc/tgid/task.
>
> The question is whether we should override the thread's mempolicy when
> setting the process's mempolicy.
>
> There are two options:
> A:Change the process's mempolicy and set that mempolicy to all it's threads.
> B:Only change the process's mempolicy in kernel. The mempolicy of the thread
> needs to be modified by the user through pidfd_set_mempolicy in
> userspace, if necessary.
set_mempolicy is a per task_struct operation and so should be pidfd
based API as well. If somebody requires a per-thread-group setting then
the whole group should be iterated. I do not think we have any
precendence where pidfd operation on the thread group leader has side
effects on other threads as well.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2022-09-23 7:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-04 4:02 hezhongkun
2022-09-04 6:04 ` kernel test robot
2022-09-04 6:20 ` kernel test robot
2022-09-04 6:41 ` kernel test robot
2022-09-04 23:08 ` kernel test robot
2022-09-05 6:45 ` Michal Hocko
2022-09-05 10:30 ` [External] " Zhongkun He
2022-09-05 10:50 ` Michal Hocko
2022-09-06 10:37 ` Zhongkun He
2022-09-06 12:33 ` Michal Hocko
2022-09-07 13:50 ` Zhongkun He
2022-09-08 7:19 ` Michal Hocko
2022-09-09 2:55 ` Zhongkun He
2022-09-14 15:10 ` Zhongkun He
2022-09-23 7:29 ` Michal Hocko [this message]
2022-09-23 15:26 ` Zhongkun He
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=Yy1gP7wcoCqzRa0B@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hezhongkun.hzk@bytedance.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan.x@bytedance.com \
--cc=roman.gushchin@linux.dev \
--cc=wuyun.abel@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