From: Mike Kravetz <mike.kravetz@oracle.com>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>, Michal Hocko <mhocko@suse.com>,
Oscar Salvador <OSalvador@suse.com>,
Yuanxi Liu <y.liu@naruida.com>,
David Hildenbrand <david@redhat.com>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: page_alloc: Assume huge tail pages are valid when allocating contiguous pages
Date: Fri, 14 Apr 2023 13:07:02 -0700 [thread overview]
Message-ID: <20230414200702.GB4712@monkey> (raw)
In-Reply-To: <20230414190630.GA4712@monkey>
On 04/14/23 12:06, Mike Kravetz wrote:
> Thanks Mel!
> Apologies for not noticing when the bug was posted to the list. Otherwise,
> I would have jumped on it.
>
> On 04/14/23 09:22, Mel Gorman wrote:
> > A bug was reported by Yuanxi Liu where allocating 1G pages at runtime is
> > taking an excessive amount of time for large amounts of memory. Further
> > testing allocating huge pages that the cost is linear i.e. if allocating
> > 1G pages in batches of 10 then the time to allocate nr_hugepages from
> > 10->20->30->etc increases linearly even though 10 pages are allocated at
> > each step. Profiles indicated that much of the time is spent checking the
> > validity within already existing huge pages and then attempting a migration
> > that fails after isolating the range, draining pages and a whole lot of
> > other useless work.
> >
> > Commit eb14d4eefdc4 ("mm,page_alloc: drop unnecessary checks from
> > pfn_range_valid_contig") removed two checks, one which ignored huge pages
> > for contiguous allocations as huge pages can migrate. While there may be
> > value on migrating a 2M page to satisfy a 1G allocation, it's pointless
> > to move a 1G page for a new 1G allocation or scan for validity within an
> > existing huge page.
>
> eb14d4eefdc4 was the last patch in Oscar's series "Make alloc_contig_range
> handle Hugetlb pages".
> https://lore.kernel.org/linux-mm/20210419075413.1064-1-osalvador@suse.de/
>
> It seems bailing out of alloc_contig_range when experiencing hugetlb
> pages was an actual issue as the cover letter says:
>
David correctly pointed out that I was confusing alloc_contig_range and
alloc_contig_pages. Sorry!
--
Mike Kravetz
prev parent reply other threads:[~2023-04-14 20:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 8:22 Mel Gorman
2023-04-14 8:55 ` Michal Hocko
2023-04-14 9:52 ` Mel Gorman
2023-04-14 10:19 ` Michal Hocko
2023-04-14 10:31 ` David Hildenbrand
2023-04-14 12:22 ` Matthew Wilcox
2023-04-14 13:29 ` Mel Gorman
2023-04-14 19:06 ` Mike Kravetz
2023-04-14 20:07 ` Mike Kravetz [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=20230414200702.GB4712@monkey \
--to=mike.kravetz@oracle.com \
--cc=OSalvador@suse.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=vbabka@suse.cz \
--cc=y.liu@naruida.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