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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D0D0C43334 for ; Fri, 15 Jul 2022 23:03:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B66578E000A; Fri, 15 Jul 2022 19:03:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B167D8E0009; Fri, 15 Jul 2022 19:03:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DE078E000A; Fri, 15 Jul 2022 19:03:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8EADA8E0009 for ; Fri, 15 Jul 2022 19:03:45 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 56F956056E for ; Fri, 15 Jul 2022 23:03:45 +0000 (UTC) X-FDA: 79690863210.01.7CA919F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 06C7E20045 for ; Fri, 15 Jul 2022 23:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657926224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Icw+DEbSSX3MLPi/wiDEHSul5TtCehj1QjKG5ZBjsAI=; b=LjzycDFgz4aZi9+aatj6UWxwUZUgxkc5YK/6IzpBILfBLcsiX0IbiI2/vIDn3gwCrDD796 wwYyL/BZ+2Di9WKgye7OR44II9TO75BUxFnqqSJowspIfuBHn65HtyAGWxeuGYJG6alus2 ANP2wwnJnTg208cY72zlNQvvkGv5kP8= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-k-l6Bel4P_WsPliXwrfYiw-1; Fri, 15 Jul 2022 19:03:41 -0400 X-MC-Unique: k-l6Bel4P_WsPliXwrfYiw-1 Received: by mail-qk1-f198.google.com with SMTP id az32-20020a05620a172000b006b58ce94435so4446053qkb.1 for ; Fri, 15 Jul 2022 16:03:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Icw+DEbSSX3MLPi/wiDEHSul5TtCehj1QjKG5ZBjsAI=; b=vJ7zHEOcJHy5NURLQ8e17sQfrrlpl4wsGb80BKwyKENtweJsICcR/0MmmVU57SVS5p yX/iDir17/tw9McqkrMuyore3hMJj0h8qqpb//BLqLgmdsrXToONFe5f/xPYv+A/pXl6 3qn5VNiUSjyNOutE7BCr7vaytgmoOajyQc7hQwEej1auwaLdYcgTp3Rg+C3gPGUDA7mU sMBCfwq0uBvNkDi8oz0jDli7C/iVmMOpjxoTxufxkXJ/qxwxoFYNMZGqG0EfoWmo8skF GHtFleOUMJ5G8y73Ee1cMeP0of2JomCLEEE9kOeSwwyA/azL36CV1NjYuqDWpqMZLxgJ TMjg== X-Gm-Message-State: AJIora/14Mbz4KGHMVFi33XtLn5kbptFtBfF4Q9PRKN4IHo5OkKhACSo 52JRCQocKCq+4nwAumYx1EyVx7xBE/eMzbzMF6z1/gc1qmv3ut3jb3TpSOb7CKDMWUaWFGXRGO5 EFcwYbPtbAko= X-Received: by 2002:a05:620a:1a9b:b0:6a6:d3f6:5c97 with SMTP id bl27-20020a05620a1a9b00b006a6d3f65c97mr11062827qkb.225.1657926220600; Fri, 15 Jul 2022 16:03:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v0QNYTL780R2LvwScBaG53gCdrmd38N/vQaAAVgRX3spItAx0R9rUcsdDRvws7EQJAr34eXw== X-Received: by 2002:a05:620a:1a9b:b0:6a6:d3f6:5c97 with SMTP id bl27-20020a05620a1a9b00b006a6d3f65c97mr11062801qkb.225.1657926220374; Fri, 15 Jul 2022 16:03:40 -0700 (PDT) Received: from xz-m1.local ([74.12.30.48]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a254a00b006a6d74f8fc9sm6098721qko.127.2022.07.15.16.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 16:03:39 -0700 (PDT) Date: Fri, 15 Jul 2022 19:03:34 -0400 From: Peter Xu To: Axel Rasmussen Cc: "Dr. David Alan Gilbert" , Mike Kravetz , James Houghton , Muchun Song , David Hildenbrand , David Rientjes , Mina Almasry , Jue Wang , Manish Mishra , Linux MM , LKML Subject: Re: [RFC PATCH 07/26] hugetlb: add hugetlb_pte to track HugeTLB page table entries Message-ID: References: <20220624173656.2033256-1-jthoughton@google.com> <20220624173656.2033256-8-jthoughton@google.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LjzycDFg; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf03.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657926225; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Icw+DEbSSX3MLPi/wiDEHSul5TtCehj1QjKG5ZBjsAI=; b=2cr3tLkEbmmksZw3ZZwrG6KZNlWmeYmsF82E1IWC6BOs4xfSlV1upp6CCMD4I/ocEDNyYF 8bdxN2DyLi3NfY1AJYHbe/AoBjnuv9BVlv0d2qSqoBwojQlbEcikV6B24lyAkN9UruoL7c dZNSzUD/lSDKaZcqHikeIxUcHlqJxQ0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657926225; a=rsa-sha256; cv=none; b=wn2pmRJaBT0iNzXj0otXHh3yeNHFrkfRmRpy9Yf9rTUDm2mfg5QwX7NN+FJfq8RHZ5Vxo2 xr6PBiky/5IkcnP7y/mWt751InfQJQFTluMpWu2OTJ8dHf7djwigjZaNOphQnyv7J7+Wms mQdUOM/KBepLw9C7NTlD9Hut5u1SHts= Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LjzycDFg; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf03.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 06C7E20045 X-Rspam-User: X-Stat-Signature: utza97qehs1hgxcrsyyymtf7atu3114g X-HE-Tag: 1657926224-921243 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: On Fri, Jul 15, 2022 at 02:52:27PM -0700, Axel Rasmussen wrote: > Guest access in terms of "physical" memory address is basically > random. So, actually filling in all 262k 4K PTEs making up a > contiguous 1G region might take quite some time. Once we've completed > any of the various 2M contiguous regions, it would be nice to go ahead > and collapse those right away. The benefit is, the guest will see some > performance benefit from the 2G page already, without having to wait > for the full 1G page to complete. Once we do complete a 1G page, it > would be nice to collapse that one level further. If we do this, the > whole guest memory will be a mix of 1G, 2M, and 4K. Just to mention that we've got quite some other things that drags perf down much more than tlb hits on page sizes during any VM migration process. For example, when we split & wr-protect pages during the starting phase of migration on src host, it's not about 10% or 20% drop but much drastic. In the postcopy case it's for dest but still it's part of the whole migration process and probably guest-aware too. If the guest wants, it can simply start writting some pages continuously and it'll see obvious drag downs any time during migration I bet. It'll always be nice to have multi-level sub-mappings and I fully agree. IMHO it's a matter of whether keeping 4k-only would greatly simplify the work, especially on the rework of hugetlb sub-mage aware pgtable ops. Thanks, -- Peter Xu