From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 817B6C433EF for ; Tue, 24 May 2022 11:46:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA9368D0003; Tue, 24 May 2022 07:46:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5C798D0001; Tue, 24 May 2022 07:46:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C47738D0003; Tue, 24 May 2022 07:46:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B84B48D0001 for ; Tue, 24 May 2022 07:46:52 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 801A9354C3 for ; Tue, 24 May 2022 11:46:52 +0000 (UTC) X-FDA: 79500459864.17.B327DC6 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf05.hostedemail.com (Postfix) with ESMTP id 32EB710003A for ; Tue, 24 May 2022 11:46:23 +0000 (UTC) Received: by mail-pl1-f177.google.com with SMTP id d22so15619990plr.9 for ; Tue, 24 May 2022 04:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7vv09c1EkxFd+C0EjYfVy6SOYQ85vZP9Iqb4xMXECag=; b=c0H72Mm9MhDF7liLOlgVo9KF0B6jCCSEMGsKBRdWU2BxDkEQsTn45F2xgAPpVnXden /QBEmJ0aCN646ION5mC05ILXiyIrBMnNsCaSwkuK12mI0xoUaMikjpdE1T/Ra389I5vl ukF7ATyWuw8FRfyXH1MwC+JtsHTyPWuhLvlBfNBAYWYKgnejx7JRhWyD9t0JBH/Ux3lq Fg6fQ/xuFPCtIHdyioR4mE6P24JTZw99A25/QhQiAEoChTDfWvhiUcIgo2mhqV6rfMez I3peaD2IpybhCt+2A7Ud6Ho5scRHxzU99cl60O7FZyzE9kzy8f1aatUTPGzxkma0yURJ ZmFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7vv09c1EkxFd+C0EjYfVy6SOYQ85vZP9Iqb4xMXECag=; b=eqJWM/Y4C7TiDO7BR1wARC8uSfBadUUQ/MEbbV5PtoeE3WMeph4alhtxPFRV0WwLOu /MH8b6IkPOF5b5Z2JcTQblLw1I4euZ2wHyeS740X24wJKT8DoP8wsjmCBAA2uVjyHc9u dufwyXoxdpcdRzbf3sT4Dqyr/S5SfMO8phuWi2Zq4HsGvqm13sIy2/ss8jeRbjjZ/Axp j2pokMqmThyr5XvR0cuQY/iMfLAGM1mnaObdPGLi4UvEmfCXz16KMMGIvzYbPrcqgrvJ 9f614+FETtsV1ug5yxjh8bxVPpWqg418zPNgps0kqJvG/xpsWiex5VP+lc0TleR/HV4S 5M6Q== X-Gm-Message-State: AOAM531DT4ZHQatgF2iX3uycA+KQ4i7jVzR0rXsbSWiRIB/M0W+PciYb 99eJSHCo5uc2m3hfT3pmjEiW9R+vFxblTNSTW/1yMw== X-Google-Smtp-Source: ABdhPJzrTlAQ2Sp2UC+AhuriOqCZLpVnrZEVGrZZ4KQWl0Qdkkuxk7Y1N8JVaTMWxpqT1O/T1Y3QQK44bQdrBbq2ij0= X-Received: by 2002:a17:903:481:b0:161:6392:c350 with SMTP id jj1-20020a170903048100b001616392c350mr27347499plb.17.1653392810159; Tue, 24 May 2022 04:46:50 -0700 (PDT) MIME-Version: 1.0 References: <20220524103638.473-1-hezhongkun.hzk@bytedance.com> In-Reply-To: From: =?UTF-8?B?6LS65Lit5Z2k?= Date: Tue, 24 May 2022 19:46:38 +0800 Message-ID: Subject: Re: [External] Re: [PATCH] mm: memcontrol: add the mempolicy interface for cgroup v2. To: Michal Hocko 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 Content-Type: multipart/alternative; boundary="00000000000020201205dfc08348" Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=c0H72Mm9; spf=pass (imf05.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspam-User: X-Stat-Signature: eet6uuz3e5yufz9mpiwspw9m6n5x61xg X-Rspamd-Queue-Id: 32EB710003A X-Rspamd-Server: rspam01 X-HE-Tag: 1653392783-556074 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --00000000000020201205dfc08348 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=EF=BC=8Cit equal to 'bind' memp= olicy. 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 wrote: > On Tue 24-05-22 18:36:38, hezhongkun wrote: > > From: Hezhongkun > > > > 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 > --00000000000020201205dfc08348 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Michal, thanks for your reply.
mempolicy has two fu= nctions, which nodes to choose and how to use these nodes.=C2=A0cpuset can = only decide the first one=EF=BC=8Cit equal to 'bind' mempolicy.
If cgroups support mempolicy, we can continue to develop more policy= types.=C2=A0For example, allocate memory according to node weight, etc.
We would like to have more precise control over memory allocation i= n=C2=A0NUMA server.

On Tue, May 24, 2022 at 6:47 PM Michal Hocko = <mhocko@suse.com> wrote:
On Tue 24-05-22 18:36= :38, hezhongkun wrote:
> From: Hezhongkun <hezhongkun.hzk@bytedance.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 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
--00000000000020201205dfc08348--