2024-04-24 13:54:08

by Lance Yang

[permalink] [raw]
Subject: [PATCH 0/2] mm: introduce per-order mTHP split counters

Hi all,

At present, the split counters in THP statistics no longer include
PTE-mapped mTHP. Therefore, we want to introduce per-order mTHP split
counters to monitor the frequency of mTHP splits. This will assist
developers in better analyzing and optimizing system performance.

/sys/kernel/mm/transparent_hugepage/hugepages-<size>/stats
split_page
split_page_failed
deferred_split_page

Thanks,
Lance
---

Lance Yang (2):
mm: add per-order mTHP split counters
mm: add docs for per-order mTHP split counters

Documentation/admin-guide/mm/transhuge.rst | 16 ----------------
include/linux/huge_mm.h | 3 ---
mm/huge_memory.c | 14 ++------------
3 files changed, 2 insertions(+), 31 deletions(-)

--
2.33.1



2024-04-24 15:00:15

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH 0/2] mm: introduce per-order mTHP split counters

On 24.04.24 15:51, Lance Yang wrote:
> Hi all,
>
> At present, the split counters in THP statistics no longer include
> PTE-mapped mTHP. Therefore, we want to introduce per-order mTHP split
> counters to monitor the frequency of mTHP splits. This will assist
> developers in better analyzing and optimizing system performance.
>
> /sys/kernel/mm/transparent_hugepage/hugepages-<size>/stats
> split_page
> split_page_failed
> deferred_split_page
>
> Thanks,
> Lance
> ---
>
> Lance Yang (2):
> mm: add per-order mTHP split counters
> mm: add docs for per-order mTHP split counters
>
> Documentation/admin-guide/mm/transhuge.rst | 16 ----------------

We really have to start documenting these, and what the sementics are.

E.g., is split_page_failed contained in split_page? Is
deferred_split_page contained in split_page?

But also: just don't call it "split_page". Drop the "_page".

split
split_failed
split_deferred

?

--
Cheers,

David / dhildenb


2024-04-24 15:20:31

by Ryan Roberts

[permalink] [raw]
Subject: Re: [PATCH 0/2] mm: introduce per-order mTHP split counters

On 24/04/2024 16:00, David Hildenbrand wrote:
> On 24.04.24 15:51, Lance Yang wrote:
>> Hi all,
>>
>> At present, the split counters in THP statistics no longer include
>> PTE-mapped mTHP. Therefore, we want to introduce per-order mTHP split
>> counters to monitor the frequency of mTHP splits. This will assist
>> developers in better analyzing and optimizing system performance.
>>
>> /sys/kernel/mm/transparent_hugepage/hugepages-<size>/stats
>>          split_page
>>          split_page_failed
>>          deferred_split_page
>>
>> Thanks,
>> Lance
>> ---
>>
>> Lance Yang (2):
>>   mm: add per-order mTHP split counters
>>   mm: add docs for per-order mTHP split counters
>>
>>   Documentation/admin-guide/mm/transhuge.rst | 16 ----------------
>
> We really have to start documenting these, and what the sementics are.

I think the diffstat is backwards; the series definitely adds more lines than it
removes. And patch 2 is adding 16 lines of docs, not removing them. How are you
generating this? `git format-patch` should do it correctly for you.

>
> E.g., is split_page_failed contained in split_page? Is deferred_split_page
> contained in split_page?
>
> But also: just don't call it "split_page". Drop the "_page".
>
> split
> split_failed
> split_deferred

I guess we are back in "should we be consistent with the existing vmstats"
territory, which uses split_page/split_page_failed/deferred_split_page

But here, I agree that dropping _page is nicer.

>
> ?
>


2024-04-24 15:29:16

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH 0/2] mm: introduce per-order mTHP split counters

On 24.04.24 17:20, Ryan Roberts wrote:
> On 24/04/2024 16:00, David Hildenbrand wrote:
>> On 24.04.24 15:51, Lance Yang wrote:
>>> Hi all,
>>>
>>> At present, the split counters in THP statistics no longer include
>>> PTE-mapped mTHP. Therefore, we want to introduce per-order mTHP split
>>> counters to monitor the frequency of mTHP splits. This will assist
>>> developers in better analyzing and optimizing system performance.
>>>
>>> /sys/kernel/mm/transparent_hugepage/hugepages-<size>/stats
>>>          split_page
>>>          split_page_failed
>>>          deferred_split_page
>>>
>>> Thanks,
>>> Lance
>>> ---
>>>
>>> Lance Yang (2):
>>>   mm: add per-order mTHP split counters
>>>   mm: add docs for per-order mTHP split counters
>>>
>>>   Documentation/admin-guide/mm/transhuge.rst | 16 ----------------
>>
>> We really have to start documenting these, and what the sementics are.
>
> I think the diffstat is backwards; the series definitely adds more lines than it
> removes. And patch 2 is adding 16 lines of docs, not removing them. How are you
> generating this? `git format-patch` should do it correctly for you.
>
>>
>> E.g., is split_page_failed contained in split_page? Is deferred_split_page
>> contained in split_page?
>>
>> But also: just don't call it "split_page". Drop the "_page".
>>
>> split
>> split_failed
>> split_deferred
>
> I guess we are back in "should we be consistent with the existing vmstats"
> territory, which uses split_page/split_page_failed/deferred_split_page
>

Yeah, "thp_split_page" really is odd "transparent huge page split page".

> But here, I agree that dropping _page is nicer.
Right; we also shouldn't call it "thp_split_page" here :)

--
Cheers,

David / dhildenb


2024-04-24 15:55:58

by Lance Yang

[permalink] [raw]
Subject: Re: [PATCH 0/2] mm: introduce per-order mTHP split counters

On Wed, Apr 24, 2024 at 11:29 PM David Hildenbrand <[email protected]> wrote:
>
> On 24.04.24 17:20, Ryan Roberts wrote:
> > On 24/04/2024 16:00, David Hildenbrand wrote:
> >> On 24.04.24 15:51, Lance Yang wrote:
> >>> Hi all,
> >>>
> >>> At present, the split counters in THP statistics no longer include
> >>> PTE-mapped mTHP. Therefore, we want to introduce per-order mTHP split
> >>> counters to monitor the frequency of mTHP splits. This will assist
> >>> developers in better analyzing and optimizing system performance.
> >>>
> >>> /sys/kernel/mm/transparent_hugepage/hugepages-<size>/stats
> >>> split_page
> >>> split_page_failed
> >>> deferred_split_page
> >>>
> >>> Thanks,
> >>> Lance
> >>> ---
> >>>
> >>> Lance Yang (2):
> >>> mm: add per-order mTHP split counters
> >>> mm: add docs for per-order mTHP split counters
> >>>
> >>> Documentation/admin-guide/mm/transhuge.rst | 16 ----------------
> >>
> >> We really have to start documenting these, and what the sementics are.
> >
> > I think the diffstat is backwards; the series definitely adds more lines than it
> > removes. And patch 2 is adding 16 lines of docs, not removing them. How are you
> > generating this? `git format-patch` should do it correctly for you.
> >
> >>
> >> E.g., is split_page_failed contained in split_page? Is deferred_split_page
> >> contained in split_page?
> >>
> >> But also: just don't call it "split_page". Drop the "_page".
> >>
> >> split
> >> split_failed
> >> split_deferred
> >
> > I guess we are back in "should we be consistent with the existing vmstats"
> > territory, which uses split_page/split_page_failed/deferred_split_page
> >
>
> Yeah, "thp_split_page" really is odd "transparent huge page split page".
>
> > But here, I agree that dropping _page is nicer.
> Right; we also shouldn't call it "thp_split_page" here :)

Yep, I understood. Let's drop the "_page".

split
split_failed
split_deferred

Thanks,
Lance

>
> --
> Cheers,
>
> David / dhildenb
>

2024-04-24 16:30:32

by Lance Yang

[permalink] [raw]
Subject: Re: [PATCH 0/2] mm: introduce per-order mTHP split counters

On Wed, Apr 24, 2024 at 11:20 PM Ryan Roberts <[email protected]> wrote:
>
> On 24/04/2024 16:00, David Hildenbrand wrote:
> > On 24.04.24 15:51, Lance Yang wrote:
> >> Hi all,
> >>
> >> At present, the split counters in THP statistics no longer include
> >> PTE-mapped mTHP. Therefore, we want to introduce per-order mTHP split
> >> counters to monitor the frequency of mTHP splits. This will assist
> >> developers in better analyzing and optimizing system performance.
> >>
> >> /sys/kernel/mm/transparent_hugepage/hugepages-<size>/stats
> >> split_page
> >> split_page_failed
> >> deferred_split_page
> >>
> >> Thanks,
> >> Lance
> >> ---
> >>
> >> Lance Yang (2):
> >> mm: add per-order mTHP split counters
> >> mm: add docs for per-order mTHP split counters
> >>
> >> Documentation/admin-guide/mm/transhuge.rst | 16 ----------------
> >
> > We really have to start documenting these, and what the sementics are.
>
> I think the diffstat is backwards; the series definitely adds more lines than it

Good spot! I'll sort it out.

Thanks,
Lance

> removes. And patch 2 is adding 16 lines of docs, not removing them. How are you
> generating this? `git format-patch` should do it correctly for you.
>
> >
> > E.g., is split_page_failed contained in split_page? Is deferred_split_page
> > contained in split_page?
> >
> > But also: just don't call it "split_page". Drop the "_page".
> >
> > split
> > split_failed
> > split_deferred
>
> I guess we are back in "should we be consistent with the existing vmstats"
> territory, which uses split_page/split_page_failed/deferred_split_page
>
> But here, I agree that dropping _page is nicer.
>
> >
> > ?
> >
>