From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D427C433E0 for ; Fri, 10 Jul 2020 00:24:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D193A20720 for ; Fri, 10 Jul 2020 00:24:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="i3NWQcCD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D193A20720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 593A96B0002; Thu, 9 Jul 2020 20:24:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 544146B0005; Thu, 9 Jul 2020 20:24:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 433796B0006; Thu, 9 Jul 2020 20:24:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 2D38F6B0002 for ; Thu, 9 Jul 2020 20:24:34 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 963C08248047 for ; Fri, 10 Jul 2020 00:24:33 +0000 (UTC) X-FDA: 77020270026.13.tray95_1608ad826eca Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 6DAC718140B70 for ; Fri, 10 Jul 2020 00:24:33 +0000 (UTC) X-HE-Tag: tray95_1608ad826eca X-Filterd-Recvd-Size: 6068 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jul 2020 00:24:32 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06A07Hx0102872; Fri, 10 Jul 2020 00:24:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=zJ71shxFuZz9AsflxxmVD772uEc/naqgyywzJ2rhY8Y=; b=i3NWQcCD7FVFTUCxEnPW5BJhh4Z0gMQNizCDIwI/AuoiTVY1YrzjNY9BCtUa0DVEbpLA LCXlwkA78abHW3rpFPtiLdVzDx9xk9FD6WiW+nVPITvPLB8Pxf6CmMLUbrfkEPTDjLHG aeRmaBU6sptGpB3cOJM/ydyPbExNkTqCPsUdrpaoFDAXPIYzZpvsvhw1b9IDoj4M0LAd 7P8CcR6izOu6uKzv5lKbALPcm+giHyqYuo5Vqk97y2SaWPUPnkBXytABYUbDppPBk7hG OpZj5GRRLGPFTjD99UHePu+eEcwFJnSrBjcErdEjIw0Q3WS3ZmR+e/WDrVX02wKRv9Zp 7w== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 325y0ampp6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 10 Jul 2020 00:24:19 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06A09cGn188665; Fri, 10 Jul 2020 00:24:19 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 325k3hv3r8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jul 2020 00:24:18 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 06A0OG3P007144; Fri, 10 Jul 2020 00:24:16 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Jul 2020 17:24:16 -0700 Subject: Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable To: "Song Bao Hua (Barry Song)" , Roman Gushchin Cc: Andrew Morton , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Linuxarm , Jonathan Cameron References: <20200707040204.30132-1-song.bao.hua@hisilicon.com> <20200707125641.dbd2ccd63f525aa5870069d8@linux-foundation.org> <9066e009-5ed2-1992-d70d-fd27b4bf5871@oracle.com> <20200708184615.GA251665@carbon.dhcp.thefacebook.com> From: Mike Kravetz Message-ID: <99dd3c24-a864-c0e2-4f02-33a7fbc97bc7@oracle.com> Date: Thu, 9 Jul 2020 17:24:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9677 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007090156 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9677 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 malwarescore=0 clxscore=1015 impostorscore=0 phishscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007090156 X-Rspamd-Queue-Id: 6DAC718140B70 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 7/9/20 4:45 PM, Song Bao Hua (Barry Song) wrote: > > >> -----Original Message----- >> From: Mike Kravetz [mailto:mike.kravetz@oracle.com] >> Sent: Friday, July 10, 2020 6:58 AM >> To: Song Bao Hua (Barry Song) ; Roman >> Gushchin >> Cc: Andrew Morton ; linux-mm@kvack.org; >> linux-kernel@vger.kernel.org; Linuxarm ; Jonathan >> Cameron >> Subject: Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma >> is enable >> >> Looks like this produced a warning in linux-next. I suspect it is due to the >> combination CONFIG_HUGETLB_PAGE && !CONFIG_CMA. >> >> Instead of adding the routine hugetlb_cma_enabled() to scan the hugetlb_cma >> array, could we just use a boolean as follows? It can simply be set in >> hugetlb_cma_reserve when we reserve CMA. > > Maybe just use hugetlb_cma_size? If hugetlb_cma_size is not 0, someone is trying to use > cma, then bootmem for gigantic pages will be totally ignored according to discussion here: > https://lkml.org/lkml/2020/7/8/1288 > > if somebody sets a wrong hugetlb_cma_size which causes that cma is not reserved. > It is the fault of users? We just need to document hugetlb_cma will overwrite bootmem > reservations? > Yes, I think using hugetlb_cma_size would be sufficient. If someone specifies hugetlb_cma= and hugepagesz= hugepages= that is wrong. I don't think we need to worry about 'falling back' to preallocating X gigantic pages if N is a bad value. Or, even if the arch does not support cma allocation. I am working on a patch to check this earlier in command processing. That will make this check unnecessary. However, that patch is based on new command line processing code only in 5.8. So, I think we still need to do this so that it can be backported to stable. -- Mike Kravetz