Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3687448imm; Thu, 17 May 2018 12:56:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1lCKQVhi/3MuevifuEICo5VxI0RQFjAUEFf6hipdl7DlWWadLHAwmN9T95/i+oin0umeq X-Received: by 2002:a17:902:758d:: with SMTP id j13-v6mr6581927pll.188.1526586968697; Thu, 17 May 2018 12:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526586968; cv=none; d=google.com; s=arc-20160816; b=UjXXu5LYD1W3fsR3L81er+lDlxiiQLXRj19q2YXF8nI3+Q4My2j/rOJB84W9bmxV8/ uFEWpdlvKXI9tU12eTcgeOz6EJDGpvB3+OeGBb/z13xaxEEP6vd2Hi6dXNIjWcH4CZnY agdUBJgE5wBjbpxd8R6e9IluZm/6IWlYV8CFQ4n/Vh/5HkdCbEqjNPQse7nq5LQy54dc TyodUegnVvI+JAzIZYSmgPYLBByO2Pkc5BwpxP8IWg/sWweaXMoaVC7M9xWriCPP7X8E XdG9DVIxBQpkHItXDFSk4XUhM0drJwWMDvxpQwZq0goygdaMK3+CXiKoJiqZdA2yA7Nq xBnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=qcHtzXs87bBoRL7psdlf1WlHVpunx1dKAgFwnKtFuQI=; b=zAZPWksjWgMdDb1q0F1K4d54k+4PfUNEFz2JwgULlhk6qjyD8EL+ae20059SIYB7Yg JZD4Gd3QNtPYjgEKKvYlVDj9LiaIA6u+JMyjYpyyyn8EPTYTlObHqZuRJ8NNSfGy3oAF JbDE5H3Gmg8xLqGKIn+uVcEQKnRPP1jlnVjDpVVTceiJzkVImUlx3Z6YVSgeuPWCRbpI vJzH0n8BjylDl/IsVDZEZ+349Vex39JZKwK8DwpFLgNxeX/tOGqRpJNfoOEVRda0qHvO zJsMNf9ueeLrNK1Bgga8/Ih+zSh9Zc4EAVZf+vDYpglzXAsNt12HWvFWNgd4TPN/UzdJ VCMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89-v6si5713878plc.59.2018.05.17.12.55.54; Thu, 17 May 2018 12:56:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752135AbeEQTzh (ORCPT + 99 others); Thu, 17 May 2018 15:55:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35446 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751958AbeEQTzf (ORCPT ); Thu, 17 May 2018 15:55:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2059D402310A; Thu, 17 May 2018 19:55:35 +0000 (UTC) Received: from redhat.com (ovpn-125-92.rdu2.redhat.com [10.10.125.92]) by smtp.corp.redhat.com (Postfix) with SMTP id 297182024CBB; Thu, 17 May 2018 19:55:34 +0000 (UTC) Date: Thu, 17 May 2018 22:55:33 +0300 From: "Michael S. Tsirkin" To: Eduardo Habkost Cc: linux-kernel@vger.kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH] kvm: rename HINTS_DEDICATED to KVM_HINTS_REALTIME Message-ID: <20180517225316-mutt-send-email-mst@kernel.org> References: <1526568841-35372-1-git-send-email-mst@redhat.com> <20180517184658.GA1543@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180517184658.GA1543@localhost.localdomain> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 17 May 2018 19:55:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 17 May 2018 19:55:35 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 17, 2018 at 03:46:58PM -0300, Eduardo Habkost wrote: > On Thu, May 17, 2018 at 05:54:24PM +0300, Michael S. Tsirkin wrote: > > HINTS_DEDICATED seems to be somewhat confusing: > > > > Guest doesn't really care whether it's the only task running on a host > > CPU as long as it's not preempted. > > > > And there are more reasons for Guest to be preempted than host CPU > > sharing, for example, with memory overcommit it can get preempted on a > > memory access, post copy migration can cause preemption, etc. > > > > Let's call it KVM_HINTS_REALTIME which seems to better > > match what guests expect. > > > > Also, the flag most be set on all vCPUs - current guests assume this. > > Note so in the documentation. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > Documentation/virtual/kvm/cpuid.txt | 6 +++--- > > arch/x86/include/uapi/asm/kvm_para.h | 2 +- > > arch/x86/kernel/kvm.c | 8 ++++---- > > 3 files changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/Documentation/virtual/kvm/cpuid.txt b/Documentation/virtual/kvm/cpuid.txt > > index d4f33eb8..ab022dc 100644 > > --- a/Documentation/virtual/kvm/cpuid.txt > > +++ b/Documentation/virtual/kvm/cpuid.txt > > @@ -72,8 +72,8 @@ KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side > > > > flag || value || meaning > > ================================================================================== > > -KVM_HINTS_DEDICATED || 0 || guest checks this feature bit to > > - || || determine if there is vCPU pinning > > - || || and there is no vCPU over-commitment, > > +KVM_HINTS_REALTIME || 0 || guest checks this feature bit to > > + || || determine that vCPUs are never > > + || || preempted for an unlimited time, > > || || allowing optimizations > > My understanding of the original patch is that the intention is > to tell the guest that it is very unlikely to be preempted, > so it > can choose a more appropriate spinlock implementation. This > description implies that the guest will never be preempted, which > is much stronger guarantee. Note: ... for an unlimited time. > > Isn't this new description incompatible with existing usage of > the hint, which might include people who just use vCPU pinning > but no mlock? Without mlock you should always use pv spinlocks. Otherwise you risk blocking on a lock taken by a VCPU that is in turn blocked on IO, where the IO is not completing because CPU is being used up spinning. > -- > Eduardo