Re: [PATCH v2 3/3] mm: change type of parameter for memory_notify

David Hildenbrand <[email protected]> Thu, 30 Oct 2025 12:34:06 +0100
Newsgroups org.kernel.vger.linux-debuggers,org.kvack.linux-mm
Message-ID <[email protected]>
On 30.10.25 12:16, Israel Batista wrote:
> 
> 
> On 10/30/25 07:56, Lorenzo Stoakes wrote:
>> This seems fine, but I can see a whole bunch of others like:
>>
>> kcore_callback()
>> mm_compute_batch_notifier()
>> page_ext_callback()
>> reserve_mem_notiifer()
>> etc.
>>
>> So I think worth chasing all of these down?
>>
> 
> Yeah, I figured there were other cases and was originally planning to
> include them in the patch series. The problem is they are notifier
> callbacks and changing the type from unsingned long to enum
> memory_block_state would break compatibility with the type notifier_fn_t
> found in include/linux/notifier.h:
> 
> typedef	int (*notifier_fn_t)(struct notifier_block *nb,
> 			unsigned long action, void *data);
> 
> So I think it's not worth the trouble for now.

We could just cat from unsigned long -> type at the beginning of all 
these notifiers to have us then work with the actual type.

-- 
Cheers

David / dhildenb