From: Zhongkun He <hezhongkun.hzk@bytedance.com>
To: Michal Hocko <mhocko@suse.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, 9 Sep 2022 10:55:55 +0800 [thread overview]
Message-ID: <fa5e5a79-aa1a-a009-d0c8-0a39380a71b6@bytedance.com> (raw)
In-Reply-To: <YxmXeC7te2HAi4dX@dhcp22.suse.cz>
> On Wed 07-09-22 21:50:24, Zhongkun He wrote:
> [...]
>>> Do you really need to change the policy itself or only the effective
>>> nodemask? Do you need any other policy than bind and preferred?
>>
>> Yes, we need to change the policy, not only his nodemask. we really want
>> policy is interleave, and extend it to weight-interleave.
>> Say something like the following
>> node weight
>> interleave: 0-3 1:1:1:1 default one by one
>> weight-interleave: 0-3 1:2:4:6 alloc pages by weight
>> (User set weight.)
>> In the actual usecase, the remaining resources of each node are different,
>> and the use of interleave cannot maximize the use of resources.
>
> OK, this seems a separate topic. It would be good to start by proposing
> that new policy in isolation with the semantic description.
>
>> 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?
>
>> Also, there is a new idea.
>> We can try to separate the elements of mempolicy and use them independently.
>> Mempolicy has two meanings:
>> nodes:which nodes to use(nodes,0-3), we can use cpuset's effective_mems
>> directly.
>> mode:how to use them(bind,prefer,etc). change the mode to a
>> cpuset->flags,such as CS_INTERLEAVE。
>> task_struct->mems_allowed is equal to cpuset->effective_mems,which is
>> hierarchical enforcement。CS_INTERLEAVE can also be updated into tasks,
>> just like other flags(CS_SPREAD_PAGE).
>> When a process needs to allocate memory, it can find the appropriate node to
>> allocate pages according to the flag and mems_allowed.
>
> I am not sure I see the advantage as the mode and nodes are always
> closely coupled. You cannot really have one wihtout the other.
>
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.
next prev parent reply other threads:[~2022-09-09 2:56 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 [this message]
2022-09-14 15:10 ` Zhongkun He
2022-09-23 7:29 ` Michal Hocko
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=fa5e5a79-aa1a-a009-d0c8-0a39380a71b6@bytedance.com \
--to=hezhongkun.hzk@bytedance.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan.x@bytedance.com \
--cc=mhocko@suse.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