Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4180739pxk; Tue, 8 Sep 2020 12:47:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWMh1nb9aFxQoaYHSJPv3uN75Q8MgZNg9SpsVqiAAWU2HtfhWpoHixndqDDUiXKRbd3tP2 X-Received: by 2002:a17:906:1542:: with SMTP id c2mr21002ejd.533.1599594469552; Tue, 08 Sep 2020 12:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599594469; cv=none; d=google.com; s=arc-20160816; b=lF52kl/3RTQ1FucECytiE5PVXj+eez2l+l2jT/WKjclA3JjyAbMdqDYUQq49aqr7xH QtaW85zLuZzRLFQCU0va6I9zIzcd6UyLC/wvNOKQkmG0mI+E9d0zaJMBC7rwOB7YJqh8 G/q38ekxOAA+USTh7iMMUG7y5PuhBROOomaHFhU+r3L50pwPIbmlVujT55oX3aW+CAbe tIpJnXzIvIMpKIpx7bIpbXZZ9gYVaeOSFTwbYWBJm6EBQqgZQ/P4H81Uqu8RJwfMDARl WPqniJgJ6MHzGUw19S+D0CVEpWsgg7RdF+JtU8/FzAUwFY2WiV+n84xjNK1m7rgX2Gr9 rkwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=sW9KId6qYj04nbAWRRDvrHLiEzlbizoIW4qM/PwXqwg=; b=Ldkfu+5hzAy4O2Q+FflqWpDq+v5VuM7KNe7y31RdYV2nkPunLG+prHmSvTHx7jFkv1 5ThBA9/4YHNSdlWyhQ6Q/ZcLzOpHGZtYkZyFL/+50JcTpjbBjMzDratnCozSsAnafrfH +ycA2zKtqTv8tbpmLLd+09teqfbLw+b+/wqqQFW8x4NfXbiU1uMrtqHYr3yaZHZXWDWz bDzHgHBFx4j4jyqrFfxy55VdSF0kPbMCqvqd513wgguDwFSrOsWeE9HDb7HFIxAfljDt js8CW9XDIMfLAvN/JArqAb4gD3Y5FXNo4kFKE6lYpie3a3BGg6sOScnFxOYgJ49qrNEB rfBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=cz0Ywt8M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pj10si16308ejb.398.2020.09.08.12.47.27; Tue, 08 Sep 2020 12:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=cz0Ywt8M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731021AbgIHToC (ORCPT + 99 others); Tue, 8 Sep 2020 15:44:02 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:17947 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730856AbgIHPvt (ORCPT ); Tue, 8 Sep 2020 11:51:49 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 08 Sep 2020 07:03:04 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 08 Sep 2020 07:05:18 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 08 Sep 2020 07:05:18 -0700 Received: from [10.2.173.224] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 8 Sep 2020 14:05:13 +0000 From: Zi Yan To: David Hildenbrand CC: Roman Gushchin , "Kirill A. Shutemov" , , Rik van Riel , "Kirill A . Shutemov" , Matthew Wilcox , Shakeel Butt , Yang Shi , David Nellans , Subject: Re: [RFC PATCH 00/16] 1GB THP support on x86_64 Date: Tue, 8 Sep 2020 10:05:11 -0400 X-Mailer: MailMate (1.13.1r5705) Message-ID: <7E20392E-5ED7-4C22-9555-F3BAABF3CBE9@nvidia.com> In-Reply-To: <8e677ead-206d-08dd-d73e-569bd3803e3b@redhat.com> References: <20200902180628.4052244-1-zi.yan@sent.com> <20200903142300.bjq2um5y5nwocvar@box> <20200903163020.GG60440@carbon.dhcp.thefacebook.com> <8e677ead-206d-08dd-d73e-569bd3803e3b@redhat.com> MIME-Version: 1.0 X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: multipart/signed; boundary="=_MailMate_90CC73A7-32C1-445F-AAA5-E7CCB35F7A6C_="; micalg=pgp-sha512; protocol="application/pgp-signature" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1599573784; bh=sW9KId6qYj04nbAWRRDvrHLiEzlbizoIW4qM/PwXqwg=; h=X-PGP-Universal:From:To:CC:Subject:Date:X-Mailer:Message-ID: In-Reply-To:References:MIME-Version:X-Originating-IP: X-ClientProxiedBy:Content-Type; b=cz0Ywt8Mwv3cM4M2AvyHpYoNV+DHk7c0S4/gaIXD/jbjNb4yTxJEBxaVRamWmG7UO K3Ad6fiT7syZBbx1qonwx5UZ4kkRUhjDGMl9pKDKnMDWDIqSn0RUkHSVI6Hy/CC3xv 639Ol2ZjAoJM8XpPddcpnDF+o0AzL1zVLXesaL5AJrntIMcKgqoPGSKuGJrcDlnEFj 8DTi/BuUPdeCoRezYEg1m+6D6GtjJT5t1pue/mD7eu2E8RTXsbQCInapXLklElmMOi L3T2633QNom7mc3rqDm2dCOrjsNGUpERK5isP+WLOMbDyzaILAPBFFlGnqr9xF7SEl Vi0SDpXCEgJ1w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=_MailMate_90CC73A7-32C1-445F-AAA5-E7CCB35F7A6C_= Content-Type: text/plain; charset="UTF-8"; markup=markdown Content-Transfer-Encoding: quoted-printable On 8 Sep 2020, at 7:57, David Hildenbrand wrote: > On 03.09.20 18:30, Roman Gushchin wrote: >> On Thu, Sep 03, 2020 at 05:23:00PM +0300, Kirill A. Shutemov wrote: >>> On Wed, Sep 02, 2020 at 02:06:12PM -0400, Zi Yan wrote: >>>> From: Zi Yan >>>> >>>> Hi all, >>>> >>>> This patchset adds support for 1GB THP on x86_64. It is on top of >>>> v5.9-rc2-mmots-2020-08-25-21-13. >>>> >>>> 1GB THP is more flexible for reducing translation overhead and incre= asing the >>>> performance of applications with large memory footprint without appl= ication >>>> changes compared to hugetlb. >>> >>> This statement needs a lot of justification. I don't see 1GB THP as v= iable >>> for any workload. Opportunistic 1GB allocation is very questionable >>> strategy. >> >> Hello, Kirill! >> >> I share your skepticism about opportunistic 1 GB allocations, however = it might be useful >> if backed by an madvise() annotations from userspace application. In t= his case, >> 1 GB THPs might be an alternative to 1 GB hugetlbfs pages, but with a = more convenient >> interface. > > I have concerns if we would silently use 1~GB THPs in most scenarios > where be would have used 2~MB THP. I'd appreciate a trigger to > explicitly enable that - MADV_HUGEPAGE is not sufficient because some > applications relying on that assume that the THP size will be 2~MB > (especially, if you want sparse, large VMAs). This patchset is not intended to silently use 1GB THP in place of 2MB THP= =2E First of all, there is a knob /sys/kernel/mm/transparent_hugepage/enable_= 1GB to enable 1GB THP explicitly. Also, 1GB THP is allocated from a reserved = CMA region (although I had alloc_contig_pages as a fallback, which can be rem= oved in next version), so users need to add hugepage_cma=3DnG kernel parameter= to enable 1GB THP allocation. If a finer control is necessary, we can add a new MADV_HUGEPAGE_1GB for 1GB THP. =E2=80=94 Best Regards, Yan Zi --=_MailMate_90CC73A7-32C1-445F-AAA5-E7CCB35F7A6C_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAl9Xj5cPHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKiFgP/2j/lRwfL410/Fcmx92+Cm4VFsGln6IyW0bn yBSO/B6CqjIZBcxLkbUHy1mfCAAT+y+p2JLyNyCF7AY00yVTiyQdtPtbuA61vAWB SZQkKEA1iOCN758VrDxsjF724WyWvnfPR5eGAAiYKvAaU/j8/nhE/UgRVq8JyCHn KtK/1D9V2ud+XnT05HZusqmhG0o/1ejsJjMVoxWOuNfrf4ZjDZC325s/WRBbKhLc 4lNElDUvOndvG+yy+f0DbNzYFSeU47y4N8y+WIhUyeNUBL3zpPuY74eoZ1awl4mN a4DDL8aU1GWgeuNTTQzxzMJd90mvJns2GRf1btNKlzWZYCj8LrZGXZ6aonp14TIh 3RfkOKkz9k2OQkm7j3HpSg/pp6T+IcEVuid296hQcumaeRCQSCS8IhERve2WxBeB tgVMfwXLkaMuENmXLgMTtUjvOJSvJvvZTovc2KJibyOXWTBqCpX5l5p0YElw2ZK3 GrTZMEaIvtJ3BksM2aLfLygMQfgFUMm+e2qtxRKQFD/TEZI/cwNK6aSL46qey0OU VFGXvnRCvzMS9gggT0yTTcVkbfNgRzrk5J3Jj6wPqckpgpHiciZTrs1Z/dj3gn73 mNpwfpD2qdLiZpLEubiuPX0p/ixSsZzWXA1ByyWyLBNS9bv3bmOt15HarDD9+Pga xzn2iS/U =5FkR -----END PGP SIGNATURE----- --=_MailMate_90CC73A7-32C1-445F-AAA5-E7CCB35F7A6C_=--