From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbdDDMpS (ORCPT ); Tue, 4 Apr 2017 08:45:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:54330 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753198AbdDDMpQ (ORCPT ); Tue, 4 Apr 2017 08:45:16 -0400 Date: Tue, 4 Apr 2017 14:45:08 +0200 From: Michal Hocko To: Tobias Regnery Cc: linux-mm@kvack.org, Andrew Morton , Mel Gorman , Vlastimil Babka , Andrea Arcangeli , Reza Arbab , Yasuaki Ishimatsu , Tang Chen , qiuxishi@huawei.com, Kani Toshimitsu , slaoub@gmail.com, Joonsoo Kim , Andi Kleen , Zhang Zhen , David Rientjes , Daniel Kiper , Igor Mammedov , Vitaly Kuznetsov , LKML , Dan Williams , Heiko Carstens , Lai Jiangshan , Martin Schwidefsky Subject: Re: [PATCH 5/6] mm, memory_hotplug: do not associate hotadded memory to zones until online Message-ID: <20170404124508.GK15132@dhcp22.suse.cz> References: <20170330115454.32154-1-mhocko@kernel.org> <20170330115454.32154-6-mhocko@kernel.org> <20170404122119.qsj3bhqse2qp46fi@builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170404122119.qsj3bhqse2qp46fi@builder> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 04-04-17 14:21:19, Tobias Regnery wrote: [...] > Hi Michal, Hi > building an x86 allmodconfig with next-20170404 results in the following > section mismatch warnings probably caused by this patch: > > WARNING: mm/built-in.o(.text+0x5a1c2): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:memmap_init_zone() > The function move_pfn_range_to_zone() references > the function __meminit memmap_init_zone(). > This is often because move_pfn_range_to_zone lacks a __meminit > annotation or the annotation of memmap_init_zone is wrong. Right. __add_pages which used to call memmap_init_zone before is __ref (to hide it the checker) which is not the case for move_pfn_range_to_zone. I cannot say I would see the point of separating all meminit functions because they are not going away but using __ref for move_pfn_range_to_zone should be as safe as __add_pages is. > WARNING: mm/built-in.o(.text+0x5a25b): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:init_currently_empty_zone() > The function move_pfn_range_to_zone() references > the function __meminit init_currently_empty_zone(). > This is often because move_pfn_range_to_zone lacks a __meminit > annotation or the annotation of init_currently_empty_zone is wrong. and this is the same thing. Thanks a lot. The following patch should fix it. I will keep it separate to have a reference why this has been done... --- >>From 1ff2996125393601a28065c44d790145078483db Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Tue, 4 Apr 2017 14:36:25 +0200 Subject: [PATCH] mm, hotplug: fix the section mismatch warning Tobias has reported following section mismatches introduced by "mm, memory_hotplug: do not associate hotadded memory to zones until online". WARNING: mm/built-in.o(.text+0x5a1c2): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:memmap_init_zone() The function move_pfn_range_to_zone() references the function __meminit memmap_init_zone(). This is often because move_pfn_range_to_zone lacks a __meminit annotation or the annotation of memmap_init_zone is wrong. WARNING: mm/built-in.o(.text+0x5a25b): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:init_currently_empty_zone() The function move_pfn_range_to_zone() references the function __meminit init_currently_empty_zone(). This is often because move_pfn_range_to_zone lacks a __meminit annotation or the annotation of init_currently_empty_zone is wrong. WARNING: vmlinux.o(.text+0x188aa2): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:memmap_init_zone() The function move_pfn_range_to_zone() references the function __meminit memmap_init_zone(). This is often because move_pfn_range_to_zone lacks a __meminit annotation or the annotation of memmap_init_zone is wrong. WARNING: vmlinux.o(.text+0x188b3b): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:init_currently_empty_zone() The function move_pfn_range_to_zone() references the function __meminit init_currently_empty_zone(). This is often because move_pfn_range_to_zone lacks a __meminit annotation or the annotation of init_currently_empty_zone is wrong. Both memmap_init_zone and init_currently_empty_zone are marked __meminit but move_pfn_range_to_zone is used outside of __meminit sections (e.g. devm_memremap_pages) so we have to hide it from the checker by __ref annotation. Reported-by: Tobias Regnery Signed-off-by: Michal Hocko --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0e21b9f67c9d..a358d7a67651 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -884,7 +884,7 @@ static void __meminit resize_pgdat_range(struct pglist_data *pgdat, unsigned lon pgdat->node_spanned_pages = max(start_pfn + nr_pages, old_end_pfn) - pgdat->node_start_pfn; } -void move_pfn_range_to_zone(struct zone *zone, +void __ref move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn, unsigned long nr_pages) { struct pglist_data *pgdat = zone->zone_pgdat; -- 2.11.0 -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f200.google.com (mail-wr0-f200.google.com [209.85.128.200]) by kanga.kvack.org (Postfix) with ESMTP id 692906B0038 for ; Tue, 4 Apr 2017 08:45:17 -0400 (EDT) Received: by mail-wr0-f200.google.com with SMTP id x61so1783806wrb.8 for ; Tue, 04 Apr 2017 05:45:17 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id y27si24392725wrd.81.2017.04.04.05.45.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 04 Apr 2017 05:45:15 -0700 (PDT) Date: Tue, 4 Apr 2017 14:45:08 +0200 From: Michal Hocko Subject: Re: [PATCH 5/6] mm, memory_hotplug: do not associate hotadded memory to zones until online Message-ID: <20170404124508.GK15132@dhcp22.suse.cz> References: <20170330115454.32154-1-mhocko@kernel.org> <20170330115454.32154-6-mhocko@kernel.org> <20170404122119.qsj3bhqse2qp46fi@builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170404122119.qsj3bhqse2qp46fi@builder> Sender: owner-linux-mm@kvack.org List-ID: To: Tobias Regnery Cc: linux-mm@kvack.org, Andrew Morton , Mel Gorman , Vlastimil Babka , Andrea Arcangeli , Reza Arbab , Yasuaki Ishimatsu , Tang Chen , qiuxishi@huawei.com, Kani Toshimitsu , slaoub@gmail.com, Joonsoo Kim , Andi Kleen , Zhang Zhen , David Rientjes , Daniel Kiper , Igor Mammedov , Vitaly Kuznetsov , LKML , Dan Williams , Heiko Carstens , Lai Jiangshan , Martin Schwidefsky On Tue 04-04-17 14:21:19, Tobias Regnery wrote: [...] > Hi Michal, Hi > building an x86 allmodconfig with next-20170404 results in the following > section mismatch warnings probably caused by this patch: > > WARNING: mm/built-in.o(.text+0x5a1c2): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:memmap_init_zone() > The function move_pfn_range_to_zone() references > the function __meminit memmap_init_zone(). > This is often because move_pfn_range_to_zone lacks a __meminit > annotation or the annotation of memmap_init_zone is wrong. Right. __add_pages which used to call memmap_init_zone before is __ref (to hide it the checker) which is not the case for move_pfn_range_to_zone. I cannot say I would see the point of separating all meminit functions because they are not going away but using __ref for move_pfn_range_to_zone should be as safe as __add_pages is. > WARNING: mm/built-in.o(.text+0x5a25b): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:init_currently_empty_zone() > The function move_pfn_range_to_zone() references > the function __meminit init_currently_empty_zone(). > This is often because move_pfn_range_to_zone lacks a __meminit > annotation or the annotation of init_currently_empty_zone is wrong. and this is the same thing. Thanks a lot. The following patch should fix it. I will keep it separate to have a reference why this has been done... ---