Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1037030ybh; Tue, 10 Mar 2020 13:16:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs/s1kHkrR/hgM+OwnBZpxUIhHNUPGD51IU47BTgI9+QZvD9qaNXKzPcdL8kkkjiJp3n0uw X-Received: by 2002:a05:6808:487:: with SMTP id z7mr2379798oid.151.1583871363154; Tue, 10 Mar 2020 13:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583871363; cv=none; d=google.com; s=arc-20160816; b=tP4vBbFU9DJV+FdZzNSvgTfRU5Ais+3HalNzHI0HQviX2DUOXlhV8lkF56Xv8/0d0F xyFmHlPBDB8JE5UHmKaOqjhnwvAVzrfl4FMYEQjzURcDcP8m1qTJLqPDnwRAmQ5l4WQG i+oKUMEOh5CaP/2VL+X2uaRE1iDJB6z1pS4IoWkZ8Jne4zyIFDDRg/DjdgM5i8YuZVfw mfP4Nbpvzrhm2Q6UI74n0Gx9cKXxrvFEXGkuUY1Lvsxj5iaaBecg9XiPAz5CgJtsO4D3 nhOYJIBmNjKG6Z717yQVS+WjR+uy401K8oD+oOD22YHENgBDoafh4q0i0NmmDQCuVK39 vX0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=zBfaCzYxQGymq4AItg3HG6Hwhc9brdWhlj5BflZLYvU=; b=qBZCdi4W4F49SvNB/QfV5lD89rbDtu8AXFAxD5LJsGA5Xhtj960dDsrh5xjfF7hYbk NHEjZhqQgnRaa12Dw+GHp82UFfLisIfM1fbo/NjCXKQqtrEQEF18RSCmIkJ+SxWgJlTO pli8rOUFXHuPU9g39RGIA9R1hw3LU8f7/6IGfWfeyS1ioSGT6hopF9rfm61NY9Iry7Da FM1vqpDD8/tU379xDYvsgGC0Ka92cD9kLao9dFySc9MbJg6UHu6GsvmKUZw9/DREpbi4 OafM9B1tP8lxOk+hVDiDWixGWHy1ATy3NLMapPJP3Z4myLZFdVI4H9zpUNkY45g78TNt lqjQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si9048559otf.128.2020.03.10.13.15.50; Tue, 10 Mar 2020 13:16:03 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbgCJUPX (ORCPT + 99 others); Tue, 10 Mar 2020 16:15:23 -0400 Received: from shelob.surriel.com ([96.67.55.147]:50416 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726545AbgCJUPX (ORCPT ); Tue, 10 Mar 2020 16:15:23 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jBlHa-0001Mz-JN; Tue, 10 Mar 2020 16:15:18 -0400 Message-ID: <4147bc1d429a4336dcb45a6cb2657d082f35ab25.camel@surriel.com> Subject: Re: [PATCH v2] mm: hugetlb: optionally allocate gigantic hugepages using cma From: Rik van Riel To: Mike Kravetz , Michal Hocko , Roman Gushchin Cc: Andrew Morton , Johannes Weiner , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org Date: Tue, 10 Mar 2020 16:15:18 -0400 In-Reply-To: <57494a9c-5c24-20b6-0bda-dac8bbb6f731@oracle.com> 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> <57494a9c-5c24-20b6-0bda-dac8bbb6f731@oracle.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-C3ENaGOY3Fk1eu6XYAt6" User-Agent: Evolution 3.34.3 (3.34.3-1.fc31) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-C3ENaGOY3Fk1eu6XYAt6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-03-10 at 13:11 -0700, Mike Kravetz wrote: > On 3/10/20 12:46 PM, Rik van Riel wrote: > >=20 > > 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? >=20 > For hugetlb page reservations at boot today, pairs specifying size > and > quantity are put on the command line. For example, > hugepagesz=3D2M hugepages=3D512 hugepagesz=3D1G hugepages=3D64 >=20 > We could do something similiar for CMA. > hugepagesz=3D512M hugepages_cma=3D256 hugepagesz=3D1G hugepages_cma=3D64 >=20 > That would make things much more complicated (implies separate CMA > reservations per size) and may be overkill for the first > implementation. >=20 > 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=3D analogous to today's default_hugepagesz=3D. Then > hugepages_cma=3D is only associated with that default gigantic huge > page > size. >=20 > The more I think about it, the more I like limiting CMA reservations > to > only one gigantic huge page size (per arch). Why, though? The cma_alloc function can return allocations of different sizes at the same time. There is no limitation in the underlying code that would stop a user from allocating hugepages of different sizes through sysfs. Allowing the system administrator to allocate a little extra memory for the CMA pool could also allow us to work around initial issues of compaction/migration failing to move some of the pages, while we play whack-a-mole with the last corner cases. --=20 All Rights Reversed. --=-C3ENaGOY3Fk1eu6XYAt6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl5n9VYACgkQznnekoTE 3oN42ggAnLgkVOVgm54Qtqfu1IihZSXHTfyMBPLFs4nCFUBBMpzt+QZJkCYXzGZW kUnRyYQcTPalw5uwdKeL97uWxvARnR04kx6qA7cvocvEC8Xw4EYPPH0RPKXXHG1f qRa9bpR+TvYckp/FmYiWME2oMD3S0wxXdXEUOsgnooOxCHJ7SScSdcx+06MgbVDh 49qboipysfbgTzuKFXmto/TxKWS/8LyRWaeAVwBnDyHn8XYfhsI9xa7xBsvnxAjI qacZRHqa+DcV8//wOPAp0YZ6fD86FQI42Dzqmm0l3N+k8wtXITh6SRdKo7ODUGQc h+B3ysCd32l+vOsITPwcvgiHRhbU7g== =IuCs -----END PGP SIGNATURE----- --=-C3ENaGOY3Fk1eu6XYAt6--