Re: [PATCH 2/2] mm/memory_hotplug: remove duplicate call for set_page_links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux