Linux CXL
 help / color / mirror / Atom feed
From: Gregory Price <gourry@gourry.net>
To: "Cheatham, Benjamin" <benjamin.cheatham@amd.com>
Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com, dave@stgolabs.net,
	jonathan.cameron@huawei.com, dave.jiang@intel.com,
	alison.schofield@intel.com, vishal.l.verma@intel.com,
	ira.weiny@intel.com, dan.j.williams@intel.com,
	David Hildenbrand <david@kernel.org>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH 6/6] cxl/sysram: disallow onlining in ZONE_NORMAL if state is movable only
Date: Mon, 12 Jan 2026 18:14:48 -0500	[thread overview]
Message-ID: <aWWAaDK91qAVLRLz@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <9c975c63-2668-4283-a326-292e50bfbfec@amd.com>

On Mon, Jan 12, 2026 at 03:11:05PM -0600, Cheatham, Benjamin wrote:
> On 1/12/2026 10:35 AM, Gregory Price wrote:
> > If state is set to online (default to ZONE_MOVABLE), the user intends
> > for this memory to either refuse non-movable allocations, and/or intends
> > to preserve the hot-unpluggability of this memory.  However, any admin
> > can write `offline` and `online` to the memory block controller and
> > bring that memory online in ZONE_NORMAL.
> 
> Is it the expectation that the user will never want to change the zone from
> MOVABLE to NORMAL? I can't think of a reason someone would want to off the top
> of my head, but I also can't think of a reason to restrict it either.
>

It's more to restrict this pattern

echo online_movable > region0/hotplug
   -> creates:   node1/memory123/

echo offline > node1/memory123/state
echo online > node1/memory123/state

The result of this would be valid_zones=[normal movable], which would
break hot-unplug.

> > If an actor attempts to online the block into ZONE_NORMAL, it will fail,
> > but if it attempts to online into either NORMAL or MOVABLE, only MOVABLE
> > will be allowed and it will succeed.
> 
> I'm not sure you need this paragraph. I think it's a logical conclusion of the above
> that if someone attempts to online the memory as NORMAL or MOVABLE it'll only be onlined
> as MOVABLE.

in the above situation the following occurs:

echo online  > region0/hotplug
echo offline > node1/memory123/state
echo online  > node1/memory123/state
cat node1/memory123/valid_zones
   normal movable
echo offline > node1/memory123/state
echo 1  > node1/memory123/online
cat node1/memory123/valid_zones
   normal


echo online_movable  > region0/hotplug
echo offline > node1/memory123/state
echo online  > node1/memory123/state
cat node1/memory123/valid_zones
   movable
echo offline > node1/memory123/state
echo 1  > node1/memory123/online
   fail with EXXXX (i forget what code)

It's a little confusing.

> > +	switch (data->last_online_type) {
> > +	case MMOP_ONLINE_MOVABLE:
> > +		return sysfs_emit(buf, "online\n");
> > +	case MMOP_ONLINE_KERNEL:
> > +		return sysfs_emit(buf, "online_normal\n");
> > +	case MMOP_OFFLINE:
> > +	default:
> 
> You're missing the MMOP_ONLINE case. In that case the memory would be reported as "offline", which
> I doubt is the intention.
> 

Blah, i originally had all of them and just reduced to
MMOP_ONLINE_MOVABLE and MMOP_ONLINE (i don't see a good use for
MMOP_ONLINE_KERNEL), but i'll fix this up.

Thanks!
Gregory

  reply	other threads:[~2026-01-12 23:15 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260113093758epcas5p10cc9749a657b8e4d32db75b8b973b67d@epcas5p1.samsung.com>
2026-01-12 16:35 ` [PATCH 0/6] CXL: Introduce memory controller abstraction and sysram controller Gregory Price
2026-01-12 16:35   ` [PATCH 1/6] drivers/cxl: add cxl_memctrl_mode and region->memctrl Gregory Price
2026-01-12 20:59     ` dan.j.williams
2026-01-12 22:25       ` Gregory Price
2026-01-13 18:00       ` Dave Jiang
2026-01-13 20:07         ` Gregory Price
2026-01-14 16:36         ` dan.j.williams
2026-01-12 21:10     ` Cheatham, Benjamin
2026-01-12 22:34       ` Gregory Price
2026-01-14 17:18     ` Jonathan Cameron
2026-01-14 18:25       ` Gregory Price
2026-01-14 18:36         ` Jonathan Cameron
2026-01-12 16:35   ` [PATCH 2/6] cxl: add sysram_region memory controller Gregory Price
2026-01-12 20:00     ` David Hildenbrand (Red Hat)
2026-01-12 22:43       ` Gregory Price
2026-01-12 21:10     ` dan.j.williams
2026-01-12 22:47       ` Gregory Price
2026-01-12 21:10     ` Cheatham, Benjamin
2026-01-12 22:55       ` Gregory Price
2026-01-13 22:34         ` Cheatham, Benjamin
2026-01-12 16:35   ` [PATCH 3/6] cxl/core/region: move pmem memctrl logic into memctrl/pmem_region Gregory Price
2026-01-12 21:10     ` Cheatham, Benjamin
2026-01-12 22:58       ` Gregory Price
2026-01-13  9:12         ` Neeraj Kumar
2026-01-12 16:35   ` [PATCH 4/6] cxl: add CONFIG_CXL_REGION_CTRL_AUTO_* build config options Gregory Price
2026-01-12 21:10     ` Cheatham, Benjamin
2026-01-12 23:05       ` Gregory Price
2026-01-13  4:31         ` dan.j.williams
2026-01-13 13:55           ` Gregory Price
2026-01-12 16:35   ` [PATCH 5/6] cxl: add CXL_REGION_SYSRAM_DEFAULT_* build options Gregory Price
2026-01-12 21:11     ` Cheatham, Benjamin
2026-01-12 23:07       ` Gregory Price
2026-01-12 16:35   ` [PATCH 6/6] cxl/sysram: disallow onlining in ZONE_NORMAL if state is movable only Gregory Price
2026-01-12 21:11     ` Cheatham, Benjamin
2026-01-12 23:14       ` Gregory Price [this message]
2026-01-13 22:35         ` Cheatham, Benjamin
2026-01-13  9:37   ` [PATCH 0/6] CXL: Introduce memory controller abstraction and sysram controller Neeraj Kumar
2026-01-13 13:33     ` Gregory Price
2026-01-15 18:43   ` Alejandro Lucero Palau
2026-01-15 18:56     ` Gregory Price

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=aWWAaDK91qAVLRLz@gourry-fedora-PF4VCD3F \
    --to=gourry@gourry.net \
    --cc=alison.schofield@intel.com \
    --cc=benjamin.cheatham@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=david@kernel.org \
    --cc=hare@suse.de \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kernel-team@meta.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vishal.l.verma@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