lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <07b4db81-095d-4f02-a34f-16f0743039ce@linux.alibaba.com>
Date: Fri, 30 May 2025 11:02:42 +0800
From: Baolin Wang <baolin.wang@...ux.alibaba.com>
To: Nico Pache <npache@...hat.com>
Cc: linux-mm@...ck.org, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
 david@...hat.com, ziy@...dia.com, lorenzo.stoakes@...cle.com,
 Liam.Howlett@...cle.com, ryan.roberts@....com, dev.jain@....com,
 corbet@....net, rostedt@...dmis.org, mhiramat@...nel.org,
 mathieu.desnoyers@...icios.com, akpm@...ux-foundation.org,
 baohua@...nel.org, willy@...radead.org, peterx@...hat.com,
 wangkefeng.wang@...wei.com, usamaarif642@...il.com, sunnanyong@...wei.com,
 vishal.moola@...il.com, thomas.hellstrom@...ux.intel.com,
 yang@...amperecomputing.com, kirill.shutemov@...ux.intel.com,
 aarcange@...hat.com, raquini@...hat.com, anshuman.khandual@....com,
 catalin.marinas@....com, tiwai@...e.de, will@...nel.org,
 dave.hansen@...ux.intel.com, jack@...e.cz, cl@...two.org,
 jglisse@...gle.com, surenb@...gle.com, zokeefe@...gle.com,
 hannes@...xchg.org, rientjes@...gle.com, mhocko@...e.com,
 rdunlap@...radead.org
Subject: Re: [PATCH v7 03/12] khugepaged: generalize hugepage_vma_revalidate
 for mTHP support



On 2025/5/29 12:00, Nico Pache wrote:
> On Fri, May 23, 2025 at 12:55 AM Baolin Wang
> <baolin.wang@...ux.alibaba.com> wrote:
>>
>>
>>
>> On 2025/5/15 11:22, Nico Pache wrote:
>>> For khugepaged to support different mTHP orders, we must generalize this
>>> to check if the PMD is not shared by another VMA and the order is
>>> enabled.
>>>
>>> No functional change in this patch.
>>>
>>> Reviewed-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
>>> Co-developed-by: Dev Jain <dev.jain@....com>
>>> Signed-off-by: Dev Jain <dev.jain@....com>
>>> Signed-off-by: Nico Pache <npache@...hat.com>
>>> ---
>>>    mm/khugepaged.c | 10 +++++-----
>>>    1 file changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
>>> index 5457571d505a..0c4d6a02d59c 100644
>>> --- a/mm/khugepaged.c
>>> +++ b/mm/khugepaged.c
>>> @@ -920,7 +920,7 @@ static int khugepaged_find_target_node(struct collapse_control *cc)
>>>    static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address,
>>>                                   bool expect_anon,
>>>                                   struct vm_area_struct **vmap,
>>> -                                struct collapse_control *cc)
>>> +                                struct collapse_control *cc, int order)
>>>    {
>>>        struct vm_area_struct *vma;
>>>        unsigned long tva_flags = cc->is_khugepaged ? TVA_ENFORCE_SYSFS : 0;
>>> @@ -934,7 +934,7 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address,
>>>
>>>        if (!thp_vma_suitable_order(vma, address, PMD_ORDER))
>>
>> Sorry, I missed this before. Should we also change 'PMD_ORDER' to
>> 'order' for the thp_vma_suitable_order()?
> This was changed since the last version (v5) due to an email from Hugh.
> https://lore.kernel.org/lkml/7a81339c-f9e5-a718-fa7f-6e3fb134dca5@google.com/
> 
> As I noted in my reply to him, although he was not able to reproduce
> an issue due to this, we always need to revalidate the PMD order to
> verify the PMD range is not shared by another VMA.

OK. I see. Better to add some comments like Hugh did to make it clear.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ