Re: [PATCH 1/2] kselftest: mm: prevent random failure of huge page split for khugepaged

"David Hildenbrand (Arm)" <[email protected]>
Newsgroups org.kvack.linux-mm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
On 8/21/26 01:55, Yeoreum Yun wrote:
> On Thu, Aug 20, 2026 at 07:37:29PM -0400, Zi Yan wrote:
>> On Thu Aug 20, 2026 at 5:23 PM EDT, Yeoreum Yun wrote:
>>>
>>> Well, this also works with hugepage_save_settings() and write the
>>> khugepaged/scan_sleep_millisecs with the maximum integer.
>>>
>>> I don't have a strong opinion but since it seems more hackish way to
>>> change scan_sllep_millisecs, I use madvise() with MADV_NOHUGEPATE.
>>>
>>> Would it be better to change using APIs in hugepage_setting,h?
>>
>> No. I did not realize there is no way of stopping khugepaged completely.
>>
>> BTW, I am curious about your khugepaged config causing this issue.
>> IIRC, khugepaged scan interval is about minutes and
>> the time between madvise(MADV_HUGEPAGE) and the second
>> is_backed_by_folio() should not be that long.
> 
> Yes. it's relly timing sensitive and I've failed to reproduce in the
> real hardware. but in the emulation environment it often failed with 
> the scan_sllep_millisecs as 10 seconds while the test running.
> 
>>
>> For your patch, maybe you want to check the return value of madvise() to
>> make sure it succeeds.
> 
> Yeap. but it seems enough just worning message for the madvise() with
> MADV_NOHUGEPAGE.

Yeah, I assume we can assume that we are running on a recent enough kernel that
supports MADV_NOHUGEPAGE.

-- 
Cheers,

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.