Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp948124ybh; Tue, 10 Mar 2020 11:23:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsZQSr5NkHVBmuv/6aiA8TX3wtpeUKbMBVie5OVY2WllBMmeZMFVVj2B7Zy5KuPgZ5aAlsz X-Received: by 2002:a05:6830:1144:: with SMTP id x4mr17579383otq.59.1583864618862; Tue, 10 Mar 2020 11:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583864618; cv=none; d=google.com; s=arc-20160816; b=NKTHebIXwfB28WmhozhPNpznoueUM+r3CIDJJ0jd6oFAaEnky/50Jx/34cf5M/robn pdGIoIw15CIYZlmYNvTE1jx7gXhmipk8p+0u4Fu8m6CNxmaqZPULhYun4d5D8EtNQ2Zp lQWRCzknEbtOcJ8uVdTLFG5Q/+2oKIGl4ABHsnxylYaAPFYZ/9mdqjij4dDbwwod6mty OzEijGWVJZOJTSh9fWvDMXMSwTbhikzJ4R61fB1EOd4lhE4MDf/+Pt6vf/lvNUPBLtTQ cpwyWVh4gt3RamqgVh670+3iiA16p8Bj66hz/yPHJ7+9oNgXkQcS6oeprlBH32c+13dz fEsQ== 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=yrDYCPZatf1m0++LWkR2EV/FF4cOHaW2Usv7hnAInFA=; b=sQ1xCAgZXAp5P3Nhm/jK2ti5CSsg6LwOWFkg+0y1TTekSGRsRgEC6Aly9jW3T6plQR EPdOAX9HqdLguooWbewWllPnLz9wHYqIYFdxXUURF5jk5g8hM2nQ8KjI0ZSYkWVur6SI nLB92Ukay/zZrDvHLBxmBFPta21VTQnSmyuaStzsN4Cz4iLnd2p7M9PSAfeIL+94gLuP 1sjpmCJ8qiLsYsxRI6aQhvadcHMMf3hv9SnaJT8yVL//Flg3tKD44Ci+O+DoPaizzfxO /4e0qbvE7ct5betbR27JvODGWqz4mJKfcxjFNnRqntedGgBEcyYkXrgWowB8TeYW8ASd 6rUw== 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 l145si6450314oih.44.2020.03.10.11.23.26; Tue, 10 Mar 2020 11:23:38 -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 S1727232AbgCJSWZ (ORCPT + 99 others); Tue, 10 Mar 2020 14:22:25 -0400 Received: from shelob.surriel.com ([96.67.55.147]:50150 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726752AbgCJSWZ (ORCPT ); Tue, 10 Mar 2020 14:22:25 -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 1jBjWD-0007pX-Th; Tue, 10 Mar 2020 14:22:17 -0400 Message-ID: <833c188c0c1b9b0b842973952907bdabed774122.camel@surriel.com> Subject: Re: [PATCH v2] mm: hugetlb: optionally allocate gigantic hugepages using cma From: Rik van Riel To: Roman Gushchin , Mike Kravetz Cc: Andrew Morton , Johannes Weiner , Michal Hocko , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org Date: Tue, 10 Mar 2020 14:22:17 -0400 In-Reply-To: <20200310180558.GD85000@carbon.dhcp.thefacebook.com> References: <20200310002524.2291595-1-guro@fb.com> <5cfa9031-fc15-2bcc-adb9-9779285ef0f7@oracle.com> <20200310180558.GD85000@carbon.dhcp.thefacebook.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-D94rFl3rXI1Y1H51/0DC" 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 --=-D94rFl3rXI1Y1H51/0DC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-03-10 at 11:05 -0700, Roman Gushchin wrote: > On Tue, Mar 10, 2020 at 10:27:01AM -0700, Mike Kravetz wrote: > >=20 > > > + for_each_node_state(nid, N_ONLINE) { > > > + unsigned long min_pfn =3D 0, max_pfn =3D 0; > > > + > > > + for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, > > > NULL) { > > > + if (!min_pfn) > > > + min_pfn =3D start_pfn; > > > + max_pfn =3D end_pfn; > > > + } > > > + > > > + res =3D cma_declare_contiguous(PFN_PHYS(min_pfn), size, > > > + PFN_PHYS(max_pfn), (1UL << > > > 30), > >=20 > > The alignment is hard coded for x86 gigantic page size. If this > > supports > > more architectures or becomes arch independent we will need to > > determine > > what this alignment should be. Perhaps an arch specific call back > > to get > > the alignment for gigantic pages. That will require a little > > thought as > > some arch's support multiple gigantic page sizes. >=20 > Good point! > Should we take the biggest possible size as a reference? > Or the smallest (larger than MAX_ORDER)? I would say biggest. You can always allocate multiple smaller gigantic pages inside the space reserved for one ginormous one. --=20 All Rights Reversed. --=-D94rFl3rXI1Y1H51/0DC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl5n2tkACgkQznnekoTE 3oN+Owf/Sy6WliqWQnAbEHq56M8WlOqyAKoXZupvl2NMopJY6+FsMKMtOezaF0+s 7jli5AA4QEwoCAcLAWsfwZa5lmnrCs918KI8pnQ+6xFFDh7bg9j+iyxvS87SUseM jOiAjAdjHIODLlz5Q7lHktmtO68cU8QDcKjbBtobntk+LS7oGA+FwucdRaZ/hLyI +Rn43qwaod6UxqZCkoNblYlxJhosQfF7bZ99Gkmh+K09lEmgylK0fObIpPIfKI4q sYBTMe7qUzdsfqAOFmF5xzRZX2q0mwOCdTZhjpZ68MjRpHsvKstrlh4UqfAgd7D+ uDn75ec2IPpFAR/8DTp06Kl6a1+q2g== =tGVb -----END PGP SIGNATURE----- --=-D94rFl3rXI1Y1H51/0DC--