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 E5E92C433B4 for ; Mon, 3 May 2021 17:30:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A600061182 for ; Mon, 3 May 2021 17:30:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231523AbhECRay (ORCPT ); Mon, 3 May 2021 13:30:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231285AbhECRax (ORCPT ); Mon, 3 May 2021 13:30:53 -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 D8514C06174A for ; Mon, 3 May 2021 10:29:59 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id b17so4199871ede.0 for ; Mon, 03 May 2021 10:29:59 -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=Wo+3D2WH6zYwTkILvVy6D/EkEPxtoZBBnnAY6b6btd4=; b=sEGX8JuBNskey+iHEkDuFkLzMsN8mdfs5ym8ZOw6mVx23SZFxzP3RgCAcoRiBr6TPy fytvGyD6UGsc3MctHTcM152ui5Bm8crn9r5W1WPZA+mWKXi2pt3TH1xJOtOXZpKRPsk8 63mjaA8bNYBoXVrih6tCRGT6ZLXuoBLHgB2PZjgHBFjiP5aMjp7oG2rGmfZdxKEu/k3B RQHQcS2N7zee+JD0YdlADTQjfgcjupfRhR+wEiuRErmoe5zeNtc4+mPp5Clp33uOGwTU yNM8pcC8oRd1fZ26aiOk6u77uiwiU8PW2dbjKqSGTVMVHWxjWYsPyNIiG8x9tn+CeQFI byHQ== 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=Wo+3D2WH6zYwTkILvVy6D/EkEPxtoZBBnnAY6b6btd4=; b=AMaOsU/ESnqmDqtF2K5otCcfefxkhaPFjNDZ9Iwfh7mbnX15iTsazMgbLv2OjVispu gQV23l0LQTJcZxt9ClSOG0cf+xiHkPOr6BhYtjwv+YX2xcbeSEGFZBs6ngkh8MtZHUh5 fkknHNcPegDQQR3VG5gToHzCvsSbfMpcCrqhjX4qo7e8L7HTwHFzl0efbUXI74cbtkie VJw8xt5UP1fr0KaH2E5mRM5np5e5vgQjqtUHZS3Az+HdfMZEE7yD6I0RwHwJiT1g8aQx PvQrtrM5VqtCz1AYnVZr9BPHIkwxIXqyc09jyqpCN+fZanwcbNlTw9RQALTDG2aBrUY1 69pA== X-Gm-Message-State: AOAM531aw7Rb7y7TeBBE3a4WHyzy9tKwgq7fq7wGV7enMGG6itDlMPUo e4Nbey58ShkXWIe1Q+Azo8T7VgmDbmeC9fQS3KbEAO6natQ= X-Google-Smtp-Source: ABdhPJyU5c1skKCSJwjpn4CF3EhnwaMRKedy59htKPIKzkTK643efQAWfH8HBBvmzxuv782rYPKfCxu7ar+C4333clY= X-Received: by 2002:a50:eb47:: with SMTP id z7mr19538118edp.68.1620062998464; Mon, 03 May 2021 10:29:58 -0700 (PDT) MIME-Version: 1.0 References: <20210429211833.3361994-1-bgardon@google.com> <20210429211833.3361994-8-bgardon@google.com> In-Reply-To: From: Ben Gardon Date: Mon, 3 May 2021 10:29:47 -0700 Message-ID: Subject: Re: [PATCH v2 7/7] KVM: x86/mmu: 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 Mon, May 3, 2021 at 6:42 AM Paolo Bonzini wrote: > > On 29/04/21 23:18, Ben Gardon wrote: > > +int alloc_memslots_rmaps(struct kvm *kvm, struct kvm_memslots *slots) > > This can be static, can't it? Ah, yes. Absolutely. > > Paolo > > > +{ > > + struct kvm_memory_slot *slot; > > + int r = 0; > > + > > + kvm_for_each_memslot(slot, slots) { > > + r = alloc_memslot_rmap(kvm, slot, slot->npages); > > + if (r) > > + break; > > + } > > + return r; > > +} > > + >