Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6164382imm; Wed, 27 Jun 2018 03:22:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJrRG2IiXyUg9GCoHSGGYVy/LNrs3RcAh8tT4U6IwXcB72L/yC1zV+iGEFNPoBtGIBIfVQf X-Received: by 2002:a63:920c:: with SMTP id o12-v6mr4610371pgd.233.1530094977876; Wed, 27 Jun 2018 03:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530094977; cv=none; d=google.com; s=arc-20160816; b=WZF94X3iBSRk3IvH5urNnon5LatZcfTmhXk/MPYAZSGGYBRmIRpY0ZVxGlr2ezqV8i UlSuvNqHzXl6abqV5jhFusFw2NOVMzKke1RSO2+Ezt+Xf9Wh1z8DfvWZEJxMxkyFZ+0g yZGehEJzzrnDSZr4CPZW02xlhp3tH2GPhqbHempUJrzgLXlmvbdi+88XQBdJPmj5U1mi cWdEbvkLCRa3xdEydgVXwvYDwoBiWo3c/FIadhOLBCctLCpAR2yZY7i6jNpO7ZZpbIwF RgTVpWAXf3Z9Uz1O7pRKJLkR4XLKJRVaaUS/YzCr/3SegOVHjAi8QOLwE9nQoiG9r9D8 /tLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=sVK1A0JgYdjzBWfdFBlDAoOCNuNL4l8nfXwolLGGM0w=; b=D5m6lxvbuDIL/7n36ygFB0ag4q+9Mm/4Y9nsBf28cEgtbux/GvxMcdXRicyd2A1L6R iwYub09EEQxf3ptiuk7rpb1pbwhceZgWFZnCUYBbE26X/uHDli2FBpRzN257GTobT2pe a5noe0XMY7j6pcCQcJybVyVMdqDTgF1ZVcrkwtvfkcBanDFhjsA2v9LZEuhvxmtUxPWJ 4CC8kGCoAOo6aut3s/hd6FZqcARIp+jje7tSTbHbEfiVVAe4riuLipYQIY+EGkGKqYIS DmaULAWUlXW2BKyt2wu+0c+9C8+8ma+ClkET9UlhRhInDGoOVAqfW4amV3uZlcYQserG pYkA== 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 c17-v6si3239981pgf.352.2018.06.27.03.22.40; Wed, 27 Jun 2018 03:22:57 -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 S933879AbeF0KFW (ORCPT + 99 others); Wed, 27 Jun 2018 06:05:22 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56230 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932089AbeF0KFU (ORCPT ); Wed, 27 Jun 2018 06:05:20 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5R9xI7N037429 for ; Wed, 27 Jun 2018 06:05:20 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jv76w3snj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 27 Jun 2018 06:05:20 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jun 2018 11:05:17 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 27 Jun 2018 11:05:12 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5RA5BFm32309378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 Jun 2018 10:05:11 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9645A4053; Wed, 27 Jun 2018 11:05:02 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C13C4A405D; Wed, 27 Jun 2018 11:05:01 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.118]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 27 Jun 2018 11:05:01 +0100 (BST) Date: Wed, 27 Jun 2018 13:05:08 +0300 From: Mike Rapoport To: Michal Hocko Cc: Mathieu Malaterre , Andrew Morton , Tony Luck , Pavel Tatashin , Daniel Jordan , Steven Sistare , Daniel Vacek , Stefan Agner , Joe Perches , Andy Shevchenko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/memblock: add missing include References: <20180622210542.2025-1-malat@debian.org> <20180625171513.31845-1-malat@debian.org> <20180625180717.GS28965@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180625180717.GS28965@dhcp22.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18062710-0016-0000-0000-000001E0A02A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062710-0017-0000-0000-00003234DE3E Message-Id: <20180627100508.GB4291@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-27_02:,, 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-1806210000 definitions=main-1806270115 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 25, 2018 at 08:07:17PM +0200, Michal Hocko wrote: > On Mon 25-06-18 19:15:12, Mathieu Malaterre wrote: > > Commit 26f09e9b3a06 ("mm/memblock: add memblock memory allocation apis") > > introduced two new function definitions: > > > > memblock_virt_alloc_try_nid_nopanic() > > memblock_virt_alloc_try_nid() > > > > Commit ea1f5f3712af ("mm: define memblock_virt_alloc_try_nid_raw") > > introduced the following function definition: > > > > memblock_virt_alloc_try_nid_raw() > > > > This commit adds an include of header file to provide > > the missing function prototypes. Silence the following gcc warning > > (W=1): > > > > mm/memblock.c:1334:15: warning: no previous prototype for `memblock_virt_alloc_try_nid_raw' [-Wmissing-prototypes] > > mm/memblock.c:1371:15: warning: no previous prototype for `memblock_virt_alloc_try_nid_nopanic' [-Wmissing-prototypes] > > mm/memblock.c:1407:15: warning: no previous prototype for `memblock_virt_alloc_try_nid' [-Wmissing-prototypes] > > > > It also adds #ifdef blockers to prevent compilation failure on mips/ia64 > > where CONFIG_NO_BOOTMEM=n. Because Makefile already does: > > > > obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o > > > > The #ifdef has been simplified from: > > > > #if defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) > > > > to simply: > > > > #if defined(CONFIG_NO_BOOTMEM) > > Well, I would apreciate an explanation why do we need NO_BOOTMEM guard > in the first place rather than why HAVE_MEMBLOCK is not needed. > > > Suggested-by: Tony Luck > > Suggested-by: Michal Hocko > > Signed-off-by: Mathieu Malaterre > > Anyway this looks better. I wish we can actually get rid of bootmem > allocator which would simplify this as well but that is another topic. There only 5 arches with bootmem left :) I've started looking into it, but it goes slow :( > Acked-by: Michal Hocko > > > --- > > v2: Simplify #ifdef > > > > mm/memblock.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/mm/memblock.c b/mm/memblock.c > > index 03d48d8835ba..611a970ac902 100644 > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -20,6 +20,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -1224,6 +1225,7 @@ phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, i > > return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE); > > } > > > > +#if defined(CONFIG_NO_BOOTMEM) > > /** > > * memblock_virt_alloc_internal - allocate boot memory block > > * @size: size of memory block to be allocated in bytes > > @@ -1431,6 +1433,7 @@ void * __init memblock_virt_alloc_try_nid( > > (u64)max_addr); > > return NULL; > > } > > +#endif > > > > /** > > * __memblock_free_early - free boot memory block > > -- > > 2.11.0 > > > > -- > Michal Hocko > SUSE Labs > -- Sincerely yours, Mike.