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 9B1EDECAAD3 for ; Mon, 5 Sep 2022 10:31:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 232FD801D3; Mon, 5 Sep 2022 06:31:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E24F8D0050; Mon, 5 Sep 2022 06:31:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0AAAD801D3; Mon, 5 Sep 2022 06:31:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EF16B8D0050 for ; Mon, 5 Sep 2022 06:31:09 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CC61440B9B for ; Mon, 5 Sep 2022 10:31:09 +0000 (UTC) X-FDA: 79877664258.06.2B84DE5 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf05.hostedemail.com (Postfix) with ESMTP id CE801100077 for ; Mon, 5 Sep 2022 10:31:08 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id fv3so1922398pjb.0 for ; Mon, 05 Sep 2022 03:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date; bh=08C+VXVc0IMFZrrErYdVw4bP2ZSZwMhBjMLfYmODNYY=; b=5qJtR8o8q181yaW02Pelm8vTh5nB2r4JcZaAQf0dDH/GMDD0eJ3Idryy96VUutJSOz KQ5J9dfV/XmiSfy5EmB0QFQTPnznNeCLysW/MtuxyOf9or/9pCi7+kTulpJV0lqNPJaQ l+qYtBb67hvNTpaB8DY83GYE8wxcqjjYVCk6I1zxMATw+o/9r/pyKNIOVDLDTLlVpS0N mjwDdQQgRjmDm88FKrmPj0gSJ5pK7bPiwQ+N+4s+ZDrbz3QrdEkhWW4XHITKpitraDVS JxW2ocZ64qsQC7v9cRrVwhvjFX0BsZnzhBr9owyS4NVMexUpNLtQvfy3woNaTPNw5LTq 1snw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=08C+VXVc0IMFZrrErYdVw4bP2ZSZwMhBjMLfYmODNYY=; b=gh79xaFVsAI4azAcfU7zX90tLrjXMbpmIH6/NMjtHg+kYTApQx4aQRP3jsiAfitFPi tcTRLTV9OsGMfeXm8zsymAC+5oAuLhIwxh7nZFeDZUIB9IUY1Vi/iuQQBtKuciXSSj+7 5MSTQh4d8wGGZ4f1e/4UbsNQSXDKeHi65ht3iqd6pvXIqhAxYKg+XJAon4hGqfY+SCKy kkZoKCHMWIFjWBoA0XkUrkrsCcInz4tPeRobNaPCiGFrSpJRn5d5HylgwzAVfJLn0cRj nCXqDAuiEzLaOrROSojRAfjyVffqBmZ/dsiwhFEFnXb5qssrNgT/baSWLWt6dWRF6c+g 515Q== X-Gm-Message-State: ACgBeo0/pDLLN5hAZfEDUjsArf4kQm5+b5z5lOfYXV53IEO5PdXDFvdq 0oKNI31it7yArqrLOF3NRPhTKPt+PubEwQ== X-Google-Smtp-Source: AA6agR7gFWof19I/xutyLSVCT2f+PsYjQouLLkyLJQ2fOpfCDSCz/eWBBqTJ20QLUG+Rzd90AMtE/Q== X-Received: by 2002:a17:90a:4fa3:b0:200:8ba3:94bc with SMTP id q32-20020a17090a4fa300b002008ba394bcmr164449pjh.21.1662373867667; Mon, 05 Sep 2022 03:31:07 -0700 (PDT) Received: from [10.4.229.138] ([139.177.225.232]) by smtp.gmail.com with ESMTPSA id r10-20020a17090b050a00b0020080e8c8besm950991pjz.40.2022.09.05.03.31.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Sep 2022 03:31:07 -0700 (PDT) Message-ID: <0e5f380b-9201-0f56-9144-ce8449491fc8@bytedance.com> Date: Mon, 5 Sep 2022 18:30:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [External] Re: [PATCH] cgroup/cpuset: Add a new isolated mems.policy type. 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, wuyun.abel@bytedance.com References: <20220904040241.1708-1-hezhongkun.hzk@bytedance.com> From: Zhongkun He In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5qJtR8o8; spf=pass (imf05.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662373869; a=rsa-sha256; cv=none; b=Dmalg39h3EATZVgrQXvZZ46cPGundqENaSYnMHBE5x/borF64l3qhd4fnZGZ9eHuo8JwfL whvR/1lTtIF/O0x8BBMZbowSemtL4xk76DL0cWwKNs5dr5FvDkhkDzcPsKYH6AqEEyNxOM Ndr+pQL3aSj53gvM+t5jLPT3O+WZn8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662373869; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=08C+VXVc0IMFZrrErYdVw4bP2ZSZwMhBjMLfYmODNYY=; b=DCcvbbOh31C6ydLGtKi6ktRpkVHRm9RBX9ZD3Dm2H8qPIj4CTGsC2b6WRG6SelXcJoIs+H ZcxXkjQqMEp1YZYoLEcvH5svofav5gU6EWoxkijtmXpvX4XLS9B60+ZTJFhKH61K4FwO11 Ve/TzGLpae/p+MPW8PlNvT54h/fLyGE= X-Rspamd-Server: rspam02 X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5qJtR8o8; spf=pass (imf05.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: 68ea77mt4nrchrzdc31ksgz41raco7st X-Rspamd-Queue-Id: CE801100077 X-HE-Tag: 1662373868-976743 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: Hi Michal, thanks for your reply. The current 'mempolicy' is hierarchically independent. The default value of the child is to inherit from the parent. The modification of the child policy will not be restricted by the parent. Of course, there are other options, such as the child's policy mode must be the same as the parent's. node can be the subset of parent's, but the interleave type will be complicated, that's why hierarchy independence is used. It would be better if you have other suggestions? Thanks. > On Sun 04-09-22 12:02:41, hezhongkun wrote: >> From: Zhongkun He >> >> 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. > > What is the hierarchical behavior of the policy? Say parent has a > stronger requirement (say bind) than a child (prefer)? > >> 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 > > Am I just confused or did you really mean to combine all these > together?