From: David Hildenbrand <david@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Yin Fengwei <fengwei.yin@intel.com>,
linux-mm@kvack.org, akpm@linux-foundation.org, jack@suse.cz,
hughd@google.com, kirill.shutemov@linux.intel.com,
mhocko@suse.com, ak@linux.intel.com, aarcange@redhat.com,
npiggin@gmail.com, mgorman@techsingularity.net, rppt@kernel.org,
dave.hansen@intel.com, ying.huang@intel.com,
tim.c.chen@intel.com
Subject: Re: [RFC PATCH 0/4] Multiple consecutive page for anonymous mapping
Date: Tue, 10 Jan 2023 15:13:36 +0100 [thread overview]
Message-ID: <589145ce-49f4-5b4c-bdef-ef400f27903f@redhat.com> (raw)
In-Reply-To: <Y7xm4Bn07ZuNaRUr@casper.infradead.org>
On 09.01.23 20:11, Matthew Wilcox wrote:
> On Mon, Jan 09, 2023 at 06:33:09PM +0100, David Hildenbrand wrote:
>> (2) This steals consecutive pages to immediately split them up
>>
>> I know, everybody thinks it might be valuable for their use case to grab all
>> higher-order pages :) It will be "fun" once all these cases start competing.
>> TBH, splitting up them immediately again smells like being the lowest
>> priority among all higher-order users.
>
> Actually, it is good for everybody to allocate higher-order pages, if they
> can make use of them. It has the end effect of reducing fragmentation
> (imagine if the base unit of allocation were 512 bytes; every page fault
> would have to do an order-3 allocation, and it wouldn't be long until
> order-0 allocations had fragmented memory such that we could no longer
> service a page fault).
I don't believe that this reasoning is universally true. But I can see
some part being true if everybody would be allocating higher-order pages
and there would be no memory pressure.
Simple example why I am skeptical: Our free lists hold a order-9 page
and 4 order-0 pages.
It's counter-intuitive to split (fragment!) the order-9 page to allocate
an order-2 page instead of just "consuming the leftover" and letting
somebody else make use of the full order-9 page (e.g., a proper THP).
Now, reality will tell us if we're handing out
higher-order-but-not-thp-order pages too easily to end up fragmenting
the wrong orders. IMHO,
fragmentation is and remains a challenge ... and I don't think
especially once we have more consumers of higher-order pages --
especially where they might not be that beneficial.
I'm happy to be wrong on this one.
>
> Splitting them again is clearly one of the bad things done in this
> proof-of-concept. Anything that goes upstream won't do that, but I
> suspect it was necessary to avoid fixing all the places in the kernel
> that assume anon memory is either order-0 or -9.
Agreed. An usptream version shouldn't perform this split -- which will
require more work.
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2023-01-10 14:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 7:22 Yin Fengwei
2023-01-09 7:22 ` [RFC PATCH 1/4] mcpage: add size/mask/shift definition for multiple consecutive page Yin Fengwei
2023-01-09 13:24 ` Matthew Wilcox
2023-01-09 16:30 ` Dave Hansen
2023-01-09 17:01 ` Matthew Wilcox
2023-01-10 2:53 ` Yin, Fengwei
2023-01-09 7:22 ` [RFC PATCH 2/4] mcpage: anon page: Use mcpage for anonymous mapping Yin Fengwei
2023-01-09 7:22 ` [RFC PATCH 3/4] mcpage: add vmstat counters for mcpages Yin Fengwei
2023-01-09 7:22 ` [RFC PATCH 4/4] mcpage: get_unmapped_area return mcpage size aligned addr Yin Fengwei
2023-01-09 8:37 ` [RFC PATCH 0/4] Multiple consecutive page for anonymous mapping Kirill A. Shutemov
2023-01-11 6:13 ` Yin, Fengwei
2023-01-09 17:33 ` David Hildenbrand
2023-01-09 19:11 ` Matthew Wilcox
2023-01-10 14:13 ` David Hildenbrand [this message]
2023-01-10 3:57 ` Yin, Fengwei
2023-01-10 14:40 ` David Hildenbrand
2023-01-11 6:12 ` Yin, Fengwei
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=589145ce-49f4-5b4c-bdef-ef400f27903f@redhat.com \
--to=david@redhat.com \
--cc=aarcange@redhat.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=fengwei.yin@intel.com \
--cc=hughd@google.com \
--cc=jack@suse.cz \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=npiggin@gmail.com \
--cc=rppt@kernel.org \
--cc=tim.c.chen@intel.com \
--cc=willy@infradead.org \
--cc=ying.huang@intel.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