[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2930133f-371d-4846-968f-6137ae1b3156@redhat.com>
Date: Mon, 23 Jun 2025 16:01:34 +0200
From: David Hildenbrand <david@...hat.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, Dev Jain <dev.jain@....com>
Cc: akpm@...ux-foundation.org, ziy@...dia.com, baolin.wang@...ux.alibaba.com,
Liam.Howlett@...cle.com, npache@...hat.com, ryan.roberts@....com,
baohua@...nel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] khugepaged: Optimize collapse_pte_mapped_thp() for large
folios by PTE batching
>>>
>>>> mm/khugepaged.c | 38 +++++++++++++++++++++++++-------------
>>>> 1 file changed, 25 insertions(+), 13 deletions(-)
>>>>
>>>> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
>>>> index 649ccb2670f8..7d37058eda5b 100644
>>>> --- a/mm/khugepaged.c
>>>> +++ b/mm/khugepaged.c
>>>> @@ -1499,15 +1499,16 @@ static int set_huge_pmd(struct vm_area_struct *vma, unsigned long addr,
>>>> int collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr,
>>>> bool install_pmd)
>>>> {
>>>> + int nr_mapped_ptes = 0, nr_batch_ptes, result = SCAN_FAIL;
>>> NIT: I don't know why you're moving this, and while y'know it's kind of the fun
>>> of subjective stuff I'd rather the assigned values and unassigned values be on
>>> different lines (yes I know this codebase violates this with the pml, ptl below
>>> but hey :P)
>>
>> To maintain a reverse Xmas fashion. Now I know that the declarations are already
>> not in an Xmas fashion, but I wanted to make sure the code I change maintains
>> that for the part I am changing :)
>
> We have no such requirement in mm nor do we particularly want to establish any
> conventions around this.
Well, if we already do have reverse xmas tree, we tend to maintain it
... or when adding new code.
So in MM it's actually very common to do that. But we avoid doing that
just for the sake of it when touching some code.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists