[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190313075212.wc3pbwixx3ppwxua@d104.suse.de>
Date: Wed, 13 Mar 2019 08:52:16 +0100
From: Oscar Salvador <osalvador@...e.de>
To: Qian Cai <cai@....pw>
Cc: akpm@...ux-foundation.org, mhocko@...nel.org, vbabka@...e.cz,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hotplug: fix offline undo_isolate_page_range()
On Tue, Mar 12, 2019 at 09:42:16PM -0400, Qian Cai wrote:
> +
> + /*
> + * Onlining will reset pagetype flags and makes migrate type
> + * MOVABLE, so just need to decrease the number of isolated
> + * pageblocks zone counter here.
> + */
> + for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
> + int i;
> +
> + for (i = 0; i < pageblock_nr_pages; i++)
> + if (pfn_valid_within(pfn + i)) {
> + zone->nr_isolate_pageblock--;
> + break;
> + }
> + }
> +
I do not really like this.
I first thought about saving the value before entering start_isolate_page_range,
but that could race with alloc_contig_range for instance.
So, why not make start_isolate_page_range to return the actual number of isolated
pageblocks?
Sure, that would mean to change a bit how we threat its return code, but
I think that it is pretty simple.
In that way, we would only have to substract the value start_isolate_page_range
gave us at the end of __offline__pages() to set nr_isolate_pageblock back to
its original value.
--
Oscar Salvador
SUSE L3
Powered by blists - more mailing lists