public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
To: Zhongkun He <hezhongkun.hzk-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
Cc: hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org,
	wuyun.abel-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org
Subject: Re: [External] Re: [PATCH] cgroup/cpuset: Add a new isolated mems.policy type.
Date: Thu, 8 Sep 2022 09:19:20 +0200	[thread overview]
Message-ID: <YxmXeC7te2HAi4dX@dhcp22.suse.cz> (raw)
In-Reply-To: <93d76370-6c43-5560-9a5f-f76a8cc979e0-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>

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.

-- 
Michal Hocko
SUSE Labs

  parent reply	other threads:[~2022-09-08  7:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-04  4:02 [PATCH] cgroup/cpuset: Add a new isolated mems.policy type hezhongkun
2022-09-04  6:04 ` kernel test robot
2022-09-04  6:20 ` kernel test robot
     [not found] ` <20220904040241.1708-1-hezhongkun.hzk-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
2022-09-04  6:41   ` kernel test robot
2022-09-05  6:45   ` Michal Hocko
     [not found]     ` <YxWbBYZKDTrkmlOe-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-09-05 10:30       ` [External] " Zhongkun He
     [not found]         ` <0e5f380b-9201-0f56-9144-ce8449491fc8-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
2022-09-05 10:50           ` Michal Hocko
     [not found]             ` <YxXUjvWmZoG9vVNV-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-09-06 10:37               ` Zhongkun He
     [not found]                 ` <ca5e57fd-4699-2cec-b328-3d6bac43c8ef-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
2022-09-06 12:33                   ` Michal Hocko
     [not found]                     ` <Yxc+HZ6rjcR535oN-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-09-07 13:50                       ` Zhongkun He
     [not found]                         ` <93d76370-6c43-5560-9a5f-f76a8cc979e0-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
2022-09-08  7:19                           ` Michal Hocko [this message]
     [not found]                             ` <YxmXeC7te2HAi4dX-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-09-09  2:55                               ` Zhongkun He
     [not found]                                 ` <fa5e5a79-aa1a-a009-d0c8-0a39380a71b6-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
2022-09-14 15:10                                   ` Zhongkun He
     [not found]                                     ` <120cb50d-d617-a60a-ec24-915f826318f1-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
2022-09-23  7:29                                       ` Michal Hocko
     [not found]                                         ` <Yy1gP7wcoCqzRa0B-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-09-23 15:26                                           ` Zhongkun He
2022-09-04 23:08 ` kernel test robot

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=YxmXeC7te2HAi4dX@dhcp22.suse.cz \
    --to=mhocko-ibi9rg/b67k@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=hezhongkun.hzk-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org \
    --cc=roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org \
    --cc=wuyun.abel-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org \
    /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