Linux CXL
 help / color / mirror / Atom feed
From: <sthanneeru.opensrc@micron.com>
To: <sthanneeru.opensrc@micron.com>, <linux-cxl@vger.kernel.org>,
	<linux-mm@kvack.org>
Cc: <sthanneeru@micron.com>, <aneesh.kumar@linux.ibm.com>,
	<dan.j.williams@intel.com>, <ying.huang@intel.com>,
	<gregory.price@memverge.com>, <mhocko@suse.com>, <tj@kernel.org>,
	<john@jagalactic.com>, <emirakhur@micron.com>,
	<vtavarespetr@micron.com>, <Ravis.OpenSrc@micron.com>,
	<Jonathan.Cameron@huawei.com>, <linux-kernel@vger.kernel.org>
Subject: [RFC PATCH v2 0/2] Node migration between memory tiers
Date: Wed, 13 Dec 2023 23:23:27 +0530	[thread overview]
Message-ID: <20231213175329.594-1-sthanneeru.opensrc@micron.com> (raw)

From: Srinivasulu Thanneeru <sthanneeru.opensrc@micron.com>

The memory tiers feature allows nodes with similar memory types
or performance characteristics to be grouped together in a
memory tier. However, there is currently no provision for
moving a node from one tier to another on demand.

This patch series aims to support node migration between tiers
on demand by sysadmin/root user using the provided sysfs for
node migration.

To migrate a node to a tier, the corresponding node’s sysfs
memtier_override is written with target tier id.

Example: Move node2 to memory tier2 from its default tier(i.e 4)

1. To check current memtier of node2
$cat  /sys/devices/system/node/node2/memtier_override
memory_tier4

2. To migrate node2 to memory_tier2
$echo 2 > /sys/devices/system/node/node2/memtier_override
$cat  /sys/devices/system/node/node2/memtier_override
memory_tier2

Usecases:

1. Useful to move cxl nodes to the right tiers from userspace, when
   the hardware fails to assign the tiers correctly based on
   memorytypes.

   On some platforms we have observed cxl memory being assigned to
   the same tier as DDR memory. This is arguably a system firmware
   bug, but it is true that tiers represent *ranges* of performance
   and we believe it's important for the system operator to have
   the ability to override bad firmware or OS decisions about tier
   assignment as a fail-safe against potential bad outcomes.

2. Useful if we want interleave weights to be applied on memory tiers
   instead of nodes.
In a previous thread, Huang Ying <ying.huang@intel.com> thought
this feature might be useful to overcome limitations of systems
where nodes with different bandwidth characteristics are grouped
in a single tier.
https://lore.kernel.org/lkml/87a5rw1wu8.fsf@yhuang6-desk2.ccr.corp.intel.com/

=============
Version Notes:

V2 : Changed interface to memtier_override from adistance_offset.
memtier_override was recommended by
1. John Groves <john@jagalactic.com>
2. Ravi Shankar <ravis.opensrc@micron.com>
3. Brice Goglin <Brice.Goglin@inria.fr>

V1 : Introduced adistance_offset sysfs.

=============

Srinivasulu Thanneeru (2):
  base/node: Add sysfs for memtier_override
  memory tier: Support node migration between tiers

 Documentation/ABI/stable/sysfs-devices-node |  7 ++
 drivers/base/node.c                         | 47 ++++++++++++
 include/linux/memory-tiers.h                | 11 +++
 include/linux/node.h                        | 11 +++
 mm/memory-tiers.c                           | 85 ++++++++++++---------
 5 files changed, 125 insertions(+), 36 deletions(-)

-- 
2.25.1


             reply	other threads:[~2023-12-13 17:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13 17:53 sthanneeru.opensrc [this message]
2023-12-13 17:53 ` [PATCH 1/2] base/node: Add sysfs for memtier_override sthanneeru.opensrc
2023-12-13 17:53 ` [PATCH 2/2] memory tier: Support node migration between tiers sthanneeru.opensrc
2023-12-15  5:02 ` [RFC PATCH v2 0/2] Node migration between memory tiers Huang, Ying
2023-12-15 17:42   ` Gregory Price
2023-12-18  5:55     ` Huang, Ying
2024-01-03  5:26       ` [EXT] " Srinivasulu Thanneeru
2024-01-03  6:07         ` Huang, Ying
2024-01-03  7:56           ` Srinivasulu Thanneeru
2024-01-03  8:29             ` Huang, Ying
2024-01-03  8:47               ` Srinivasulu Thanneeru
2024-01-04  6:05                 ` Huang, Ying
2024-01-08 17:04                   ` Gregory Price
2024-01-09  3:41                     ` Huang, Ying
2024-01-09 15:50                       ` Jonathan Cameron
2024-01-09 17:59                         ` Gregory Price
2024-01-10  0:28                           ` [External] " Hao Xiang
2024-01-10 14:18                             ` Jonathan Cameron
2024-01-10 19:29                               ` Hao Xiang
2024-01-12  7:00                                 ` Huang, Ying
2024-01-12  8:14                                   ` Hao Xiang
2024-01-15  1:24                                     ` Huang, Ying
2024-01-10  5:47                           ` Huang, Ying
2024-01-10 14:11                           ` Jonathan Cameron
2024-01-10  6:06                         ` Huang, Ying
2024-01-09 17:34                       ` Gregory Price
2023-12-18  8:56   ` Srinivasulu Thanneeru
2023-12-19  3:57     ` Huang, Ying

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231213175329.594-1-sthanneeru.opensrc@micron.com \
    --to=sthanneeru.opensrc@micron.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Ravis.OpenSrc@micron.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=emirakhur@micron.com \
    --cc=gregory.price@memverge.com \
    --cc=john@jagalactic.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=sthanneeru@micron.com \
    --cc=tj@kernel.org \
    --cc=vtavarespetr@micron.com \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox