Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1034935ybh; Tue, 10 Mar 2020 13:13:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvppiIaRdsq9VzqjsD3RDRfKEIfXeu/czttDU97khSAahyIomr5fqnoEdyjmUPmgJIR+ELl X-Received: by 2002:a05:6830:108d:: with SMTP id y13mr18590754oto.241.1583871211365; Tue, 10 Mar 2020 13:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583871211; cv=none; d=google.com; s=arc-20160816; b=GG9W8ch690iEMbIzWA1PKg1LjcyNoT5F8AxZQVxSF2ZUOxlJA4SQ1zq/onMFIG4387 8XVfLYD0QOS8IlpWuHzaQNQ+KRrAkIHkRcrKDVJc5YeiX+y/5poKc3hDfFKDNdBWASmQ nwk7WWxOM0QCsLJPTgGf5UmOnvcaC0GQkRNFd/snmp+IMJI3dvoX0MB+1+ocawJNGxST nw5H7xfzjbVISjs4d0r9/77kJcoCw5wg1OmyXYvw3gHUZKrOdpCsBnyV1/YZ9sp2fJKy FTv1d/Dd3nEQRagG1cDbHzJUPvtOGAiIkqOclJBLMzLWPcEHzwEGNpoMgvavTvqVoekd bcDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=tJ7/QJ5avADe6ht2Nb3+19M/jW4rdhvxqGYM2nNb6Eg=; b=Abb1Eg62UzMlTCAvRZcYcUF21UbM4+6aQ2/qthNrUHWIwUZBsYoKw6o7pKDi90IfTf +7gzGJPJWEzHM/+IV70DmeJ45UmDacEqGFOx7tA1slTbHQnoboUzv3EH51mP0s298gVF 9Q0p35ctdSEjOC+OdrDQvRQtQq1qR5RdxINDwl/G/Vb4225ZNII0JfxODFUgSVAUT3EH nthMC7125nefEzYkzF+1g2WVfYdiIenyMn0nAMRlkt4hXDuMNX9nWGsfvBkX94uLpiRT aXhGmlWUEtBsr2fDnGU4W/+oeS9JnAXIRstUAH6b0ze8Z1VAh38DxPhuCSBK+A9+z4t5 nRbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=dxZSN4Lo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w72si5906592oiw.152.2020.03.10.13.13.16; Tue, 10 Mar 2020 13:13:31 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=dxZSN4Lo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbgCJUMO (ORCPT + 99 others); Tue, 10 Mar 2020 16:12:14 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:37802 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726604AbgCJUMO (ORCPT ); Tue, 10 Mar 2020 16:12:14 -0400 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 02AK4I1L113420; Tue, 10 Mar 2020 20:11:58 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=tJ7/QJ5avADe6ht2Nb3+19M/jW4rdhvxqGYM2nNb6Eg=; b=dxZSN4LouyNMontPZsOrX4yRAc+wSxTmozaE9GnS9AYzmGI7AuULInMXEt13ZxefttCg nhxZwUa4wC08QwXQihw3EDmqgwaT/Je9j+BmPHZttV6xz+pKccPFV2RKWe1pLlqJr3fX mXLKPT1OJS+z6cZ0gu7mwSi0x2o/eomXvO78uHOY8gZc14d1VfnKENSG6GjZuK7lwNvr +C5dliKx6Uh8H2bUkU/luQ0k5Rue8ovgpC02FcxYy+Ao7qGxI5HLkCJ+GpMG6lhiAZeg +gdRLXawRX+L57hG0Hiutr4Wz/iD0J7axTtMi2VhXBCwTvf/DdogBBjF91CnqHATua96 2Q== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2yp7hm46ug-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Mar 2020 20:11:58 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02AK7McP089367; Tue, 10 Mar 2020 20:11:58 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2yp8qqb2sc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Mar 2020 20:11:57 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 02AKBso3011564; Tue, 10 Mar 2020 20:11:54 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 10 Mar 2020 13:11:53 -0700 Subject: Re: [PATCH v2] mm: hugetlb: optionally allocate gigantic hugepages using cma To: Rik van Riel , Michal Hocko , Roman Gushchin Cc: Andrew Morton , Johannes Weiner , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org References: <20200310002524.2291595-1-guro@fb.com> <5cfa9031-fc15-2bcc-adb9-9779285ef0f7@oracle.com> <20200310180558.GD85000@carbon.dhcp.thefacebook.com> <4b78a8a9-7b5a-eb62-acaa-2677e615bea1@oracle.com> <20200310191906.GA96999@carbon.dhcp.thefacebook.com> <20200310193622.GC8447@dhcp22.suse.cz> <43e2e8443288260aa305f39ba566f81bf065d010.camel@surriel.com> From: Mike Kravetz Message-ID: <57494a9c-5c24-20b6-0bda-dac8bbb6f731@oracle.com> Date: Tue, 10 Mar 2020 13:11:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <43e2e8443288260aa305f39ba566f81bf065d010.camel@surriel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9556 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003100118 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9556 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 impostorscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003100117 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/10/20 12:46 PM, Rik van Riel wrote: > On Tue, 2020-03-10 at 20:36 +0100, Michal Hocko wrote: >> On Tue 10-03-20 12:19:06, Roman Gushchin wrote: >> [...] >>>> I found this out by testing code and specifying >>>> hugetlb_cma=2M. Messages >>>> in log were: >>>> kernel: hugetlb_cma: reserve 2097152, 1048576 per node >>>> kernel: hugetlb_cma: successfully reserved 1048576 on node 0 >>>> kernel: hugetlb_cma: successfully reserved 1048576 on node 1 >>>> But, it really reserved 1GB per node. >>> >>> Good point! In the passed size is too small to cover a single huge >>> page, >>> we should probably print a warning and bail out. >> >> Or maybe you just want to make the interface the unit size rather >> than >> overall size oriented. E.g. I want 10G pages per each numa node. > > How would that work for architectures that have multiple > possible hugetlbfs gigantic page sizes, where the admin > can allocate different numbers of differently sized pages > after bootup? For hugetlb page reservations at boot today, pairs specifying size and quantity are put on the command line. For example, hugepagesz=2M hugepages=512 hugepagesz=1G hugepages=64 We could do something similiar for CMA. hugepagesz=512M hugepages_cma=256 hugepagesz=1G hugepages_cma=64 That would make things much more complicated (implies separate CMA reservations per size) and may be overkill for the first implementation. Perhaps we limit CMA reservations to one gigantic huge page size. The architectures would need to define the default and there could be a command line option to override. Something like, default_cmapagesz= analogous to today's default_hugepagesz=. Then hugepages_cma= is only associated with that default gigantic huge page size. The more I think about it, the more I like limiting CMA reservations to only one gigantic huge page size (per arch). -- Mike Kravetz