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 CEAABC433F5 for ; Thu, 12 May 2022 07:22:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1829C6B0074; Thu, 12 May 2022 03:22:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 131786B0075; Thu, 12 May 2022 03:22:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F13216B0078; Thu, 12 May 2022 03:22:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id DFD886B0074 for ; Thu, 12 May 2022 03:22:45 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AC3AD316E0 for ; Thu, 12 May 2022 07:22:45 +0000 (UTC) X-FDA: 79456248690.21.B0849CF Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) by imf17.hostedemail.com (Postfix) with ESMTP id F21F1400B0 for ; Thu, 12 May 2022 07:22:25 +0000 (UTC) Received: by mail-vs1-f50.google.com with SMTP id e10so4309751vsr.1 for ; Thu, 12 May 2022 00:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+47ZJ5j0kmxI/lG0OiobIxpstGwfhpvNpvMEZldSxdk=; b=MuT9tsxoUEIIaxiykQc0WLAgcqyuwhOycLY1xIEQd7ISyb9br2bf1LLu+S4UYj8lj3 8m8ze6NTZqKhc0v5SyIPcQuA1R4qBoZA8Q6lAtk8HXB52Dd5KPqt+Ds+6dH7RyNc3TYi 4AgMOAq57JN+k1UxDq7cpOQpSH1gnBZ0NE0rApDav0VPZa8lkVnuA+LUVltiiB7L5/LT g+vwuxnOgeYHHjNqvZPl+cxcTVHhC6k5l3263yTd4OfbT2B8/zHLPCZKdpEIT8k65Rzx nC4cty7D55MnVNslHa/C0HTGsyrzh8pMo1+YsLZSQVkxb3aQMO1mdX3GOhlYcRB2+GJC 6Osw== 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=+47ZJ5j0kmxI/lG0OiobIxpstGwfhpvNpvMEZldSxdk=; b=5Hr2GROJ2Qakgx5shAD6BwNwJ639qsGUf0yeJk1MS6lRO4lz0FBEQhGr8rB0lPyNkn x73gmwBHGMVkTr+2ajAIb5N+CzP2JLxqDH0gNiHFUgT6/59tprKGHj/r2UEoNqRKqQQT vsIrYbpGVRLTHBGko5cRBGS0v7OF2QdYM9tHSnkuKv+CcEc2qTV+qGGDM2zYJNb9fFbZ 7EEI/71ULnNh8JnK0JiswX8esEYALUQ3+dGzB4/X5Wqax2qi3PpGEn6v0Qcb+epN7siE h0uEXWDaoZJj0U3/DsZcO85EnsFxlqyRSCna3sRdRkPfEl0SBKH+5DbQ1+CLMAgz6hek vJsw== X-Gm-Message-State: AOAM53164wK9SUJFTO2igGLh5CKr08MeM2ruTSxmoFKMJnKv5vm00q2H wHH1pNY4FoLkxwe+9KFSm0ffqQYZmPD4tGWLcREBSw== X-Google-Smtp-Source: ABdhPJwj+V7aWJeyepm6+7W6e91Vry5hHYf2VwL3c0cxba/jMCnceW+EJTNcdKzywIzqMHQW1UknFgcv8buvE+BKFGE= X-Received: by 2002:a67:2fc6:0:b0:32d:7195:32e9 with SMTP id v189-20020a672fc6000000b0032d719532e9mr15747916vsv.44.1652340164357; Thu, 12 May 2022 00:22:44 -0700 (PDT) MIME-Version: 1.0 References: <56b41ce6922ed5f640d9bd46a603fa27576532a9.camel@intel.com> In-Reply-To: From: Wei Xu Date: Thu, 12 May 2022 00:22:33 -0700 Message-ID: Subject: Re: RFC: Memory Tiering Kernel Interfaces (v2) To: Aneesh Kumar K V Cc: "ying.huang@intel.com" , Andrew Morton , Greg Thelen , Yang Shi , Linux Kernel Mailing List , Jagdish Gediya , Michal Hocko , Tim C Chen , Dave Hansen , Alistair Popple , Baolin Wang , Feng Tang , Jonathan Cameron , Davidlohr Bueso , Dan Williams , David Rientjes , Linux MM , Brice Goglin , Hesham Almatary Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: 8e3rjcekkcfc4mph6dda1o1je4qr3es5 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: F21F1400B0 X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=MuT9tsxo; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of weixugc@google.com designates 209.85.217.50 as permitted sender) smtp.mailfrom=weixugc@google.com X-HE-Tag: 1652340145-786906 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: On Thu, May 12, 2022 at 12:12 AM Aneesh Kumar K V wrote: > > On 5/12/22 12:33 PM, ying.huang@intel.com wrote: > > On Wed, 2022-05-11 at 23:22 -0700, Wei Xu wrote: > >> Sysfs Interfaces > >> ================ > >> > >> * /sys/devices/system/memtier/memtierN/nodelist > >> > >> where N = 0, 1, 2 (the kernel supports only 3 tiers for now). > >> > >> Format: node_list > >> > >> Read-only. When read, list the memory nodes in the specified tier. > >> > >> Tier 0 is the highest tier, while tier 2 is the lowest tier. > >> > >> The absolute value of a tier id number has no specific meaning. > >> What matters is the relative order of the tier id numbers. > >> > >> When a memory tier has no nodes, the kernel can hide its memtier > >> sysfs files. > >> > >> * /sys/devices/system/node/nodeN/memtier > >> > >> where N = 0, 1, ... > >> > >> Format: int or empty > >> > >> When read, list the memory tier that the node belongs to. Its value > >> is empty for a CPU-only NUMA node. > >> > >> When written, the kernel moves the node into the specified memory > >> tier if the move is allowed. The tier assignment of all other nodes > >> are not affected. > >> > >> Initially, we can make this interface read-only. > > > > It seems that "/sys/devices/system/node/nodeN/memtier" has all > > information we needed. Do we really need > > "/sys/devices/system/memtier/memtierN/nodelist"? > > > > That can be gotten via a simple shell command line, > > > > $ grep . /sys/devices/system/node/nodeN/memtier | sort -n -k 2 -t ':' > > > > It will be really useful to fetch the memory tier node list in an easy > fashion rather than reading multiple sysfs directories. If we don't have > other attributes for memorytier, we could keep > "/sys/devices/system/memtier/memtierN" a NUMA node list there by > avoiding /sys/devices/system/memtier/memtierN/nodelist > > -aneesh It is harder to implement memtierN as just a file and doesn't follow the existing sysfs pattern, either. Besides, it is extensible to have memtierN as a directory.