[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca1a6d9d-bc0e-4c3a-a9bf-da06801903e0@arm.com>
Date: Thu, 6 Mar 2025 13:14:26 +0530
From: Dev Jain <dev.jain@....com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Liam.Howlett@...cle.com, lorenzo.stoakes@...cle.com, vbabka@...e.cz,
jannh@...gle.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
ryan.roberts@....com, anshuman.khandual@....com, aneesh.kumar@...nel.org,
yang@...amperecomputing.com, david@...hat.com, willy@...radead.org,
hughd@...gle.com, ziy@...dia.com
Subject: Re: [PATCH] mm/vma: Do not register private-anon mappings with
khugepaged during mmap
On 06/03/25 12:08 pm, Andrew Morton wrote:
> On Thu, 6 Mar 2025 12:00:37 +0530 Dev Jain <dev.jain@....com> wrote:
>
>> We already are registering private-anon VMAs with khugepaged during fault
>> time, in do_huge_pmd_anonymous_page(). Commit "register suitable readonly
>> file vmas for khugepaged" moved the khugepaged registration logic from
>> shmem_mmap to the generic mmap path. Make this logic specific for non-anon
>> mappings.
>
> Please fully describe the userspace-visible effects of this bug.
Apologies.
The userspace-visible effect should be this: khugepaged will
unnecessarily scan mm's which haven't yet faulted in. Note that it won't
actually collapse because all PTEs are none.
Now that I think about it, the mm is going to have a file VMA anyways
during fork+exec, so the mm already gets registered during mmap due to
the non-anon case (I *think*), so at least one of either the mmap
registration or fault-time registration is redundant.
>
>> Fixes: 613bec092fe7 ("mm: mmap: register suitable readonly file vmas for khugepaged")
>> Signed-off-by: Dev Jain <dev.jain@....com>
>
> Thanks, I'll add cc:stable.
Powered by blists - more mailing lists