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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 32711C433ED for ; Tue, 4 May 2021 17:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1365B613CB for ; Tue, 4 May 2021 17:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231734AbhEDR3g (ORCPT ); Tue, 4 May 2021 13:29:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbhEDR3d (ORCPT ); Tue, 4 May 2021 13:29:33 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C4D6C06174A for ; Tue, 4 May 2021 10:28:38 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id u13so8697341edd.3 for ; Tue, 04 May 2021 10:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nSjAAu8/uv2OHnvht3tsCA/NqO7UE0bjKWBDG7VyVvs=; b=fR+qBddIZH/jxUspHZqc2eSdJx08Os3neWEKcaxQHMt+9ypWw6vZq//LjxaT/Q6VAd 1+u3o6EoIDeKvuQxbNTlCKOT9PT8CFxOPjUwEbCrAA9GC9Qiw7HxBW6AGlFF70RIc4Dz tLi2r65CF7MVh5bcUWd2RP5tqbKiQmlaV9lFgBwEKm3ShCg3dAUNU9fUa20lmv5czMtA jKzRNwpon3/Z5MC3oIwK8T+Q+UjRpzJK5raqx3e35nsa1Up+In/TiarYlMQc2AKNGtkW n9aDMkbRF8jG1sr6+IyDhwwmR9E/WcNl3yUx+xSSNsJF23vvqi7R2jrWFWKx890V8Ycj dWyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nSjAAu8/uv2OHnvht3tsCA/NqO7UE0bjKWBDG7VyVvs=; b=CfTcmHO823l68nC4cC1p64DeHersmpYYz/NVzXl/l33EP4cWBWZ7l6SEmsWwiEhgxX A9cJ3Q7Z03Wblbr5WMBV6/UM76D1RBKr0fNVkbdGwwa0x0dK/KlZjk2kbe0FBMPwhnNH KyBd0pSZteFWBi9wngGe+ahfknY3hGby+qyIkYTs6fzeORKOU1ypujkiAWRk48xyogHL /lBjC9tiXgDk1oTJ7NTbVxGRCbw9HXvx4QfzhjUj7ajF3xWjUcsQzPncmClz0RJPrSZc 54sKNyeFWP9Q8sKcH5/vd3A6D+9twDBkRZdOhcDgQgV/mEQkzCeGvT8dKwybrGQfN6Nw PK0A== X-Gm-Message-State: AOAM5328btvRAC/TQ+tnhsA1t2VJ6L8/WyuVMuidNyYUZmqTFGUp8L/v POUpMMpnuIeMju2roZdO6dATZd/RFZyA9V+vu5uCrw== X-Google-Smtp-Source: ABdhPJxy3F9kuj96l3542ArNSwjtRexrVmjr1qVyuHJmdi3SyQzBLcvCQ8hHf1Gq5IXKagI+jaqgkNTZfgtYHAsbpkI= X-Received: by 2002:a05:6402:3090:: with SMTP id de16mr27183674edb.177.1620149317162; Tue, 04 May 2021 10:28:37 -0700 (PDT) MIME-Version: 1.0 References: <20210429211833.3361994-1-bgardon@google.com> <4d27e9d6-42db-3aa1-053a-552e1643f46d@redhat.com> In-Reply-To: <4d27e9d6-42db-3aa1-053a-552e1643f46d@redhat.com> From: Ben Gardon Date: Tue, 4 May 2021 10:28:24 -0700 Message-ID: Subject: Re: [PATCH v2 0/7] Lazily allocate memslot rmaps To: Paolo Bonzini Cc: LKML , kvm , Peter Xu , Sean Christopherson , Peter Shier , Junaid Shahid , Jim Mattson , Yulei Zhang , Wanpeng Li , Vitaly Kuznetsov , Xiao Guangrong Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 4, 2021 at 12:21 AM Paolo Bonzini wrote: > > On 03/05/21 19:31, Ben Gardon wrote: > > On Mon, May 3, 2021 at 6:45 AM Paolo Bonzini wrote: > >> > >> On 29/04/21 23:18, Ben Gardon wrote: > >>> This series enables KVM to save memory when using the TDP MMU by waiting > >>> to allocate memslot rmaps until they are needed. To do this, KVM tracks > >>> whether or not a shadow root has been allocated. In order to get away > >>> with not allocating the rmaps, KVM must also be sure to skip operations > >>> which iterate over the rmaps. If the TDP MMU is in use and we have not > >>> allocated a shadow root, these operations would essentially be op-ops > >>> anyway. Skipping the rmap operations has a secondary benefit of avoiding > >>> acquiring the MMU lock in write mode in many cases, substantially > >>> reducing MMU lock contention. > >>> > >>> This series was tested on an Intel Skylake machine. With the TDP MMU off > >>> and on, this introduced no new failures on kvm-unit-tests or KVM selftests. > >> > >> Thanks, I only reported some technicalities in the ordering of loads > >> (which matter since the loads happen with SRCU protection only). Apart > >> from this, this looks fine! > > > > Awesome to hear, thank you for the reviews. Should I send a v3 > > addressing those comments, or did you already make those changes when > > applying to your tree? > > No, I didn't (I wanted some oversight, and this is 5.14 stuff anyway). Ah, okay I'll send out a v3 soon, discussion on the other patches settles. > > Paolo >