Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1054406ybh; Tue, 10 Mar 2020 13:40:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvkn/bW0P/xjJE3HdB1IcxwQBdCNpqZsQbHBahgOADkDYjTSXZsAqFPkeVMxNj9759i/0qR X-Received: by 2002:aca:c70f:: with SMTP id x15mr2511476oif.80.1583872803856; Tue, 10 Mar 2020 13:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583872803; cv=none; d=google.com; s=arc-20160816; b=ElhMfVqHn8/ApJ1IMY4pHBT8x3ajVj9eldO+uN+Q4W2aTADPRc0cClxJ0ED/eScnSs GnGBBxqFvuBqC4gBgpfPl6FxilZaps3+bPuJpoZ0Ob0AGO17vInHNWvCtNxILJ9tBTcs 8NAaJXWlub77d+I+2dcyI6zrsD4EvD7SN858uYjDbjYogLVDBXtrh1LJcCAPpi+Pxv1q 6jjAGhExzzfuzymBXegXeYwRhVMXWkmmmQEGvk+koZFqT5DS/3mh8mty/rG8BjExp6Jm JKygwiglKy6wv4gj+rWjx+dO3HveHGwiYU4FpFMWH/hIIXTIHv2eq51W5zQOzgg6R2sX Hy6g== 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=jxhg97PK826AplXkC+aIN0v8eawb3eMiuN484cJw9QE=; b=NqG1DzkkSplyz0ZkhRntk6TmON2qsUbWoyqB50S9pXkYuuNjaBJXIvVawmq1QAkBJp BQIqE6efZf4ibjYENn2muzljw+EERAv6QNeLCprLthzc4X3yWmzLooNVvVV5AdDtDPaE wbi0BSIdDl8Bex5VBXOSYzx8lSETibZa8hdgdsNkv1EYJrGlPkifshG94Cx31b8bLVLC uHQtu9Wd0SyV61737rsk1BmEq+cuDhMyIDGzAGricKSqLU5DtB/lXm1XE+8L34A4MAD+ 3544QKppUx8/Gxuydrbf8adrbqE4RKnjuGkgIBnt7LoFGFib4pvCrAEEjWUxviQgZHdn X+mw== 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 d24si6127419oij.121.2020.03.10.13.39.51; Tue, 10 Mar 2020 13:40: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 S1726395AbgCJUiK (ORCPT + 99 others); Tue, 10 Mar 2020 16:38:10 -0400 Received: from shelob.surriel.com ([96.67.55.147]:50480 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbgCJUiJ (ORCPT ); Tue, 10 Mar 2020 16:38:09 -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 1jBldd-0001bs-E1; Tue, 10 Mar 2020 16:38:05 -0400 Message-ID: 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:38:04 -0400 In-Reply-To: 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> <4147bc1d429a4336dcb45a6cb2657d082f35ab25.camel@surriel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-YLfLpufuUfbzXS9k6KF4" 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 --=-YLfLpufuUfbzXS9k6KF4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-03-10 at 13:29 -0700, Mike Kravetz wrote: > On 3/10/20 1:15 PM, Rik van Riel wrote: > > On Tue, 2020-03-10 at 13:11 -0700, Mike Kravetz wrote: > > > the more I think about it, the more I like limiting CMA > > > reservations > > > to > > > only one gigantic huge page size (per arch). > >=20 > > Why, though? > >=20 > > The cma_alloc function can return allocations of different > > sizes at the same time. > >=20 > > There is no limitation in the underlying code that would stop > > a user from allocating hugepages of different sizes through > > sysfs. >=20 > True, there is no technical reason. >=20 > I was only trying to simplify the setup and answer the outstanding > questions. > - What alignment to use for reservations? Alignment can be the largest hugepage size the system supports, assuming the amount of memory set aside is at least this large? > - What is minimum size of reservations? One good thing is that it isn't really a reservation, since the memory can still be used for things like page cache and anonymous memory, so if too much is reserved the memory does not go to waste. One of my follow-up projects to Roman's project will be to get THP & khugepaged to effectively use memory in the hugepage CMA area, too. That way when a system is running a workload that is not using 1GB hugetlbfs pages, that easily defragmentable memory pool will still bring some benefits to the workload. > If only one gigantic page size is supported, the answer is > simple. In any > case, I think input from arch specific code will be needed. Agreed. --=20 All Rights Reversed. --=-YLfLpufuUfbzXS9k6KF4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl5n+q0ACgkQznnekoTE 3oOHkgf/ZQ1I2L6OIxzLSO8V0GshyzL880uu043u4Yft+nSOgmxUpRkjFxKLue3b sy1O/oBTgPLJ6LkpZuMFyRaw6uPL2qMt7JIPwKu9LdmvhHAh5Sm8H6sYZ2rEc5oD WuQnXMmTrRZRdP9Z3AsBMH6hh+ztzQEVA9UV+q+aP4pmzxoQYbDstnw8cdPaqk2M grlFDjqdlxg3nebwc3uzkdVjOEtzg9VQCde6Vgud7B7S1JdvDeswdXxuQiRu1Fy3 ag0WQgjjOokgQlA7QTgxGdHmKUDweFef/zbiMfFYPwWaqRmkXEr/4hkOaN9WO5v/ Hdc/arJQ3gyKCwX4Y+RQhA/gErKsig== =Hi/q -----END PGP SIGNATURE----- --=-YLfLpufuUfbzXS9k6KF4--