From: David Hildenbrand <david@redhat.com>
To: Ryan Roberts <ryan.roberts@arm.com>,
Barry Song <21cnbao@gmail.com>,
akpm@linux-foundation.org, linux-mm@kvack.org
Cc: minchan@kernel.org, fengwei.yin@intel.com,
linux-kernel@vger.kernel.org, mhocko@suse.com, peterx@redhat.com,
shy828301@gmail.com, songmuchun@bytedance.com,
wangkefeng.wang@huawei.com, xiehuan09@gmail.com,
zokeefe@google.com, chrisl@kernel.org, yuzhao@google.com,
Barry Song <v-songbaohua@oppo.com>,
Lance Yang <ioworker0@gmail.com>
Subject: Re: [PATCH v2] mm: prohibit the last subpage from reusing the entire large folio
Date: Fri, 8 Mar 2024 14:46:33 +0100 [thread overview]
Message-ID: <4e0891dd-f5ba-4cff-932b-604288540e59@redhat.com> (raw)
In-Reply-To: <252bac83-bf5e-4c40-a696-ac093da41fa3@arm.com>
On 08.03.24 14:45, Ryan Roberts wrote:
> On 08/03/2024 13:24, David Hildenbrand wrote:
>>>>> This patch migrates the last subpage to a small folio and immediately
>>>>> returns the large folio to the system. It benefits both memory availability
>>>>> and anti-fragmentation.
>>>>
>>>> It might be controversial optimization, and as Ryan said, there, are likely
>>>> other cases where we'd want to migrate off-of a thp if possible earlier.
>>>
>>> Personally, I think there might also be cases where you want to copy/reuse the
>>> entire large folio. If you're application is using 16K THPs perhaps it's a
>>> bigger win to just treat it like a base page? I expect the cost/benefit will
>>> change as the THP size increases?
>>
>> Yes, I think for small folios (i.e., 16KiB) it will be rather easy to make a
>> decision. The larger the folio, the larger the page fault latency due to
>> scanning, copying, modifying, which can easily turn undesirable.
>>
>> At least when it comes to page reuse, I have some simple backup plans for small
>> folios if I won't be able to make progress with my other approach.
>
> Do you mean "small large folios" here? i.e. order >= 1? If so, great!
*smaller*, yes :)
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2024-03-08 13:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 9:27 Barry Song
[not found] ` <519fd6a7-072e-43a2-a9a8-2467ee783524@redhat.com>
[not found] ` <cfe7d2b5-eb41-4df0-bf6b-4ed4044e20ea@arm.com>
2024-03-08 13:24 ` David Hildenbrand
2024-03-08 13:45 ` Ryan Roberts
2024-03-08 13:46 ` David Hildenbrand [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4e0891dd-f5ba-4cff-932b-604288540e59@redhat.com \
--to=david@redhat.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chrisl@kernel.org \
--cc=fengwei.yin@intel.com \
--cc=ioworker0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=peterx@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=shy828301@gmail.com \
--cc=songmuchun@bytedance.com \
--cc=v-songbaohua@oppo.com \
--cc=wangkefeng.wang@huawei.com \
--cc=xiehuan09@gmail.com \
--cc=yuzhao@google.com \
--cc=zokeefe@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox