All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	mhocko@kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 2/2] mm/memory_hotplug: remove duplicate call for set_page_links
Date: Sat, 17 Jun 2017 10:55:49 +0800	[thread overview]
Message-ID: <20170617025549.GA7538@WeideMacBook-Pro.local> (raw)
In-Reply-To: <20170616103350.e065a9838bb50c2dc70a41d8@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

On Fri, Jun 16, 2017 at 10:33:50AM -0700, Andrew Morton wrote:
>On Fri, 16 Jun 2017 17:23:35 +0800 Wei Yang <richard.weiyang@gmail.com> wrote:
>
>> In function move_pfn_range_to_zone(), memmap_init_zone() will call
>> set_page_links for each page.
>
>Well, no.  There are several types of pfn's for which
>memmap_init_zone() will not call
>__init_single_page()->set_page_links().  Probably the code is OK, as
>those are pretty screwy pfn types.  But I'd like to see some
>confirmation that this patch is OK for all such pfns, now and in the
>future?
>

Hmm... when memmap_init_zone() is called during hotplug, this means 
(context != MEMMAP_EARLY).  So it will jump to the end and call
__init_single_page().

Is my understanding corrent?

>> This means we don't need to call it on each
>> page explicitly.
>> 
>> This patch just removes the loop.
>> 
>> ...
>>
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -914,10 +914,6 @@ void __ref move_pfn_range_to_zone(struct zone *zone,
>>  	 * are reserved so nobody should be touching them so we should be safe
>>  	 */
>>  	memmap_init_zone(nr_pages, nid, zone_idx(zone), start_pfn, MEMMAP_HOTPLUG);
>> -	for (i = 0; i < nr_pages; i++) {
>> -		unsigned long pfn = start_pfn + i;
>> -		set_page_links(pfn_to_page(pfn), zone_idx(zone), nid, pfn);
>> -	}
>>  
>>  	set_zone_contiguous(zone);
>>  }

-- 
Wei Yang
Help you, Help me

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2017-06-17  2:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16  9:23 [PATCH 1/2] mmzone: simplify zone_intersects() Wei Yang
2017-06-16  9:23 ` [PATCH 2/2] mm/memory_hotplug: remove duplicate call for set_page_links Wei Yang
2017-06-16 17:33   ` Andrew Morton
2017-06-17  2:55     ` Wei Yang [this message]
2017-06-22  6:50     ` Michal Hocko
2017-06-18 16:59 ` [PATCH 1/2] mmzone: simplify zone_intersects() 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=20170617025549.GA7538@WeideMacBook-Pro.local \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.