On 6/9/26 20:19, Gregory Price wrote:
> On Tue, Jun 09, 2026 at 08:11:42PM +0200, David Hildenbrand (Arm) wrote:
>> On 6/9/26 17:35, Gregory Price wrote:
>>>
>>> In patch 6 response i point out adding MMOP_UNPLUGGED
>>>
>>> If we add MMOP_UNPLUGGED as a state that is only use by callers of
>>> memory hotplug to represent the current state - but not as a valid input
>>> to memory_hotplug.c - then we can simply this as you request.
>>>
>>> Although we'll need to add a couple lines to memoryN/state parsing code
>>> to disallow MMOP_UNPLUGGED as a valid input (otherwise you could
>>> permanently unplug memory without the ability to get it back... unless
>>> you want that?  Seems useless to me.)
>>
>> I would just special-case your KMEM-special value, and then branch off to the
>> core helpers?
>>
>> static int dax_kmem_parse_state(const char *buf)
>> {
>>      if (sysfs_streq(buf, "unplugged"))
>>              return DAX_KMEM_UNPLUGGED;
>>      return mhp_online_type_from_str(...);
>> }
>>
>> So there is no need to add a value to MM core?
>>
> 
> Was going to propose this, but then I thought... well if CXL detactes
> itself from dax and does this same pattern, maybe MMOP_UNPLUGGED makes
> sense.
> 
> But i'll leave that for another day and do as you suggest.

Let me sleep over it :)

-- 
Cheers,

David

Reply via email to