Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3237647ima; Tue, 23 Oct 2018 02:38:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV623gVxs53qgcHyLxXdMO28lqeO2lCPQ2xqGRmX7+MCqxS7EbIlq7SUnSqiv9CjGdbXin/OP X-Received: by 2002:a17:902:3204:: with SMTP id y4-v6mr42828919plb.135.1540287528852; Tue, 23 Oct 2018 02:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540287528; cv=none; d=google.com; s=arc-20160816; b=ifdqAhufAwx3CMXxmkhNNFnNJmV2HYUDVGY6BeToMb+3J8Co/gWVa52k6maJ4k22Sl fTBUP5KBx9HDw00iJnm7o9CUt3FBEjaaS3oP41lqYSdEWzeIkLSSIDXqERzBFqSQtjMx VYnjivruuTqJ2PYLL5NxGlDD0wmdi2aQ8oGhKOefPnspX1lqdTLSkHJGG4rFo8rOmLfg P7rf10R+nKM6GJzqpGvP5GybWUrL/6jYuLuj+5IFnzOH6hvamvrz80cTmU2IzaSg4n95 BSmGkYlcBLpSM4Jv5Zl/vDqmjpQdODAIkko85H5tKEVKQS8ROGNl6RxHk5WcCkFEtfk4 TiKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5JAQn1WhvoWbY3NLy0SQvbKlouB/yXJnslvt0mgWDss=; b=lcjH2/i32POWnDedDfDO924nHeAW4qGATkgVhc8yDXUn8qP05YH9xX4w1OQrdeHwwE cspVxdh7ZGqmPcDfXRyVWMQ7ZYQtObnvVYnLHtPPSYpR7DvQ2RFrZIh0R/Fvht4QFnx2 ZtK+YpbwZ9Z4nc3zXQ+7H5EP7c0cJnWDe1ZZpTbmSovQ2dhiS9UHyveum9/DponfHOzq Fnk1kmOSFBG8EXsxktK2YQ6WRrWcMNlRgDjzz9S6w8I8+t20XdrtD6OeIlNcx2W0yqp+ rGTExc5jSjiGFAwMb2OzSp9kMehrhPs/7GxCswbkcyR5LnzKXOcQDT96SDUs5ZlouAWm v5ZA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v128-v6si832705pfc.193.2018.10.23.02.38.33; Tue, 23 Oct 2018 02:38:48 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728696AbeJWR6y (ORCPT + 99 others); Tue, 23 Oct 2018 13:58:54 -0400 Received: from mga01.intel.com ([192.55.52.88]:8558 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728641AbeJWR6y (ORCPT ); Tue, 23 Oct 2018 13:58:54 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2018 02:36:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,415,1534834800"; d="scan'208";a="102519580" Received: from yisun1-ubuntu.bj.intel.com (HELO localhost) ([10.238.156.104]) by orsmga002.jf.intel.com with ESMTP; 23 Oct 2018 02:36:12 -0700 Date: Tue, 23 Oct 2018 17:33:28 +0800 From: Yi Sun To: Peter Zijlstra Cc: Waiman Long , Juergen Gross , linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, chao.p.peng@intel.com, chao.gao@intel.com, isaku.yamahata@intel.com, michael.h.kelley@microsoft.com, tianyu.lan@microsoft.com, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "mingo@redhat.com" , Will Deacon Subject: Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall Message-ID: <20181023093328.GA15378@yi.y.sun> References: <1539954835-34035-1-git-send-email-yi.y.sun@linux.intel.com> <1539954835-34035-3-git-send-email-yi.y.sun@linux.intel.com> <20181022015342.GK11769@yi.y.sun> <2e0d62cb-b706-a5b4-65f7-982a913fb32b@suse.com> <20181022171516.GH3117@worktop.programming.kicks-ass.net> <20181023025740.GL11769@yi.y.sun> <20181023085127.GG3109@worktop.c.hoisthospitality.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181023085127.GG3109@worktop.c.hoisthospitality.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18-10-23 10:51:27, Peter Zijlstra wrote: > On Tue, Oct 23, 2018 at 10:57:40AM +0800, Yi Sun wrote: > > On 18-10-22 19:15:16, Peter Zijlstra wrote: > > > > > >>>> +#if defined(CONFIG_X86_64) && defined(CONFIG_PARAVIRT_SPINLOCKS) && IS_ENABLED(CONFIG_HYPERV) > > > > >>>> + if (!hv_notify_long_spin_wait(SPIN_THRESHOLD - loop)) > > > > >>>> + break; > > > > >>>> +#endif > > > > > > Secondly; how come you thought that was acceptable in any way shape or > > > form? > > > > > Sorry for that. Will try another way. > > Can you try and explain why vcpu_is_preempted() doesn't work for you? I thought HvSpinWaitInfo is used to notify hypervisor the spin number which is different with vcpu_is_preempted. So I did not consider vcpu_is_preempted. But HvSpinWaitInfo is a quite simple function and could be combined with vcpu_is_preempted together. So I think it is OK to use vcpu_is_preempted to make codes clean. I will have a try.