[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7193b89e-ac2d-47c9-8fa5-68e35c57d4b6@amd.com>
Date: Thu, 22 Jan 2026 17:56:17 +0530
From: "Garg, Shivank" <shivankg@....com>
To: Lance Yang <lance.yang@...ux.dev>, Dev Jain <dev.jain@....com>
Cc: Zi Yan <ziy@...dia.com>, Baolin Wang <baolin.wang@...ux.alibaba.com>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>, Nico Pache
<npache@...hat.com>, David Hildenbrand <david@...nel.org>,
Ryan Roberts <ryan.roberts@....com>, Barry Song <baohua@...nel.org>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Wei Yang <richard.weiyang@...il.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH V3 2/5] mm/khugepaged: count small VMAs towards scan limit
On 1/22/2026 2:14 PM, Lance Yang wrote:
>
>
> On 2026/1/22 15:32, Dev Jain wrote:
>>
>> On 19/01/26 12:52 am, Shivank Garg wrote:
>>> The khugepaged_scan_mm_slot() uses a 'progress' counter to limit the
>>> amount of work performed and consists of three components:
>>> 1. Transitioning to a new mm (+1).
>>> 2. Skipping an unsuitable VMA (+1).
>>> 3. Scanning a PMD-sized range (+HPAGE_PMD_NR).
>>>
>>> Consider a 1MB VMA sitting between two 2MB alignment boundaries:
>>>
>>> vma1 vma2 vma3
>>> +----------+------+----------+
>>> |2M |1M |2M |
>>> +----------+------+----------+
>>> ^ ^
>>> start end
>>> ^
>>> hstart,hend
>>
>> Won't such a VMA be skipped by thp_vma_allowable_order()? That internally
>> checks, apart from eligibility by sysfs, that the extent of the VMA can
>> map a hugepage.
>
> Ah, you're right!
>
> I was worrying about a case that doesn't actually happen.
>
You're right, thp_vma_allowable_order() is taking care of this, making
hend <= hstart check redundant.
Thank you for catching this.
I'll drop this change and send revision keeping only the unsigned int type
change for 'progress'.
Thanks,
Shivank
Powered by blists - more mailing lists