Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp993640ybx; Wed, 30 Oct 2019 08:19:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCkBAItWUm7xXqU21I1kirqjW9mUuQfI2dodoqRkg8GqE4FqRJEADW46JE9TuCqAwR2TW3 X-Received: by 2002:a17:906:524b:: with SMTP id y11mr59724ejm.82.1572448751036; Wed, 30 Oct 2019 08:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572448751; cv=none; d=google.com; s=arc-20160816; b=QpbnWQknoBcthu54aqK9RiMzwelfICgso/yNrKAGwi5ILS561CmcCHIEVbm1F8riBZ z7B9bGOjpJq9RywQ3qCWVu/FK4encC9y84aXQzyDzkXIkawVCVgdXiZevZKRUZHsKi5P lkLkfZSYhrDpqIqeWmd/7e+9Ac0yNhgw0anmQnLithOaEC1GZ+LtjRkRgaBc1xjCjS1D WVXC3mgzQQ1QfDHUqCBOrKI3rMGBJREk7ddWj5U0ZTEXDgnBbmnILZy43KHKM/wnflRq D3hOt/IAObFcnajsKHcxpzhxWJMsXfiHbb+UsjvlRfW312kuRf30RHLbZIeml+eTKT4E r73A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:date:subject:cc:to:from; bh=dGEygH3bG9c4lm04YERKBamwzTFN3FnwmUXhhuXKlUQ=; b=YMcT+Q/XrOyiMV6Sv+Ve4BALuxe3NXcVL1HhnF1uQMofppz0FngB2uV2qjDd8XxJjl rCbk1KHD19V1ShsYl4/yrPePhUHxSrYRp+uABf5vChsKhbMJoXOU3NqXbuZxB8CmfrIh uL+ej6UcPh3qcyGojp9wA9SvQmVoN4u6UxXJMK4pJpTI1UrpHtKUW0Pc8fTfqytTueuI ovjExkndtvoWrdon4Fp7uP5DXgKEUoH0JXef3WLoH4D482M8e72vAQsNwkr1H3w589ze a9KEwKzV/iDs0njQktHMzZxxTa1vEy7m1fRMZL4fYP9nVAlIwTY23/IepIpMrAXvq0QK doeg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jz21si1281814ejb.422.2019.10.30.08.18.46; Wed, 30 Oct 2019 08:19:11 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726967AbfJ3PQy (ORCPT + 99 others); Wed, 30 Oct 2019 11:16:54 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60084 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbfJ3PQy (ORCPT ); Wed, 30 Oct 2019 11:16:54 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x9UF61Ai129567 for ; Wed, 30 Oct 2019 11:16:52 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vycekj4dd-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 30 Oct 2019 11:16:51 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 30 Oct 2019 15:16:48 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 30 Oct 2019 15:16:46 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x9UFGigr51904710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Oct 2019 15:16:44 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 51984A4054; Wed, 30 Oct 2019 15:16:44 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ECAF7A4060; Wed, 30 Oct 2019 15:16:43 +0000 (GMT) Received: from white.boeblingen.de.ibm.com (unknown [9.152.96.251]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 30 Oct 2019 15:16:43 +0000 (GMT) From: Ilya Leoshkevich To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Heiko Carstens , Vasily Gorbik , David Hildenbrand , Oscar Salvador , Ilya Leoshkevich Subject: [PATCH v2] mm/sparse.c: mark populate_section_memmap as __meminit Date: Wed, 30 Oct 2019 16:16:39 +0100 X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19103015-0012-0000-0000-0000035F2C4E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19103015-0013-0000-0000-0000219A729B Message-Id: <20191030151639.41486-1-iii@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-30_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910300141 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v1 -> v2: Do not touch mm/sparse.c version of __populate_section_memmap: its __init annotation is correct, since it is only called during init phase (by sparse_init_nid), and contains the call to another __init function. Spotted by kbuild test robot and Oscar Salvador . I was notified that v1 has already been included into http://ozlabs.org/~akpm/mmots/broken-out. Since this is not a git repository, I've decided to send a v2 instead of the fix. Please let me know if I should send a fix instead. mm/sparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index f6891c1992b1..c2c01b6330af 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -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; -- 2.23.0