Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5148409img; Wed, 27 Mar 2019 03:07:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeKLg6kfqREQZT2bvoXt7mNCDqI7t/ITV3NUplu2mX5XsjgS+zIr+EBCqRtY9w3nvhLtMf X-Received: by 2002:a17:902:2848:: with SMTP id e66mr36851020plb.181.1553681235682; Wed, 27 Mar 2019 03:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553681235; cv=none; d=google.com; s=arc-20160816; b=RnvlBw+VtR7ciYILNjlQlI36K7WWHU13ZQAb8S/kHol8chbPcYoo9O8l50pRUFAw5u JuPuZgQR8+PDZh9YuVNErn7FTxcMdcupGKQ7eEky6OhVxhG1qTSUBU1TryLfvtuca7lK wcE+Rw3StpxO7eONi43LFp8roMj/lTDlO3dEGfAWQy2mQv3NL0mgSsPa0n3+VLMqFRrB eJWzvQtgJtoTIereAgUqFp3cmRlk6X9YWeRW6rTKku7aEhIZz+5CZadn5+Z/yv+zGaX/ UR61iWZltKWFJFBalL3vuJuJbI7TYPVstL+aCHNViHKInAKCS5gK6FEyuXpTENJfGtBK OqYA== 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:references:in-reply-to:subject:to:from; bh=XiRX2/0Y/2p6iJyl1bgLe5qFCu/74gQEFql1vrbpD8Y=; b=a8VVnm16hQ1cfh/yo7V4BZm9npwhOhdkoWb4p03LdhwN5RkBbHLoPdIn+4i2cNEiTb Xfed4vel3/EuQXHUHaegCdI/fY0xCitp8yWN6wct/eWDgQXioazsHwXOGFmQYYIw4DKC ArhuEjOPNAd8/L6XXoyI52BiegBtaSsA7aMyFllP52kSscy8xrJK5D3qHtNFT5iUYiT9 KuS96h3vOdUplELEkhScweZU71/6WE+N9U2GuFohcnSQfzuSP4dAp61IlQLEu3XX6lwP HDRJypFpxuXaD0SK1OKbaq+iTh/pKHcdMtrUGu3uJoEruq3SB02Ym97C+DdRtuc9po13 mdfQ== 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 t7si17692344pgp.196.2019.03.27.03.07.00; Wed, 27 Mar 2019 03:07:15 -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 S1733023AbfC0KFf convert rfc822-to-8bit (ORCPT + 99 others); Wed, 27 Mar 2019 06:05:35 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41936 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732920AbfC0KFf (ORCPT ); Wed, 27 Mar 2019 06:05:35 -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 x2RA4qXB030824 for ; Wed, 27 Mar 2019 06:05:33 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rg5vf3j9q-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 27 Mar 2019 06:05:33 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Mar 2019 10:05:30 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp01.uk.ibm.com (192.168.101.131) 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 10:05:22 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2RA5Ld536831236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Mar 2019 10:05:21 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA8ADAE045; Wed, 27 Mar 2019 10:05:21 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44B49AE051; Wed, 27 Mar 2019 10:05:15 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.102.0.57]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 27 Mar 2019 10:05:15 +0000 (GMT) X-Mailer: emacs 26.1 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" 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 Subject: Re: [PATCH v8 4/4] hugetlb: allow to free gigantic pages regardless of the configuration In-Reply-To: References: <20190327063626.18421-1-alex@ghiti.fr> <20190327063626.18421-5-alex@ghiti.fr> Date: Wed, 27 Mar 2019 15:35:13 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-TM-AS-GCONF: 00 x-cbid: 19032710-4275-0000-0000-0000031FC8B0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19032710-4276-0000-0000-0000382E6206 Message-Id: <87pnqcws2u.fsf@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-27_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-1810050000 definitions=main-1903270073 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexandre Ghiti writes: > On 03/27/2019 09:55 AM, Aneesh Kumar K.V wrote: >> On 3/27/19 2:14 PM, Alexandre Ghiti wrote: >>> >>> >>> On 03/27/2019 08:01 AM, Aneesh Kumar K.V wrote: >>>> On 3/27/19 12:06 PM, Alexandre Ghiti wrote: > ..... >> >> This is now >> #define __HAVE_ARCH_GIGANTIC_PAGE_RUNTIME_SUPPORTED >> static inline bool gigantic_page_runtime_supported(void) >> { >> if (firmware_has_feature(FW_FEATURE_LPAR) && !radix_enabled()) >>         return false; >> >>     return true; >> } >> >> >> I am wondering whether it should be >> >> #define __HAVE_ARCH_GIGANTIC_PAGE_RUNTIME_SUPPORTED >> static inline bool gigantic_page_runtime_supported(void) >> { >> >>    if (!IS_ENABLED(CONFIG_CONTIG_ALLOC)) >>         return false; > > I don't think this test should happen here, CONFIG_CONTIG_ALLOC only allows > to allocate gigantic pages, doing that check here would prevent powerpc > to free boottime gigantic pages when not a guest. Note that this check > is actually done in set_max_huge_pages. > > >> >> if (firmware_has_feature(FW_FEATURE_LPAR) && !radix_enabled()) >>         return false; > > Maybe I did not understand this check: I understood that, in the case > the system > is virtualized, we do not want it to hand back gigantic pages. Does this > check > test if the system is currently being virtualized ? > If yes, I think the patch is correct: it prevents freeing gigantic pages > when the system > is virtualized but allows a 'normal' system to free gigantic pages. > > >> Ok double checked the patch applying the the tree. I got confused by the removal of that #ifdef. So we now disallow the runtime free by checking for gigantic_page_runtime_supported() in __nr_hugepages_store_common. Now if we allow and if CONFIG_CONTIG_ALLOC is disabled, we still should allow to free the boot time allocated pages back to buddy. The patch looks good. You can add for the series Reviewed-by: Aneesh Kumar K.V -aneesh