From: Vlastimil Babka <vbabka@suse.cz>
To: Kent Overstreet <kent.overstreet@gmail.com>,
David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, linux-raid@vger.kernel.org,
linux-block@vger.kernel.org, axboe@kernel.dk,
alexander.h.duyck@linux.intel.com,
David Rientjes <rientjes@google.com>
Subject: Re: [PATCH 1/5] mm: Make free_area->nr_free per migratetype
Date: Mon, 18 Oct 2021 09:44:40 +0200 [thread overview]
Message-ID: <11b2fa69-ebcf-fec4-73e5-51ada24c5aaf@suse.cz> (raw)
In-Reply-To: <YWhCp/lKbJS9XSqn@moria.home.lan>
On 10/14/21 16:45, Kent Overstreet wrote:
> On Wed, Oct 13, 2021 at 06:33:06PM +0200, David Hildenbrand wrote:
>> > @@ -9317,6 +9319,7 @@ void __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
>> > struct page *page;
>> > struct zone *zone;
>> > unsigned int order;
>> > + unsigned int migratetype;
>> > unsigned long flags;
>> >
>> > offline_mem_sections(pfn, end_pfn);
>> > @@ -9346,7 +9349,8 @@ void __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
>> > BUG_ON(page_count(page));
>> > BUG_ON(!PageBuddy(page));
>> > order = buddy_order(page);
>> > - del_page_from_free_list(page, zone, order);
>> > + migratetype = get_pfnblock_migratetype(page, pfn);
>>
>> As the free pages are isolated, theoretically this should be
>> MIGRATE_ISOLATE.
>
> Thanks for noticing that - I somehow missed the fact that pageblock migratetypes
> change at runtime,
Not only that. Buddy merging will also merge pages from different
migratetypes. I think that's the main reason why nr_free is not per
migratetype. Your patch has been attempted few times already, e.g. here [1].
[1]
https://lore.kernel.org/all/alpine.DEB.2.10.1611161731350.17379@chino.kir.corp.google.com/
> so my patch is wrong. I'm going to have to rework my patch to
> store the migratetype of free pages in the page itself.
Yeah that would be the solution. Will likely bring some overhead to
alloc/free fastpaths, which would have to be worth it, so nobody attempted it.
next prev parent reply other threads:[~2021-10-18 7:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 16:00 [PATCH 0/5] Minor mm/struct page work Kent Overstreet
2021-10-13 16:00 ` [PATCH 1/5] mm: Make free_area->nr_free per migratetype Kent Overstreet
2021-10-13 16:33 ` David Hildenbrand
2021-10-14 14:45 ` Kent Overstreet
2021-10-18 7:44 ` Vlastimil Babka [this message]
2021-10-13 16:00 ` [PATCH 2/5] mm: Introduce struct page_free_list Kent Overstreet
2021-10-13 16:00 ` [PATCH 3/5] mm/page_reporting: Improve control flow Kent Overstreet
2021-10-13 16:00 ` [PATCH 4/5] md: Kill usage of page->index Kent Overstreet
2021-10-14 8:02 ` Guoqing Jiang
2021-10-14 8:58 ` heming.zhao
2021-10-14 14:30 ` [PATCH v2] " Kent Overstreet
2021-10-15 3:01 ` Guoqing Jiang
2021-10-15 8:59 ` heming.zhao
2021-10-13 16:00 ` [PATCH 5/5] brd: " Kent Overstreet
2021-10-14 14:27 ` Matthew Wilcox
2021-10-14 15:09 ` David Hildenbrand
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=11b2fa69-ebcf-fec4-73e5-51ada24c5aaf@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=axboe@kernel.dk \
--cc=david@redhat.com \
--cc=kent.overstreet@gmail.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-raid@vger.kernel.org \
--cc=rientjes@google.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).