From: David Hildenbrand <david@redhat.com>
To: Vlastimil Babka <vbabka@suse.cz>, osalvador@suse.de
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-hyperv@vger.kernel.org, xen-devel@lists.xenproject.org,
linux-acpi@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Alexander Duyck <alexander.h.duyck@linux.intel.com>,
Dave Hansen <dave.hansen@intel.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
"K. Y. Srinivasan" <kys@microsoft.com>,
Mel Gorman <mgorman@techsingularity.net>,
Michael Ellerman <mpe@ellerman.id.au>,
Michal Hocko <mhocko@kernel.org>, Mike Rapoport <rppt@kernel.org>,
Scott Cheloha <cheloha@linux.ibm.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
Wei Liu <wei.liu@kernel.org>,
Wei Yang <richard.weiyang@linux.alibaba.com>
Subject: Re: [PATCH RFC 0/4] mm: place pages to the freelist tail when onling and undoing isolation
Date: Thu, 24 Sep 2020 16:29:50 +0200 [thread overview]
Message-ID: <5e5e92dc-3cb4-6e97-5d35-258c4cf35391@redhat.com> (raw)
In-Reply-To: <3af66d9b-70b1-6c19-0073-fa33c57edcdd@suse.cz>
>> If that would ever change, the optimization here would be lost and we
>> would have to think of something else. Nothing would actually break -
>> and it's all kept directly in page_alloc.c
>
> Sure, but then it can become a pointless code churn.
Indeed, and if there are valid concerns that this will happen in the
near future (e.g., < 1 year), I agree that we should look into
alternatives right from the start. Otherwise it's good enough until some
of the other things I mentioned below become real (which could also take
a while ...).
>
>> I'd like to stress that what I propose here is both simple and powerful.
>>
>>> possible I think, such as preparing a larger MIGRATE_UNMOVABLE area in the
>>> existing memory before we allocate those long-term management structures. Or
>>> onlining a bunch of blocks as zone_movable first and only later convert to
>>> zone_normal in a controlled way when existing normal zone becomes depeted?
>>
>> I see the following (more or less complicated) alternatives
>>
>> 1) Having a larger MIGRATE_UNMOVABLE area
>>
>> a) Sizing it is difficult. I mean you would have to plan ahead for all
>> memory you might eventually hotplug later - and that could even be
>
> Yeah, hence my worry about existing interfaces that work on 128MB blocks
> individually without a larger strategy.
Yes, in the works :)
>
>> impossible if you hotplug quite a lot of memory to a smaller machine.
>> (I've seen people in the vm/container world trying to hotplug 128GB
>> DIMMs to 2GB VMs ... and failing for obvious reasons)
>
> Some planning should still be possible to maximize the contiguous area without
> unmovable allocations.
Indeed, optimizing that is very high on my list of things to look into ...
>>
>> we would, once again, never be able to allocate a gigantic page because
>> all [N] would contain a memmap.
>
> The second approach should work, if you know how much you are going to online,
> and plan the size the N group accordingly, and if the onlined amount is several
> gigabytes, then only the first one (or first X) will be unusable for a gigantic
> page, but the rest would be? Can't get much better than that.
Indeed, it's the optimal case (assuming one can come up with a safe zone
balance - which is usually possible, but unfortunately, there are
exceptions one at least has to identify).
[...]
>
> I've reviewed the series and I won't block it - yes it's an optimistic approach
> that can break and leave us with code churn. But at least it's not that much
Thanks.
I'll try to document somewhere that the behavior of FOP_TO_TAIL is a
pure optimization and might change in the future - along with the case
it tried to optimize (so people know what the use case was).
> code and the extra test in __free_one_page() shouldn't make this hotpath too
I assume the compiler is able to completely propagate constants and
optimize that out - I haven't checked, though.
> worse. But I still hope we can achieve a more robust solution one day.
I definitely agree. I'd also prefer some kind of guarantees, but I
learned that things always sound easier than they actually are when it
comes to memory management in Linux ... and they take a lot of time (for
example, Michal's/Oscar's attempts to implement vmemmap on hotadded memory).
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2020-09-24 14:30 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 18:34 [PATCH RFC 0/4] mm: place pages to the freelist tail when onling and undoing isolation David Hildenbrand
2020-09-16 18:34 ` [PATCH RFC 1/4] mm/page_alloc: convert "report" flag of __free_one_page() to a proper flag David Hildenbrand
2020-09-16 21:44 ` Alexander Duyck
2020-09-18 1:53 ` Wei Yang
2020-09-18 7:23 ` David Hildenbrand
2020-09-24 10:19 ` Vlastimil Babka
2020-09-25 10:34 ` Oscar Salvador
2020-09-16 18:34 ` [PATCH RFC 2/4] mm/page_alloc: place pages to tail in __putback_isolated_page() David Hildenbrand
2020-09-16 21:50 ` Alexander Duyck
2020-09-18 2:07 ` Wei Yang
2020-09-18 7:27 ` David Hildenbrand
2020-09-21 1:57 ` Wei Yang
2020-09-18 2:16 ` Wei Yang
2020-09-18 7:29 ` David Hildenbrand
2020-09-24 10:37 ` Vlastimil Babka
2020-09-25 8:10 ` David Hildenbrand
2020-09-25 13:19 ` Oscar Salvador
2020-09-25 13:30 ` David Hildenbrand
2020-09-16 18:34 ` [PATCH RFC 3/4] mm/page_alloc: always move pages to the tail of the freelist in unset_migratetype_isolate() David Hildenbrand
2020-09-18 2:29 ` Wei Yang
2020-09-18 7:30 ` David Hildenbrand
2020-09-24 11:13 ` Vlastimil Babka
2020-09-25 2:45 ` Wei Yang
2020-09-25 8:05 ` David Hildenbrand
2020-09-25 8:39 ` Vlastimil Babka
2020-09-25 13:13 ` David Hildenbrand
2020-09-25 13:57 ` Oscar Salvador
2020-09-16 18:34 ` [PATCH RFC 4/4] mm/page_alloc: place pages to tail in __free_pages_core() David Hildenbrand
2020-09-24 13:44 ` Vlastimil Babka
2020-09-28 7:58 ` Oscar Salvador
2020-09-28 8:36 ` David Hildenbrand
2020-09-28 12:53 ` Oscar Salvador
2020-09-16 18:50 ` [PATCH RFC 0/4] mm: place pages to the freelist tail when onling and undoing isolation osalvador
2020-09-16 19:31 ` David Hildenbrand
2020-09-18 2:30 ` Wei Yang
2020-09-18 7:32 ` David Hildenbrand
2020-09-23 14:31 ` Vlastimil Babka
2020-09-23 15:26 ` David Hildenbrand
2020-09-24 9:40 ` Mel Gorman
2020-09-24 9:54 ` David Hildenbrand
2020-09-24 13:59 ` Vlastimil Babka
2020-09-24 14:29 ` David Hildenbrand [this message]
2020-09-24 1:57 ` Wei Yang
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=5e5e92dc-3cb4-6e97-5d35-258c4cf35391@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=cheloha@linux.ibm.com \
--cc=dave.hansen@intel.com \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=osalvador@suse.de \
--cc=richard.weiyang@linux.alibaba.com \
--cc=rppt@kernel.org \
--cc=sthemmin@microsoft.com \
--cc=vbabka@suse.cz \
--cc=wei.liu@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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).