Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5091227rwl; Tue, 28 Mar 2023 16:18:19 -0700 (PDT) X-Google-Smtp-Source: AKy350YX7xdS8P5+8H7Rj6auvKxHpnvLGDFjc1E0Dk98COqHySpIuH34d4vzfjXib6RcIuM9skVc X-Received: by 2002:a62:17c7:0:b0:625:13f3:9409 with SMTP id 190-20020a6217c7000000b0062513f39409mr15042011pfx.26.1680045498995; Tue, 28 Mar 2023 16:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680045498; cv=none; d=google.com; s=arc-20160816; b=MsbN7T4FvLKImXqOwQ1ozLjbH6RbTYFRqvUv4jSptk9ku8A5CKNTOcpbQ0XA+qdUE/ GyyIYh5Cok+Pr5nq0R5Jnd1kAagfzEZPvW2X3RmYtoh99HTiInD2dA7QyCG0RtgXdLra 0GAfj4fJwiPkEhEhgwoEgPNeqhppXImel7X5goSXnO6pUfkPWkYqeNZpTH4/MHk5gPYK KzR/kQxbjtaUd7ad7zxZLDR0jenVebHlIUzDGUwMyIg0pT9htlTXboD7TBINEDfNoP5/ km6VNx8dr8JYajVm4E10gLzxm58lQEOy4rfic+JsksMfYCjv9h+WlsAY3BlhgnXPworF WbwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9Ovm+AM85KXAJZHu2fD53I2qFnekQy/WozXcpTNpGGI=; b=L+hDz6NMX1YRD6wS0GnLrKTYTvPm4hTWq+KAxDQdO005Z+rfAIjThEZvjvYQ/XZ6MV HGRpnagXhi7JK2Dql1hhiqmATwb1T107rhpLzuddrYmpIahwcbhpI6v8N6zdJnI7CuLt CsMsBmK+ZjDwoyKPur/Tr5V6VsPB6WFZgh5S+0fIHk6gOXlbv/PN456Z5qSahGuR653+ vfLu92K4VvV5nAOXGhFchxFLYKlQR1lUE5e56AhrGc0H6xIInIfopJaMpi4ByLC+6zZF eFXscaXoqhtN55UW9xvDQw4jaz/yZ9bc09kbpFva/IYGSZVh2dlud/E6AGafv4De1lF5 GsgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="Dnh//BOQ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 135-20020a63058d000000b00509e19a67c3si30778856pgf.87.2023.03.28.16.18.06; Tue, 28 Mar 2023 16:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="Dnh//BOQ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbjC1XNi (ORCPT + 99 others); Tue, 28 Mar 2023 19:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbjC1XNh (ORCPT ); Tue, 28 Mar 2023 19:13:37 -0400 Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3F861BF0 for ; Tue, 28 Mar 2023 16:13:34 -0700 (PDT) Received: by mail-ua1-x92e.google.com with SMTP id r7so10140129uaj.2 for ; Tue, 28 Mar 2023 16:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680045214; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9Ovm+AM85KXAJZHu2fD53I2qFnekQy/WozXcpTNpGGI=; b=Dnh//BOQKl1nkYVftlXgaATG8gbO0cTyEPMrBs5HAYsbWGowNRajjCifsI/vIZgLNu Tjt0Tmm9zQxzn2NTJyBR/8uM3MZh9heUL07KmfnRS5COYj2T2xckjf0LxMVs8cjOewS9 NYz7jIbXQcnk8byiK+pYEu9mtRx73cRD4q/lIjQ3WEqh9I69sD5H8zWp5l5RNcqJuD9L B/lmajj6pvI5pH1UvMmEb9b99s/Ekxm3z4i0lQt4WvOnArzetoUU3oAYdaSA02LEhS1E 2eV3VVkXy4+De5jJXoMYgWSU320EMUj2I4v8zgw0hYG6JBa6LC/U/ZhNEDDoVWlqTQKo /+ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680045214; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9Ovm+AM85KXAJZHu2fD53I2qFnekQy/WozXcpTNpGGI=; b=GemyzJZVkXpjnnT0OZeVtFpIPgPt4TIVcXpC856sDiNDubKGRg5feoEfB0Vqv5QqoC Rc/SewPY16q0+jCC2yfSZchRo4R2yxLX9uE3/v6SKqCVAjtVPAHBRouraiY8DVS6QNof eN5TzyTsGqf28I2Ia/F4zT1rRU6z1veuUNpjGBtO710Qp8ypZ46U+fZZUzm6haIAK0Ny yu7Zb+H1XyOta+eJaIUKRClhrMomAJIUA3QVS35ij9u9imGGrDvcBIT68dYEjubAgea8 NLnN/yVzWIqFKtCpHJGGWwM1VlybgH8bVtEgxpl/vveuu+vMY7+q3Gr1QcKesqO7/lXt OLFg== X-Gm-Message-State: AAQBX9e9oJPRvnp3S/9PyI//DeaETzujDb55ZfMkoVIVcrYVHldTbVUV wyezAIL2WSw4Jcm5K6S3KfIunHkQLEj2LqAKpS+auw== X-Received: by 2002:a1f:b2d2:0:b0:43b:96b8:1a9f with SMTP id b201-20020a1fb2d2000000b0043b96b81a9fmr5841630vkf.2.1680045213907; Tue, 28 Mar 2023 16:13:33 -0700 (PDT) MIME-Version: 1.0 References: <20230306224127.1689967-1-vipinsh@google.com> <20230306224127.1689967-15-vipinsh@google.com> In-Reply-To: From: David Matlack Date: Tue, 28 Mar 2023 16:13:07 -0700 Message-ID: Subject: Re: [Patch v4 14/18] KVM: mmu: Initialize kvm_mmu_memory_cache.gfp_zero to __GFP_ZERO by default To: Vipin Sharma Cc: seanjc@google.com, pbonzini@redhat.com, bgardon@google.com, jmattson@google.com, mizhang@google.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 28, 2023 at 10:31=E2=80=AFAM Vipin Sharma = wrote: > > On Thu, Mar 23, 2023 at 3:28=E2=80=AFPM David Matlack wrote: > > > > On Mon, Mar 06, 2023 at 02:41:23PM -0800, Vipin Sharma wrote: > > > Set __GFP_ZERO to gfp_zero in default initizliation of struct > > > kvm_mmu_memory_cache{} > > > > > > All of the users of default initialization code of struct > > > kvm_mmu_memory_cache{} explicitly sets gfp_zero to __GFP_ZERO. This c= an > > > be moved to common initialization logic. > > > > If that were true we could get rid of gfp_zero entirely and hard-code > > __GFP_ZERO in the memory allocator! mmu_shadowed_info_cache is the one > > that does not set __GFP_ZERO. > > > > Can we use __GFP_ZERO for mmu_shadowed_info_cache? Yes but doing so would add CPU cost to zero the memory on allocation. Someone would need to do some performance testing to confirm that the cost of zeroing is acceptable. > Also, MIPS doesn't > use __GFP_ZERO, I think it might be a missed thing in MIPS rather than > intentional.