From: Mike Kravetz <mike.kravetz@oracle.com>
To: Doug Berger <opendmb@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Muchun Song <songmuchun@bytedance.com>,
Oscar Salvador <osalvador@suse.de>,
Michal Hocko <mhocko@suse.com>,
David Hildenbrand <david@redhat.com>,
Florian Fainelli <f.fainelli@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] mm/hugetlb: hugepage migration enhancements
Date: Fri, 23 Sep 2022 15:51:25 -0700 [thread overview]
Message-ID: <Yy44bWqS2/hJuiZp@monkey> (raw)
In-Reply-To: <829c3fe1-54a2-53ba-9448-d80196b5ebf0@gmail.com>
On 09/22/22 16:27, Doug Berger wrote:
> On 9/22/2022 3:41 PM, Mike Kravetz wrote:
> > On 09/22/22 13:25, Mike Kravetz wrote:
> > > On 09/21/22 15:36, Doug Berger wrote:
> > >
> > > As noted above, for pages to be migrated we first try to use an existing
> > > free huge page as the target. Quite some time ago, Michal added code to
> > > allocate a new page from buddy as the target if no free huge pages were
> > > available. This change also included a special flag to dissolve the
> > > source huge page when it is freed. It seems like this is the exact
> > > behavior we want here? I wonder if it might be easier just to use this
> > > existing code?
> >
> > Totally untested, but I believe the patch below would accomplish this.
> >
> > From aa8fc11bb67bc9e67e3b6b280fab339afce37759 Mon Sep 17 00:00:00 2001
> > From: Mike Kravetz <mike.kravetz@oracle.com>
> > Date: Thu, 22 Sep 2022 15:32:10 -0700
> > Subject: [PATCH] hugetlb: force alloc_contig_range hugetlb migrations to
> > allocate new pages
> >
> > When migrating hugetlb pages as the result of an alloc_contig_range
> > operation, allocate a new page from buddy for the migration target.
> > This guarantees that the number of hugetlb pages is not decreased by
> > the operation. In addition, this will result in the special HPageTemporary
> > flag being set in the source page so that it will be dissolved when
> > freed.
> >
<snip>
> I believe I exposed alloc_migrate_huge_page() and conditionally invoked it
> from alloc_migration_target() when in alloc_contig, which is roughly
> equivalent. I didn't consider modifying the mtc to pass the information so
> my logic in alloc_migration_target() was a little kludgy.
>
> Like I said, this can be made to work and I'm happy to accept an alternative
> if others agree. I think the isolation test of patch 3 is also still
> desirable.
Yes, hoping to get some other opinions as well.
I do agree that patch 3 is still a good idea.
--
Mike Kravetz
next prev parent reply other threads:[~2022-09-23 22:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 22:36 Doug Berger
2022-09-21 22:36 ` [PATCH 1/3] mm/hugetlb: refactor alloc_and_dissolve_huge_page Doug Berger
2022-09-21 22:36 ` [PATCH 2/3] mm/hugetlb: allow migrated hugepage to dissolve when freed Doug Berger
2022-09-21 22:36 ` [PATCH 3/3] mm/hugetlb: add hugepage isolation support Doug Berger
2022-09-22 20:25 ` [PATCH 0/3] mm/hugetlb: hugepage migration enhancements Mike Kravetz
2022-09-22 22:41 ` Mike Kravetz
2022-09-22 23:27 ` Doug Berger
2022-09-23 22:51 ` Mike Kravetz [this message]
2022-09-22 23:14 ` Doug Berger
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=Yy44bWqS2/hJuiZp@monkey \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=opendmb@gmail.com \
--cc=osalvador@suse.de \
--cc=songmuchun@bytedance.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