[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c05bdeac-b354-0ac7-3233-27f8e5cbb38a@bytedance.com>
Date: Mon, 5 Sep 2022 18:30:38 +0800
From: Zhongkun He <hezhongkun.hzk@...edance.com>
To: Tejun Heo <tj@...nel.org>
Cc: lizefan.x@...edance.com, hannes@...xchg.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [Phishing Risk] [External] Re: [PATCH] cgroup/cpuset: Add a new
isolated mems.policy type.
Hi Tejun, thanks for your reply.
We usually use numactl to set the memory policy, but it cannot be
changed dynamically. In addition, the mempolicy of cpuset can provide a
more convenient interface for management and control panel.
Sorry,I don't quite understand the meaning of "don't enforce anything
resource related". Does it mean mempolicy, such as "prefer:2" must
specify node? Or "cpuset.mems.policy" need to specify a default value?
(cpuset.mems.policy does not require a default value.)
Thanks.
> Hello,
>
> On Fri, Sep 02, 2022 at 02:33:03PM +0800, hezhongkun wrote:
>> From: Zhongkun He <hezhongkun.hzk@...edance.com>
>>
>> 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 cpuset, and we can control low-priority cgroups to
>> allocate memory in specified nodes. So this patch want to
>> adds the mempolicy interface in cpuset.
>>
>> The mempolicy priority of cpuset is lower than the task.
>> The order of getting the policy is:
>> 1) vma mempolicy
>> 2) task->mempolicy
>> 3) cpuset->mempolicy
>> 4) default policy.
>>
>> cpuset's policy is owned by itself, but descendants will
>> get the default mempolicy from parent.
>>
>> How to use the mempolicy interface:
>> echo prefer:2 > /sys/fs/cgroup/zz/cpuset.mems.policy
>> echo bind:1-3 > /sys/fs/cgroup/zz/cpuset.mems.policy
>> echo interleave:0,1,2,3 >/sys/fs/cgroup/zz/cpuset.mems.policy
>> Show the policy:
>> cat /sys/fs/cgroup/zz/cpuset.mems.policy
>> prefer:2
>> cat /sys/fs/cgroup/zz/cpuset.mems.policy
>> bind:1-3
>> cat /sys/fs/cgroup/zz/cpuset.mems.policy
>> interleave:0-3
>> Clear the policy:
>> echo default > /sys/fs/cgroup/zz/cpuset.mems.policy
>
> So, I'm a fan of adding cgroup functionalities which don't enforce anything
> resource related. What you're proposing can easily be achieved with userland
> tooling, right?
>
> Thanks.
>
Powered by blists - more mailing lists