Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4076119pxb; Fri, 11 Feb 2022 14:49:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUggSJ6a7fqb1HNePR9SLeI2JxwydJjFKr49vpL88ln0tMVoPykTPXZUC8wGYmdcgQDGGd X-Received: by 2002:aa7:c70b:: with SMTP id i11mr1374763edq.285.1644619786704; Fri, 11 Feb 2022 14:49:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644619786; cv=none; d=google.com; s=arc-20160816; b=HL7nueZheCZEVb2qduBYqKvSXbFRp6EzX253/Q5dhQ9q8qe50AkPO5JKfL11ZIffks aEqOnAW9HMYmHxmS/R5uilzMQA2bgehZhxHRt/u6lmJ9hdNSLkA11P9jgj6izG1K+niP PrtXFTGbH0unj3P6HQCRRQNBHo1G+frutCvJ7rc351JagZrAIzYrTv1P1zCDLLzOj9kI 7xOZFHgLqIN1gr+H6pV6q3HW5lp0ySgLUvF3DdekbYIyBDGL2rAMu8yRsoRh1weBRf/d xZNcY9lO/tdLIZxBo5xL9K9sIwgtNQFNybkc1OCJljJAG9Zu6hhJULpSPTRPI00w4b69 GrMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gfGkA7Cm98mQQxNqLHSWcgGR5BEvRqLzjxzk/VgJxmM=; b=nr/RMwL+QZfQEqQ5TTwZG00zNPv0jpbz2aulou+oLz4/iIZK4kV/xxty3NQUx0IVp4 h9q52wZUmO4dg6TGQCy56TJtLQbssaUEVr7m3U2JusGtnAhR8CLvBIo5ew5q2O5dFkJI Dl5TgkxCdPVNoSg6cxfUKseBuAJR96WN05ez1DRwRLBsxE13N1g5VZw0v5+S9ab52Vnb pkxS3IktxY3Ble3sgmNpaYLwmRdwJwVQE49ATk9pUm5q3w0S6Zn60w4RbHcJI3g++Wgt jDzb0tbzIcOXWoKrygWMAdWzcxfVCOgsImEMRwuanSCR1f4Q8A0KpXMSUNnOCJX1V0ew KrCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QgfI5LTT; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2si7099034edc.20.2022.02.11.14.49.21; Fri, 11 Feb 2022 14:49:46 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=QgfI5LTT; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348772AbiBKKIC (ORCPT + 99 others); Fri, 11 Feb 2022 05:08:02 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232868AbiBKKIA (ORCPT ); Fri, 11 Feb 2022 05:08:00 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5FB72A5 for ; Fri, 11 Feb 2022 02:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644574079; 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=gfGkA7Cm98mQQxNqLHSWcgGR5BEvRqLzjxzk/VgJxmM=; b=QgfI5LTT0nMBO/3np/vjnSFofQsFmwH8UFg/eNfit7ERaNOnbpyfjhI0F8GhOMlWeTp87f esCAB8BAfnta8fAkZjlVox4PKOJQySR46qlzTlW+rpX37kGg1DjOomBFRVbSUWTqzQxztX qOel18ssxNRA368ablMfAk8v2JdKsNM= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-169-UJhPphNQO4GDPCAR9XW4kQ-1; Fri, 11 Feb 2022 05:07:57 -0500 X-MC-Unique: UJhPphNQO4GDPCAR9XW4kQ-1 Received: by mail-ej1-f72.google.com with SMTP id aj9-20020a1709069a4900b006cd205be806so3884071ejc.18 for ; Fri, 11 Feb 2022 02:07:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=gfGkA7Cm98mQQxNqLHSWcgGR5BEvRqLzjxzk/VgJxmM=; b=aZ//SMaQ9V2dNTnY3x4Iz+8xJU8d7vpjmiDWKmyJJF18fnvRABVLpkvVvo1fIC0DGf H1bGGIvuEyMYT+Cj4VHtKxEf6v+/WiMhJlif/Zhy+Z/mFOffSF3bzQSIBId5blXejcSb KQVVNZGE/j5QUNv9+NpONBeufnhEgZTzgRsjbGQ2rSqZw7+BfSxh6HFwTLrr5gtFU0PD j9gJE1+5N8QTXKC0lsMaUaR6auEJ6HGFpX6NvjfWsVAseJTMaUxMykeggLhYKrAM93jX Mr1Q/c75b24GVTyE9NBWuzxz9oR8xNBtMAvG2J8pPnbOGMArEl1dLDyLUOefePcdpZCH cU1A== X-Gm-Message-State: AOAM533NfVHNx0sd0e2AdUtrtIGeAcCNU1qJnvu1shbAug/b/5HqAHs/ aOUe2t7VNag99daMem/hYAMhmMI90BdTZ4OmXmPAey9PVza5xztfjorulnjuYElMK0oZGfFE1C+ SkpjC/+jkOqRC003gCQe9ewfx X-Received: by 2002:a17:906:c112:: with SMTP id do18mr757967ejc.472.1644574076535; Fri, 11 Feb 2022 02:07:56 -0800 (PST) X-Received: by 2002:a17:906:c112:: with SMTP id do18mr757957ejc.472.1644574076322; Fri, 11 Feb 2022 02:07:56 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.googlemail.com with ESMTPSA id eg11sm9365972edb.17.2022.02.11.02.07.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Feb 2022 02:07:55 -0800 (PST) Message-ID: <4e05cfc5-55bb-1273-5309-46ed4fe52fed@redhat.com> Date: Fri, 11 Feb 2022 11:07:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 06/12] KVM: MMU: rename kvm_mmu_reload Content-Language: en-US To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, vkuznets@redhat.com, mlevitsk@redhat.com, dmatlack@google.com References: <20220209170020.1775368-1-pbonzini@redhat.com> <20220209170020.1775368-7-pbonzini@redhat.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 2/11/22 01:27, Sean Christopherson wrote: > On Wed, Feb 09, 2022, Paolo Bonzini wrote: >> The name of kvm_mmu_reload is very confusing for two reasons: >> first, KVM_REQ_MMU_RELOAD actually does not call it; second, >> it only does anything if there is no valid root. >> >> Rename it to kvm_mmu_ensure_valid_root, which matches the actual >> behavior better. > > 100% agree that kvm_mmu_reload() is a terrible name, but kvm_mmu_ensure_valid_root() > isn't much better, e.g. it sounds like a sanity check and nothing more. I would have thought that would be more of a check_valid_root(). There are other functions in the kernel following the idea that "ensure" means idempotency: skb_ensure_writable, perf_cgroup_ensure_storage, btf_ensure_modifiable and libbpf_ensure_mem in libbpf. I'm not a native speaker but, at least in computing, "ensure" seems to mean not just "to make certain that (something) will be true", but also taking steps if that's not already the case. I also thought of "establish_valid_root", but it has the opposite problem---it does not convey well, if at all, that the root could be valid already. Paolo > > Maybe just be very literalal? > > kvm_mmu_load_if_necessary() > kvm_mmu_load_if_invalid() > > Or follow cond_sched()? > > kvm_mmu_cond_load() >