Re: [PATCH 3/4] mm/ksm: rename mm_slot_cache to ksm_slot_cache

From: Alex Shi
Date: Thu May 16 2024 - 08:15:43 EST




On 4/30/24 8:57 PM, David Hildenbrand wrote:
>>
>> @@ -2972,7 +2972,7 @@ int __ksm_enter(struct mm_struct *mm)
>>       struct mm_slot *slot;
>>       int needs_wakeup;
>>   -    ksm_slot = mm_slot_alloc(mm_slot_cache);
>> +    ksm_slot = mm_slot_alloc(ksm_slot_cache);
>
> Similarly, this makes the code more confusion. The pattern in khugepaged is similarly:
>
> mm_slot = mm_slot_alloc(mm_slot_cache);

Could we rename it to khg_mm_slot_cache in khugepaged?

>
> I don't think we want these renamings.
>
> E.g., "ksm_mm_slot_cache" might be a bit better than "mm_slot_cache". But then, we are in KSM code ... so I don't really see an improvement.

Thanks for comments and sorry for response late.

yes, ksm_mm_slot_cache is better even in KSM code. As a cscope/tag dependency patient, this change could reduce much of confusing in name searching. And that's why a one-side change satisfies me.
Yes, maybe better naming could make it more readable, any more further help? :)

Thanks a lot!
Alex