Re: [PATCH v2] mm/vmstat: Add order's information for extfrag_index and unusable_index

From: Hao Ge
Date: Thu Feb 29 2024 - 18:14:32 EST



> On Mar 1, 2024, at 02:40, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Thu, 29 Feb 2024 22:14:43 +0800 Hao Ge <gehao@xxxxxxxxxx> wrote:
>
>> Current cat /sys/kernel/debug/extfrag/extfrag_index and
>> /sys/kernel/debug/extfrag/unusable_index is not friendly to userspace.
>>
>> We should add order's information so that users can clearly understand
>> the situation of each order at a glance like pagetypeinfo.
>>
>> before:
>> cat /sys/kernel/debug/extfrag/extfrag_index:
>> Node 0, zone DMA32 ...... ...... ...... ......
>> Node 0, zone Normal ...... ...... ...... ......
>>
>> cat /sys/kernel/debug/extfrag/unusable_index:
>> Node 0, zone DMA32 ..... ..... ..... .....
>> Node 0, zone Normal ..... ..... ..... .....
>>
>> after:
>> cat /sys/kernel/debug/extfrag/extfrag_index:
>> Extfrag index at order: 0 1 2 3
>> Node 0, zone DMA ...... ...... ...... ......
>> Node 0, zone Normal ...... ...... ...... ......
>>
>> cat /sys/kernel/debug/extfrag/unusable_index:
>> Unusable index at order: 0 1 2 3
>> Node 0, zone DMA ..... ..... ..... .....
>> Node 0, zone Normal ..... ..... ..... .....
>>
>
> This may break existing parsers of this file.
>
> And that would be allowed if these files were under debugfs. But
> they're under sysfs/debug, where the rules are less clear.
>
> Still, it's unclear to me that the benefit is worth this risk. What do
> others think?

Thank you for your reply. This is something I didn't expect. I think it's better to keep it in its original condition to avoid compatibility issues with some tools.