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=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 3B40BC433E0 for ; Thu, 28 Jan 2021 08:20:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E95AF64DD6 for ; Thu, 28 Jan 2021 08:20:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231448AbhA1ITu (ORCPT ); Thu, 28 Jan 2021 03:19:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50706 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231335AbhA1ITn (ORCPT ); Thu, 28 Jan 2021 03:19:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611821889; 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=9C3yiPfFKb5aW+Bgfuw5xS6YHiwj8cVR/h8E0NIrX2U=; b=QGQG9Dcwk73c0msOeNGC5YboYQsHLu0pc3TY91bw5yOdlFINHEept1H30sDk4dsioMvkO+ OzgMSvdzR3coflGk/AuHjUIRlccCJ84R0BBHkxSMSOWvpCiW8M3RbZ4SEBsGNwvc+iV29/ b1sVpiV/ZdcoYPVarBtF11lh5ce2Zmo= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-baYiU9SRNnW_70c2gB2tbg-1; Thu, 28 Jan 2021 03:18:06 -0500 X-MC-Unique: baYiU9SRNnW_70c2gB2tbg-1 Received: by mail-ed1-f69.google.com with SMTP id j11so2807507edy.20 for ; Thu, 28 Jan 2021 00:18:06 -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=9C3yiPfFKb5aW+Bgfuw5xS6YHiwj8cVR/h8E0NIrX2U=; b=XYCp1VeGzzw9QYSoCZM8QAokpM1AJARmy3QftoNr+ygqtkvIAXclgi9tHZichayyRV WPt8BpFM8UQxNbf5QZ3cZ7ShYN4N1PQLwLDrpdriPVC7EXtPL7PrztVSKAtj3joR+Uny nsKxR6O+KOhXJftuufwfVk8tuH17dg+q8vhWNX3aJVIOPBuR3RKAHvt3YrL8WJiPq51z TEhP8f4oxss7ecU/Ld+frBYNHrXAp0B58z38ZIZg4WPCGMYYEHVRUyrr2pm1zoQN/OQQ Qy3fWeoUx6JsruCdg0FsAsJjrAwsvAKLAHe7YC3kF7YUOUlt0WsltJQZpMj/AcDZFU8B XVfQ== X-Gm-Message-State: AOAM5330kXLmwmTDiwUp/6nlRu/1v9D/kZkRXosMhpYE9LIJAhLUNLtz 3SEX36jLP2rFWbG4eEasRgWN+fbTkc9TcRvX+AEGAydCZh0EqH5Wb+sP3g0khSZ6APDqp1gP8SG G/GyzJXEyy3Fi X-Received: by 2002:aa7:d0d4:: with SMTP id u20mr12312765edo.203.1611821885483; Thu, 28 Jan 2021 00:18:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJKqbOLa1ltAkb+2RvgjlMFRSmUiSGsTYcB1FyvSUbCwutAznr+10kD6tqpqX55az450Jegg== X-Received: by 2002:aa7:d0d4:: with SMTP id u20mr12312749edo.203.1611821885259; Thu, 28 Jan 2021 00:18:05 -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 gj9sm1935372ejb.107.2021.01.28.00.18.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jan 2021 00:18:04 -0800 (PST) Subject: Re: [PATCH 15/24] kvm: mmu: Wrap mmu_lock cond_resched and needbreak To: Ben Gardon Cc: Sean Christopherson , LKML , kvm , Peter Xu , Peter Shier , Peter Feiner , Junaid Shahid , Jim Mattson , Yulei Zhang , Wanpeng Li , Vitaly Kuznetsov , Xiao Guangrong References: <20210112181041.356734-1-bgardon@google.com> <20210112181041.356734-16-bgardon@google.com> <460d38b9-d920-9339-1293-5900d242db37@redhat.com> <4c0d4c30-a95b-7954-d344-fb991270f79a@redhat.com> From: Paolo Bonzini Message-ID: <816d3c6a-2418-8091-96fb-6a4e6bbf0a95@redhat.com> Date: Thu, 28 Jan 2021 09:18:02 +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: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 27/01/21 22:20, Ben Gardon wrote: > On Wed, Jan 27, 2021 at 12:55 PM Paolo Bonzini wrote: >> >> On 27/01/21 21:08, Ben Gardon wrote: >>> I'm not entirely sure I understand this suggestion. Are you suggesting >>> we'd have the spinlock and rwlock in a union in struct kvm but then >>> use a static define to choose which one is used by other functions? It >>> seems like if we're using static defines the union doesn't add value. >> >> Of course you're right. You'd just place the #ifdef in the struct kvm >> definition. > > Ah okay, thanks for clarifying. > >> >> You can place static inline functions for lock/unlock in >> virt/kvm/mmu_lock.h, in order to avoid a proliferation of #ifdefs. > > Would you prefer to make that change in this series or at a later > date? I'm assuming this would replace all the wrapper functions and > mean that x86 is rwlock only. Yes, exactly. I would like to make tdp_mmu=1 the default as soon as parallel page faults are in (and thus scalability should be on par with the shadow MMU). Paolo