linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.de>
To: Qian Cai <cai@lca.pw>
Cc: akpm@linux-foundation.org, mhocko@kernel.org, vbabka@suse.cz,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hotplug: fix offline undo_isolate_page_range()
Date: Wed, 13 Mar 2019 08:52:16 +0100	[thread overview]
Message-ID: <20190313075212.wc3pbwixx3ppwxua@d104.suse.de> (raw)
In-Reply-To: <20190313014216.36782-1-cai@lca.pw>

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


  reply	other threads:[~2019-03-13  7:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13  1:42 Qian Cai
2019-03-13  7:52 ` Oscar Salvador [this message]
2019-03-13  8:01   ` Michal Hocko

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=20190313075212.wc3pbwixx3ppwxua@d104.suse.de \
    --to=osalvador@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=vbabka@suse.cz \
    /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