Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp328442pxb; Wed, 3 Feb 2021 06:38:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyk6kpGSC+JJd4ya8OrE/+QQEOmW2xqkAsI3hR9kU94VXdaCxQrQVQ/Lg3kKRVUjxFU/fGH X-Received: by 2002:a50:c88d:: with SMTP id d13mr3282410edh.206.1612363099214; Wed, 03 Feb 2021 06:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612363099; cv=none; d=google.com; s=arc-20160816; b=ityJqVQtAzlbdCAaQT7YlNzl7+TzvEbuafE67yT3kHCwWmP/v14uFL6kRvlESS3oYh WsMlcpuSNj4YQgOQ5D6I/uF4lR1qtECIfzcoACd1ik/rE2WyXsC7B43gtSGaNkptNrf4 qQVxywXO0GHNT9HUtRLemhwt9YPy8KQ9E3iJwYy2NLhVhOvoaprHdti/pddjAFkCzZ75 1WFieCpiu/VT2XA2dZDB1CbcbmaXUXLgMa9OAagGzryNu8uQM9pD03hyil9nXD6v+qh4 RgAqzq5FVLe/asmoikuiJzaoCr2UFESU5C/mzgaio+cGIOHg833SJuvHMnAWUx3v/l2L EoFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=6lK2u2BMNZgjS8FOn0e/cEsWDsni55t0Ii5LPe/n/VA=; b=ewiJJA0BYkHTY0bi2yhg4/ydQNNhqjkA+Tp0m12O16Hx0uIaw+GJkQHXXMQLLTQ9YQ ONiZtN7ZLbW185Y9+NWRaeMIAmeuu6ONWODJS7AxS6okCKvM9rnWxBl7denbL9gbUriV wWG8RT1OAIPp9dt5xUrRAaIE73eDaMQ7CxZs/gstWgf/MyWjpLtdAA+m5thvpmUm8uWe G2v6VE1wxpgtH4CdCUlaj7dW6Ym5kHYB2DXNEEaQPLWS0x9kpdTUywy5hNxm3h+u0JM3 vBa8W9WNoJC0pS+Ct8lNWcopFa9fCeJwIBWBlfha8JzLWWoQxj2FLFpru6UP4ldYEYLB m0CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eLwHXxvB; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id uz17si1473581ejb.591.2021.02.03.06.37.44; Wed, 03 Feb 2021 06:38:19 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=eLwHXxvB; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233112AbhBCOgS (ORCPT + 99 others); Wed, 3 Feb 2021 09:36:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:60682 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233004AbhBCOfN (ORCPT ); Wed, 3 Feb 2021 09:35:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612362827; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6lK2u2BMNZgjS8FOn0e/cEsWDsni55t0Ii5LPe/n/VA=; b=eLwHXxvBCyQ0Q9vVyc6Z+ct2TQ8cmg7ha6OwmJHcu/QPdZ2ZBXJIYS3agRMMWVznA9+iCZ IriHfB2X0rt2RFS2LpIUv0XmLZ+Jq21FKlOXXUtaDFe6H9NCbA3WM5Ezkg+oK7+0HyCZvN dqa34LMebNGbQhtVDJ4fln4SfVz+JA8= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-VGFaqktFN-qjEoGqIh64Wg-1; Wed, 03 Feb 2021 09:33:45 -0500 X-MC-Unique: VGFaqktFN-qjEoGqIh64Wg-1 Received: by mail-ed1-f72.google.com with SMTP id f21so11706047edx.23 for ; Wed, 03 Feb 2021 06:33:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6lK2u2BMNZgjS8FOn0e/cEsWDsni55t0Ii5LPe/n/VA=; b=jSvZCcatXUKKKCGTqhK6tM073nLg9gK38kSuHvH9cphk5U8vqG9UId0YcQGuToWhGz PSGVZcjXw7a6WrERNXrarv/pRlGT1diityFFLtsjJ+tOnkPNYj/oOXOo06FgPkYeVW8J 3zhZK0bEjgJGYtMxeupj6q0mkQrQDaiEnC8SphfprxSPhe4kFtvuse2wu9TAMPHFVSLc pQTd/PdMQaX0PiBJDrLNcrssTSXCOW2pVr3z+feybEQlHXAjQCrNg6EV2LcpRfaTcXe+ NFyFnzdrM2kYtE54UCI4e2Z4PeGnSbEHuEoyCEUlZAg2zDvOd8sXXT5dM1+m2LP4/3OB a7ZA== X-Gm-Message-State: AOAM530mj+J6MDQVID4sFLmXE3SI2gs1nKtEzdviXQunN7qIv2O8mnqu XKpfoORm6D6gIGWhSee6shgi7AyTzSCwLTw0oAsDO9YAxZIrPjF67hfEdIrvq/NEgbzQjyWxBF+ CPKEuSKMFyFX93gHIm6xcYfhhuztuWuOP0JSZA4KpRLcP91s/NxqzzC/gPg/bX79L7tClX9HzlC 4C X-Received: by 2002:a17:906:660b:: with SMTP id b11mr3682847ejp.458.1612362823795; Wed, 03 Feb 2021 06:33:43 -0800 (PST) X-Received: by 2002:a17:906:660b:: with SMTP id b11mr3682671ejp.458.1612362821983; Wed, 03 Feb 2021 06:33:41 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id j5sm969210edl.42.2021.02.03.06.33.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Feb 2021 06:33:40 -0800 (PST) Subject: Re: [PATCH 2/2] KVM: Scalable memslots implementation To: David Hildenbrand , "Maciej S. Szmigiero" , Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Igor Mammedov , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , Cornelia Huck , Claudio Imbrenda , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <4d748e0fd50bac68ece6952129aed319502b6853.1612140117.git.maciej.szmigiero@oracle.com> <9e6ca093-35c3-7cca-443b-9f635df4891d@maciej.szmigiero.name> <4bdcb44c-c35d-45b2-c0c1-e857e0fd383e@redhat.com> <5efd931f-9d69-2936-89e8-278fe106616d@redhat.com> <307603f3-52a8-7464-ba98-06cbe4ddd408@redhat.com> From: Paolo Bonzini Message-ID: Date: Wed, 3 Feb 2021 15:33:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/21 14:52, David Hildenbrand wrote: >> >> However, note that the TDP MMU does not need an rmap at all.  Since that >> one is getting ready to become the default, the benefits of working on >> the rmap would be quite small and only affect nested virtualization. > > Right, but we currently always have to allocate it. > > 8 bytes per 4k page, 8 bytes per 2M page, 8 bytes per 1G page. > > The 4k part alone is 0.2% of the memblock size. > > For a 1 TB memslot we might "waste" > 2 GB on rmap arrays. > > (that's why I am asking :) ) Yes, we're in violent agreement. :) I mean that the simplest solution would be to allocate it lazily when building a non-TDP root. Paolo