Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5026676img; Wed, 27 Mar 2019 00:03:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDziwGWzqtqheKy+LmEele6h+kvtJUeWWc6/0ggK+6evD6HOD0gn5qykm+kDhjjWejqV+K X-Received: by 2002:a17:902:5ac9:: with SMTP id g9mr35696015plm.205.1553670227985; Wed, 27 Mar 2019 00:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553670227; cv=none; d=google.com; s=arc-20160816; b=EnJeyAcixZ4ZpU/6ydIvjaP9zTq2KPLlNkqopo0tg8a7yKhzTzExvaxV3L1nD/KlOR ILSPnmnkncauh05zDpYGw46HTNL3RnfDi+bpMg78GFlzQi8whV8mCWdJMO2WnXh3QPkK TVczW+rZSmh8ABzRYFqGPb1WHC2bWrHXQaTGklvK/CqAA822YMC8YTLbwag3/EEKMthH C5PTsuhc6iEHvO/BOi2TVSDM9KPOYqO0AveEmp2XAB/GaXBy9pwCsF9A1ljuMFWrZXq6 syoyjLc/vq8pGhHrMxTOO7ae4i5zTRvGqFj1rLySMXFYZj44VDvxqfej7XRw+418IjEg PLuQ== 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 :content-language:in-reply-to:mime-version:user-agent:date:from :references:to:subject; bh=+tAH2xcgBrSRADmZ6HcJf6eGMVF/XnjCBFBDhIT93co=; b=FfP0Biu/+Vx9C/FFZTzakfskZJ7msBzGMmPLCI6u6FB4JhuhVMS8LR5yJkB39xaYxN xDC3IxLIrNSsUZdIKKJJ17zSJBFoH2TgkxPeyoJhYvCTcU+kxXY61EWrWwxfXm43BqPz Mrths1heidJW6yYm7Ig7o5ueZO/9n3xPy2c4r4QadXkfDBF/B2aDFCwaeHKrBsdoWUD8 vglNLeSh2OMrXQDNLUmjDeblO0tHEsF7xfTJT633ckfhsHNbV9jiT2p31AJfzHTKwMkW JgRFQP48NOFVedN1nff9juRb5/oJsoYtRgcq6GExVH0Kx2FP2igssCTARkHcspradWhI wuww== 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 l37si5543837plb.173.2019.03.27.00.03.31; Wed, 27 Mar 2019 00:03:47 -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 S1731509AbfC0HBh (ORCPT + 99 others); Wed, 27 Mar 2019 03:01:37 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49166 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbfC0HBh (ORCPT ); Wed, 27 Mar 2019 03:01:37 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2R70CHd139696 for ; Wed, 27 Mar 2019 03:01:36 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rg3yk8xwp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 27 Mar 2019 03:01:36 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Mar 2019 07:01:33 -0000 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 27 Mar 2019 07:01:26 -0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2R71NFe23986222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Mar 2019 07:01:24 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D880DC605B; Wed, 27 Mar 2019 07:01:23 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 188B1C6063; Wed, 27 Mar 2019 07:01:12 +0000 (GMT) Received: from [9.102.0.57] (unknown [9.102.0.57]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 27 Mar 2019 07:01:11 +0000 (GMT) Subject: Re: [PATCH v8 4/4] hugetlb: allow to free gigantic pages regardless of the configuration To: Alexandre Ghiti , mpe@ellerman.id.au, Andrew Morton , Vlastimil Babka , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , Rich Felker , "David S . Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Mike Kravetz , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org References: <20190327063626.18421-1-alex@ghiti.fr> <20190327063626.18421-5-alex@ghiti.fr> From: "Aneesh Kumar K.V" Date: Wed, 27 Mar 2019 12:31:10 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190327063626.18421-5-alex@ghiti.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19032707-0012-0000-0000-0000171DBC1B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010822; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000282; SDB=6.01180287; UDB=6.00617666; IPR=6.00961004; MB=3.00026175; MTD=3.00000008; XFM=3.00000015; UTC=2019-03-27 07:01:32 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19032707-0013-0000-0000-000056A767C6 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-27_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1810050000 definitions=main-1903270049 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/27/19 12:06 PM, Alexandre Ghiti wrote: > On systems without CONTIG_ALLOC activated but that support gigantic pages, > boottime reserved gigantic pages can not be freed at all. This patch > simply enables the possibility to hand back those pages to memory > allocator. > > Signed-off-by: Alexandre Ghiti > Acked-by: David S. Miller [sparc] > > diff --git a/arch/powerpc/include/asm/book3s/64/hugetlb.h b/arch/powerpc/include/asm/book3s/64/hugetlb.h > index ec2a55a553c7..7013284f0f1b 100644 > --- a/arch/powerpc/include/asm/book3s/64/hugetlb.h > +++ b/arch/powerpc/include/asm/book3s/64/hugetlb.h > @@ -36,8 +36,8 @@ static inline int hstate_get_psize(struct hstate *hstate) > } > } > > -#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE > -static inline bool gigantic_page_supported(void) > +#define __HAVE_ARCH_GIGANTIC_PAGE_RUNTIME_SUPPORTED > +static inline bool gigantic_page_runtime_supported(void) > { > /* > * We used gigantic page reservation with hypervisor assist in some case. > @@ -49,7 +49,6 @@ static inline bool gigantic_page_supported(void) > > return true; > } > -#endif > > /* hugepd entry valid bit */ > #define HUGEPD_VAL_BITS (0x8000000000000000UL) Is that correct when CONTIG_ALLOC is not enabled? I guess we want gigantic_page_runtime_supported to return false when CONTIG_ALLOC is not enabled on all architectures and on POWER when it is enabled we want it to be conditional as it is now. -aneesh