Received: by 10.223.164.202 with SMTP id h10csp399333wrb; Thu, 9 Nov 2017 08:03:44 -0800 (PST) X-Google-Smtp-Source: ABhQp+S4ZcX66igbaScK/wuTc9DMu72WyPuOka3vznrbZcflEAMTba3ec4L39iQaavZCYdbpAILi X-Received: by 10.98.182.15 with SMTP id j15mr943019pff.47.1510243424334; Thu, 09 Nov 2017 08:03:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510243424; cv=none; d=google.com; s=arc-20160816; b=azlKc81bhBEDYVMbVwXW5iP6ZlhRBfijYVqIznHqkOSKYP4D5t4Q44+PeH/K+NycbW Gf81MZAYdXfU7MrjYfrqXyagOulRKzUpNDt9Lm6owx5929ufGUZk3CDUUSTW5iCxAzly 3n+27bItYLLL4sDeA8u5aWp+NnvEcwSpRfd+q+RQ8OfYFiaKK+K/NhiC7XtwKy7+gE41 KxDdI9bazKAGJPEF8z9QvFuq+CrAasyz44LI/AFHMxzxMi22ZQGLiGG3QPzljXX36MFW MgGarJT1JQbXa8yHgMp63HqR8agTqgjjzJo7tlif0fhkflamjpxeYhWP2KYdRBVsbipi 7uMQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=3fSIahANVBOVvLf/hCoWeoX/Gg62sP75h5GaduwnbeU=; b=Srqr/orwZ6RRBv9d4d55KN1KQffRrTjra8ifRo7xIu/HpWmULaKncxA+YEVkck2ne5 MN2gibG7rg3k+UtDM3bKgemJW0cOjcIbbRVzxV7yhw1znCpHZIKY+YIQU/Qp2QAw/GsU rAtr9qMdtHn3wtB5GPAmtFulWgZp37H6e7YQn+ge6oaAUFxfYPYX3XFls4ENMWm1+YsS DfwUFGCQL4M8/N5mvev4PmLbbe3EYHuYhuMqmOyiHNca6Z+o7xQdNv2J3Xv/Eol7reRg rgkkFKUdrpl1AH9gGwtx0ftVmaw3EmNCrHNKmRKxMn8yAYhCctsyC1n6VUXD/sNmnCE3 7Vrg== 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 o88si7086517pfk.294.2017.11.09.08.03.10; Thu, 09 Nov 2017 08:03:44 -0800 (PST) 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 S1753195AbdKIQAi (ORCPT + 81 others); Thu, 9 Nov 2017 11:00:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57350 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752625AbdKIQAh (ORCPT ); Thu, 9 Nov 2017 11:00:37 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0023581226; Thu, 9 Nov 2017 16:00:37 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 3902E61F51; Thu, 9 Nov 2017 16:00:31 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Thu, 09 Nov 2017 17:00:30 +0100 Date: Thu, 9 Nov 2017 17:00:30 +0100 From: Radim Krcmar To: Wanpeng Li Cc: Eduardo Valentin , Paolo Bonzini , Matt Wilson , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , Peter Zijlstra , Waiman Long , kvm , linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" , "Jan H . Schoenherr" , Anthony Liguori Subject: Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set Message-ID: <20171109160029.GD20859@flask> References: <1509999980-10828-1-git-send-email-eduval@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 09 Nov 2017 16:00:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-09 20:43+0800, Wanpeng Li: > 2017-11-07 4:26 GMT+08:00 Eduardo Valentin : > > Currently, the existing qspinlock implementation will fallback to > > test-and-set if the hypervisor has not set the PV_UNHALT flag. > > > > This patch gives the opportunity to guest kernels to select > > between test-and-set and the regular queueu fair lock implementation > > based on the PV_DEDICATED KVM feature flag. When the PV_DEDICATED > > flag is not set, the code will still fall back to test-and-set, > > but when the PV_DEDICATED flag is set, the code will use > > the regular queue spinlock implementation. > > > > With this patch, when in autoselect mode, the guest will > > use the default spinlock implementation based on host feature > > flags as follows: > > > > PV_DEDICATED = 1, PV_UNHALT = anything: default is qspinlock > > PV_DEDICATED = 0, PV_UNHALT = 1: default is pvqspinlock > > PV_DEDICATED = 0, PV_UNHALT = 0: default is tas > > > > Cc: Paolo Bonzini > > Cc: "Radim Krčmář" > > Cc: Jonathan Corbet > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: "H. Peter Anvin" > > Cc: x86@kernel.org > > Cc: Peter Zijlstra > > Cc: Waiman Long > > Cc: kvm@vger.kernel.org > > Cc: linux-doc@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Cc: Jan H. Schoenherr > > Cc: Anthony Liguori > > Suggested-by: Matt Wilson > > Signed-off-by: Eduardo Valentin > > --- > > You should also add a cpuid flag in kvm part. It is better without that. The flag has no dependency on KVM (kernel hypervisor) code. From 1583604450838623946@xxx Thu Nov 09 15:54:52 +0000 2017 X-GM-THRID: 1583352031107436177 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread