Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp573289ybx; Wed, 30 Oct 2019 01:15:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1dBm47ElEYdMvfJGtLcqeOqbww28l42XneFxOcqYwblAcTRvjoPk1Tg3v0+wyrJxUrQRo X-Received: by 2002:a05:6402:1255:: with SMTP id l21mr30498336edw.41.1572423335742; Wed, 30 Oct 2019 01:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572423335; cv=none; d=google.com; s=arc-20160816; b=hArfpABXeMBbl52LUkdR/V4R+LX925vpjvvZZhzlqAQi4kxtCXVocnzLXsPeguMJoq j3LKcBSR667/TQ0+qPfh3psvfYKHNkmEOaP4+JRARlYGOgwoaCEq2KX3FH/jHkB/f/RS fePEBhZnYScCSaZnUZiL0z6nqRlZdTLd8rQdgc9i+wyiRV9mg3Zj+pYIeidgYhHQmWbD Omedbzhm0qHdzOalB+vcy6mhfUOQVy/8NGRD57R6qzh6ar5Op7j3fzOGQcmUDp91U9O7 rYIF/jzD5r+ExcuRNxLTtq5iay++g2oiYQejz/a8siQU/wJkwbIO8TMD4SkK4HruKGiH s1rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=BrZLMZcyFtOYrd246f9g2sI9EHvpCMvZD5aWyFDs9W8=; b=hsLohLiIf8UwVARQsUHD2kxMnpuZhyzZBvSl3ZpJe8TqWWYRmV281k6PI2MI4l0HSE GjspkjXdvZfecZLL7ICrzKtC1hPS7Pk1YZhJGb+sk5WyUcrvJiY/pAWC0+RyGHnUrAY0 qCd1WUOzYrqSundQWvFUvjuNM+0aveQu8QJDZO0zzXg1bNVgbo/zcN/w1CYG0719PMj7 DYpXVTnZkop1nfYNDbYargX/ii/q2WaKCaWEgnimfR4ygFv0ieT2iqCkoktfapNqbldU 9FhL9eB4YdErnXRtKAYjA9rp73M4AARXq1oh5cL+YZVNm71bveNzOpCfFGLXhyIzSFDk /w/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si750356ejz.77.2019.10.30.01.15.12; Wed, 30 Oct 2019 01:15:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726417AbfJ3IOJ (ORCPT + 99 others); Wed, 30 Oct 2019 04:14:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:58982 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726027AbfJ3IOI (ORCPT ); Wed, 30 Oct 2019 04:14:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E7637B1F2; Wed, 30 Oct 2019 08:14:06 +0000 (UTC) Date: Wed, 30 Oct 2019 09:14:04 +0100 From: Oscar Salvador To: Ilya Leoshkevich Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Heiko Carstens , Vasily Gorbik Subject: Re: [PATCH] mm/sparse.c: mark populate_section_memmap as __meminit Message-ID: <20191030081359.GA11931@linux> References: <20191028165549.14478-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191028165549.14478-1-iii@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 28, 2019 at 05:55:49PM +0100, Ilya Leoshkevich wrote: > Building the kernel on s390 with -Og produces the following warning: > > WARNING: vmlinux.o(.text+0x28dabe): Section mismatch in reference from the function populate_section_memmap() to the function .meminit.text:__populate_section_memmap() > The function populate_section_memmap() references > the function __meminit __populate_section_memmap(). > This is often because populate_section_memmap lacks a __meminit > annotation or the annotation of __populate_section_memmap is wrong. > > While -Og is not supported, in theory this might still happen with > another compiler or on another architecture. So fix this by using the > correct section annotations. > > Signed-off-by: Ilya Leoshkevich > --- > mm/sparse.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/mm/sparse.c b/mm/sparse.c > index f6891c1992b1..0f1f36443a96 100644 > --- a/mm/sparse.c > +++ b/mm/sparse.c > @@ -448,7 +448,7 @@ static unsigned long __init section_map_size(void) > return PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION); > } > > -struct page __init *__populate_section_memmap(unsigned long pfn, > +struct page __meminit *__populate_section_memmap(unsigned long pfn, > unsigned long nr_pages, int nid, struct vmem_altmap *altmap) > { > unsigned long size = section_map_size(); > @@ -647,7 +647,7 @@ void offline_mem_sections(unsigned long start_pfn, unsigned long end_pfn) > #endif > > #ifdef CONFIG_SPARSEMEM_VMEMMAP > -static struct page *populate_section_memmap(unsigned long pfn, > +static struct page * __meminit populate_section_memmap(unsigned long pfn, > unsigned long nr_pages, int nid, struct vmem_altmap *altmap) > { > return __populate_section_memmap(pfn, nr_pages, nid, altmap); > @@ -669,7 +669,7 @@ static void free_map_bootmem(struct page *memmap) > vmemmap_free(start, end, NULL); > } > #else > -struct page *populate_section_memmap(unsigned long pfn, > +struct page * __meminit populate_section_memmap(unsigned long pfn, > unsigned long nr_pages, int nid, struct vmem_altmap *altmap) > { > struct page *page, *ret; I did not really check deep, but I __think__ you only need to add __meminit in populate_section_memmap functions. __populate_section_memmap for SPARSE case is only used at init phase. -- Oscar Salvador SUSE L3