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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 BCC26C10F29 for ; Mon, 16 Mar 2020 01:09:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6AC43205ED for ; Mon, 16 Mar 2020 01:09:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AC43205ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C3FD86B0003; Sun, 15 Mar 2020 21:09:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC9D96B0006; Sun, 15 Mar 2020 21:09:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB7CB6B0007; Sun, 15 Mar 2020 21:09:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id 8EC606B0003 for ; Sun, 15 Mar 2020 21:09:01 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 41368181AEF1F for ; Mon, 16 Mar 2020 01:09:01 +0000 (UTC) X-FDA: 76599441282.12.wash92_88ec43e10b60f X-HE-Tag: wash92_88ec43e10b60f X-Filterd-Recvd-Size: 3674 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 01:09:00 +0000 (UTC) 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 1jDeFN-0005ir-MR; Sun, 15 Mar 2020 21:08:49 -0400 Message-ID: <3f9ebf02d5ac99b4a53323cc81097ab7d176be13.camel@surriel.com> Subject: Re: [PATCH v2] mm: hugetlb: optionally allocate gigantic hugepages using cma From: Rik van Riel To: Michal Hocko , Roman Gushchin Cc: Andrew Morton , Johannes Weiner , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org, Mike Kravetz Date: Sun, 15 Mar 2020 21:08:33 -0400 In-Reply-To: <20200310173738.GW8447@dhcp22.suse.cz> References: <20200310002524.2291595-1-guro@fb.com> <20200310084544.GY8447@dhcp22.suse.cz> <20200310172559.GA85000@carbon.dhcp.thefacebook.com> <20200310173738.GW8447@dhcp22.suse.cz> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-+u87rxUVjLaTU0VDKPMi" User-Agent: Evolution 3.34.3 (3.34.3-1.fc31) MIME-Version: 1.0 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: --=-+u87rxUVjLaTU0VDKPMi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-03-10 at 18:37 +0100, Michal Hocko wrote: > On Tue 10-03-20 10:25:59, Roman Gushchin wrote: > > Well, so far I was focused on a particular case when the target cma > > size > > is significantly smaller than the total RAM size (~5-10%). What is > > the right > > thing to do here? Fallback to the current behavior if the requested > > size is > > more than x% of total memory? 1/2? How do you think? >=20 > I would start by excluding restricted kernel zones ( Cutting off 1G of ZONE_DMA32 might be a real problem. It looks like memblock_find_in_range_node(), which is called from memblock_alloc_range_nid(), will already do top-down allocation inside each node. However, looking at that code some more, it has some limitations that we might not want. Specifically, if we want to allocate for example a 16GB CMA area, but the node in question only has a 15GB available area in one spot and a 1GB available area in another spot, for example due to memory holes, the allocation will fail. I wonder if it makes sense to have separate cma_declare_contiguous calls for each 1GB page we set up. That way it will be easier to round-robin between the ZONE_NORMAL zones in each node, and also to avoid the ZONE_DMA32 and other special nodes on systems where those are a relatively small part of memory. I'll whip up a patch to do that. --=20 All Rights Reversed. --=-+u87rxUVjLaTU0VDKPMi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl5u0ZIACgkQznnekoTE 3oPPIAgAu8XZaCLZ5HW+T4PLxfETerxBSrPeZn9gpSZLvFabnLwe9JPpHvIjZEyi 32fVVSzapIM1+tJSJ0InE1CY6MGX3s5mJvX8a9UHUwY2VAuR3HDGGlcDEWkvaReg t44rluEuM43p5oX87gCAGUMeXcyVOMqt3SzVajTXWTZ9wlXBUpaNbxJjXvQkeTAG 6Sl6Ao9p5b2lhYd0r2csib0l7GjuqgnwNS8vI//XnNUF9mOXJi5BmHhOhwvloX45 PEcQAny6febdVnVZSXxzGfbIW45kUSiNlIPOh5iBBzarbFLlH3UskWG6/gbnFnai PVxAnfzvpxSD+I8F9OLv5NFP7eGGKA== =RGk4 -----END PGP SIGNATURE----- --=-+u87rxUVjLaTU0VDKPMi--