linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Michal Hocko <mhocko@suse.com>, Oscar Salvador <osalvador@suse.de>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Hannes Reinecke <hare@kernel.org>
Subject: Re: [RFC] Disable auto_movable_ratio for selfhosted memmap
Date: Mon, 28 Jul 2025 10:53:08 +0200	[thread overview]
Message-ID: <2f24e725-cddb-41c5-ba87-783930efb2aa@redhat.com> (raw)
In-Reply-To: <aIc5XxgkbAwF6wqE@tiehlicka>

On 28.07.25 10:48, Michal Hocko wrote:
> On Mon 28-07-25 10:15:47, Oscar Salvador wrote:
>> Hi,
>>
>> Currently, we have several mechanisms to pick a zone for the new memory we are
>> onlining.
>> Eventually, we will land on zone_for_pfn_range() which will pick the zone.
>>
>> Two of these mechanisms are 'movable_node' and 'auto-movable' policy.
>> The former will put every single hotpluggled memory in ZONE_MOVABLE
>> (unless we can keep zones contiguous by not doing so), while the latter
>> will put it in ZONA_MOVABLE IFF we are within the established ratio
>> MOVABLE:KERNEL.
>>
>> It seems, the later doesn't play well with CXL memory where CXL cards hold really
>> large amounts of memory, making the ratio fail, and since CXL cards must be removed
>> as a unit, it can't be done if any memory block fell within
>> !ZONE_MOVABLE zone.
> 
> I suspect this is just an example of how our existing memory hotplug
> interface based on memory blocks is just suoptimal and it doesn't fit
> new usecases. We should start thinking about how a new v2 api should
> look like. I am not sure how that should look like but I believe we
> should be able to express a "device" as whole rather than having a very
> loosely bound generic memblocks. Anyway this is likely for a longer
> discussion and a long term plan rather than addressing this particular
> issue.

We have that concept with memory groups in the kernel already.

In dax/kmem we register a static memory group. It will be considered one 
union.

>   
>> One way to tackle this would be update the ratio every time a new CXL
>> card gets inserted, but this seems suboptimal.
> 
> I do not think this is a usable interface.
> 
>> Another way is that since CXL memory works with selfhosted memmap, we could relax
>> the check when 'auto-movable' and only look at the ratio if we aren't
>> working with selfhosted memmap.
> 
> This is likely the only choice we have with the current interface. We
> either need a way to disable the ratio altogether or make it more
> automagic and treat self hosted memory differently because that memory
> doesn't eat up ZONE_NORMAL memory and therefore cannot deplete it for
> ZONE_MOVABLE.

daxctl wants to online memory itself. We want to keep that memory 
offline from a kernel perspective and let daxctl handle it in this case.

We have that problem in RHEL where we currently require user space to 
disable udev rules so daxctl "can win".

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2025-07-28  8:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-28  8:15 Oscar Salvador
2025-07-28  8:44 ` David Hildenbrand
2025-07-28  9:28   ` Hannes Reinecke
2025-07-28  9:42     ` David Hildenbrand
2025-07-28  8:48 ` Michal Hocko
2025-07-28  8:53   ` David Hildenbrand [this message]
2025-07-28  9:04     ` Michal Hocko
2025-07-28  9:10       ` David Hildenbrand
2025-07-28  9:37         ` Hannes Reinecke
2025-07-28 13:06           ` Michal Hocko
2025-07-28 13:08             ` David Hildenbrand
2025-07-29  7:24               ` Hannes Reinecke
2025-07-29  9:19                 ` Michal Hocko
2025-07-29  9:29                   ` David Hildenbrand
2025-07-29  9:33                   ` Hannes Reinecke
2025-07-29 11:58                     ` Michal Hocko
2025-07-29 13:52                       ` Hannes Reinecke
2025-07-28 15:15           ` David Hildenbrand
2025-07-28 12:17         ` Michal Hocko
2025-07-28 12:27           ` David Hildenbrand
2025-07-28 12:27             ` David Hildenbrand
2025-07-28 13:00               ` Michal Hocko
2025-07-28 13:03                 ` David Hildenbrand
2025-07-28 12:54             ` Michal Hocko

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=2f24e725-cddb-41c5-ba87-783930efb2aa@redhat.com \
    --to=david@redhat.com \
    --cc=hare@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    /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