Hi Michal, thanks for your reply.
mempolicy has two functions, which nodes to choose and how to use these nodes. cpuset can only decide the first one,it equal to 'bind' mempolicy.
If cgroups support mempolicy, we can continue to develop more policy types. For example, allocate memory according to node weight, etc.
We would like to have more precise control over memory allocation in NUMA server.
On Tue, May 24, 2022 at 6:47 PM Michal Hocko <mhocko@xxxxxxxx> wrote:
On Tue 24-05-22 18:36:38, hezhongkun wrote:
> From: Hezhongkun <hezhongkun.hzk@xxxxxxxxxxxxx>
>
> Mempolicy is difficult to use because it is set in-process
> via a system call. We want to make it easier to use mempolicy
> in cgroups, so that we can control low-priority cgroups to
> allocate memory in specified nodes. So this patch want to
> adds the mempolicy interface.
>
> the mempolicy priority of memcgroup is higher than the priority
> of task. The order of getting the policy is,
> memcgroup->policy,task->policy or vma policy, default policy.
> memcgroup's policy is owned by itself, so descendants will
> not inherit it.
Why cannot you use cpuset cgroup?
--
Michal Hocko
SUSE Labs