From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753207AbdIFNLn (ORCPT ); Wed, 6 Sep 2017 09:11:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56330 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752966AbdIFNLm (ORCPT ); Wed, 6 Sep 2017 09:11:42 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DFFA74E33D Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=longman@redhat.com Subject: Re: [PATCH 3/4] paravirt: add virt_spin_lock pvops function To: Peter Zijlstra Cc: Juergen Gross , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org, jeremy@goop.org, chrisw@sous-sol.org, akataria@vmware.com, rusty@rustcorp.com.au, boris.ostrovsky@oracle.com, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com References: <20170905132444.7163-1-jgross@suse.com> <20170905132444.7163-4-jgross@suse.com> <42918500-4487-f0d8-e6fd-99e4d0d7f1bf@suse.com> <3a2eefe7-5c0b-9768-2bb8-03c947133b06@redhat.com> <20170906070816.s6rtgtqpljnbudux@hirez.programming.kicks-ass.net> <20170906130600.2dke3ntcw2i5fss2@hirez.programming.kicks-ass.net> From: Waiman Long Organization: Red Hat Message-ID: <6dcf43c9-07a5-84dd-5a8e-ff7f7ba825dd@redhat.com> Date: Wed, 6 Sep 2017 09:11:40 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170906130600.2dke3ntcw2i5fss2@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 06 Sep 2017 13:11:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2017 09:06 AM, Peter Zijlstra wrote: > On Wed, Sep 06, 2017 at 08:44:09AM -0400, Waiman Long wrote: >> On 09/06/2017 03:08 AM, Peter Zijlstra wrote: >>> Guys, please trim email. >>> >>> On Tue, Sep 05, 2017 at 10:31:46AM -0400, Waiman Long wrote: >>>> For clarification, I was actually asking if you consider just adding one >>>> more jump label to skip it for Xen/KVM instead of making >>>> virt_spin_lock() a pv-op. >>> I don't understand. What performance are you worried about. Native will >>> now do: "xor rax,rax; jnz some_cold_label" that's fairly trival code. >> It is not native that I am talking about. I am worry about VM with >> non-Xen/KVM hypervisor where virt_spin_lock() will actually be called. >> Now that function will become a callee-saved function call instead of >> being inlined into the native slowpath function. > But only if we actually end up using the test-and-set thing, because if > you have paravirt we end up using that. I am talking about scenario like a kernel with paravirt spinlock running in a VM managed by VMware, for example. We may not want to penalize them while there are alternatives with less penalty. Cheers, Longman