[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8a614d01-191e-45d1-b6b6-c36ec0bd9e5a@redhat.com>
Date: Wed, 5 Jun 2024 09:47:10 +0200
From: David Hildenbrand <david@...hat.com>
To: Alex Shi <seakeel@...il.com>, Matthew Wilcox <willy@...radead.org>,
alexs@...nel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, izik.eidus@...ellosystems.com,
aarcange@...hat.com, chrisw@...s-sol.org, hughd@...gle.com
Subject: Re: [PATCH 02/10] mm/ksm: skip subpages of compound pages
On 05.06.24 08:14, Alex Shi wrote:
>
>
> On 6/5/24 11:52 AM, Matthew Wilcox wrote:
>> On Tue, Jun 04, 2024 at 12:24:44PM +0800, alexs@...nel.org wrote:
>>> From: "Alex Shi (tencent)" <alexs@...nel.org>
>>>
>>> When a folio isn't fit for KSM, the subpages are unlikely to be good,
>>> So let's skip the rest page checking to save some actions.
>>
>> Why would you say that is true? We have plenty of evidence that
>> userspace allocators can allocate large folios, then use only the first
>> few bytes, leaving many tail pages full of zeroes.
>
> Um, that do need tail pages...
> Is there some way to use more folio in ksm?
My take, and Willy can correct me if I am wrong:
"struct page" is not going to away any time soon, but it might shrink at
some point.
That is, we can use the "struct page" pointer to point at a page frame,
and use "struct folio" to lookup/manage the metadata.
That is, use "struct page" when accessing the actual memory content
(checksum, testing for identical content), but use the folio part when
looking up metadata (folio_test_anon() etc). In the future we might want
to replace the "struct page" pointer by an index into the folio, but
that doesn't have to happen right now.
For KSM, that would mean that you have a folio+page (late folio+index)
pair when possibly dealing with large folios, but you can use a folio
without a page when dealing with KSM folios, that are always small.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists