From: Gavin Shan <gshan@redhat.com>
To: David Hildenbrand <david@redhat.com>, linux-mm@kvack.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
djwong@kernel.org, willy@infradead.org,
akpm@linux-foundation.org, hughd@google.com,
torvalds@linux-foundation.org, zhenyzha@redhat.com,
shan.gavin@gmail.com
Subject: Re: [PATCH 3/4] mm/readahead: Limit page cache size in page_cache_ra_order()
Date: Wed, 26 Jun 2024 10:48:52 +1000 [thread overview]
Message-ID: <d2e3e73f-16c1-4bc0-9e7c-52fcade1c2e1@redhat.com> (raw)
In-Reply-To: <6a8fa8aa-fb6f-485b-92b6-868a522bd7fc@redhat.com>
On 6/26/24 4:45 AM, David Hildenbrand wrote:
> On 25.06.24 11:06, Gavin Shan wrote:
>> In page_cache_ra_order(), the maximal order of the page cache to be
>> allocated shouldn't be larger than MAX_PAGECACHE_ORDER. Otherwise,
>> it's possible the large page cache can't be supported by xarray when
>> the corresponding xarray entry is split.
>>
>> For example, HPAGE_PMD_ORDER is 13 on ARM64 when the base page size
>> is 64KB. The PMD-sized page cache can't be supported by xarray.
>>
>> Suggested-by: David Hildenbrand <david@redhat.com>
>
> Heh, you came up with this yourself concurrently :) so feel free to drop that.
>
> Acked-by: David Hildenbrand <david@redhat.com>
>
David, thanks for your follow-up and reviews. I will drop that tag in next respin :)
Thanks,
Gavin
>> Signed-off-by: Gavin Shan <gshan@redhat.com>
>> ---
>> mm/readahead.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/mm/readahead.c b/mm/readahead.c
>> index c1b23989d9ca..817b2a352d78 100644
>> --- a/mm/readahead.c
>> +++ b/mm/readahead.c
>> @@ -503,11 +503,11 @@ void page_cache_ra_order(struct readahead_control *ractl,
>> limit = min(limit, index + ra->size - 1);
>> - if (new_order < MAX_PAGECACHE_ORDER) {
>> + if (new_order < MAX_PAGECACHE_ORDER)
>> new_order += 2;
>> - new_order = min_t(unsigned int, MAX_PAGECACHE_ORDER, new_order);
>> - new_order = min_t(unsigned int, new_order, ilog2(ra->size));
>> - }
>> +
>> + new_order = min_t(unsigned int, MAX_PAGECACHE_ORDER, new_order);
>> + new_order = min_t(unsigned int, new_order, ilog2(ra->size));
>> /* See comment in page_cache_ra_unbounded() */
>> nofs = memalloc_nofs_save();
>
next prev parent reply other threads:[~2024-06-26 0:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 9:06 [PATCH 0/4] mm/filemap: Limit page cache size to that supported by xarray Gavin Shan
2024-06-25 9:06 ` [PATCH 1/4] mm/filemap: Make MAX_PAGECACHE_ORDER acceptable to xarray Gavin Shan
2024-06-25 18:43 ` David Hildenbrand
2024-06-25 9:06 ` [PATCH 2/4] mm/filemap: Skip to allocate PMD-sized folios if needed Gavin Shan
2024-06-25 18:44 ` David Hildenbrand
2024-06-25 9:06 ` [PATCH 3/4] mm/readahead: Limit page cache size in page_cache_ra_order() Gavin Shan
2024-06-25 18:45 ` David Hildenbrand
2024-06-26 0:48 ` Gavin Shan [this message]
2024-06-25 9:06 ` [PATCH 4/4] mm/shmem: Disable PMD-sized page cache if needed Gavin Shan
2024-06-25 18:50 ` David Hildenbrand
2024-06-26 8:24 ` Ryan Roberts
2024-06-25 18:37 ` [PATCH 0/4] mm/filemap: Limit page cache size to that supported by xarray Andrew Morton
2024-06-25 18:51 ` David Hildenbrand
2024-06-25 18:58 ` Andrew Morton
2024-06-25 19:05 ` David Hildenbrand
2024-06-26 0:37 ` Gavin Shan
2024-06-26 20:38 ` Andrew Morton
2024-06-26 23:05 ` Gavin Shan
2024-06-26 20:54 ` Matthew Wilcox
2024-06-26 23:48 ` Gavin Shan
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=d2e3e73f-16c1-4bc0-9e7c-52fcade1c2e1@redhat.com \
--to=gshan@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=djwong@kernel.org \
--cc=hughd@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shan.gavin@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.org \
--cc=zhenyzha@redhat.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;
as well as URLs for NNTP newsgroup(s).