Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5470826imd; Tue, 30 Oct 2018 18:58:50 -0700 (PDT) X-Google-Smtp-Source: AJdET5f+JEv3fU2v+m21X1uG1pbKyE/CMuOGnqOp1YmJQAsPItWKwZLldDyyco87SjDsqjdUxS/M X-Received: by 2002:a17:902:3a5:: with SMTP id d34-v6mr1204091pld.231.1540951130489; Tue, 30 Oct 2018 18:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540951130; cv=none; d=google.com; s=arc-20160816; b=wmMwmDneF8ZFd02ayXSu9z3ontMuC5vbGDPDWTvZll7HWsEl5yqm3hvH4NRTAU1KS6 MyoYNDW2eoORRDDMTKdFICjElFqJpR/gjKUWK23gDfl7Iyue4UwUDJKHqNl1UdA+waJ9 nIXfXQltnapzlA1aSk6C2Rwv757zTdpit8aSMqv8eX8omAOEpSBbF45JVLUdZCVlweOr 9dGXMVfX5wQe6AH9uGrl3Wp/ELS4DSIH+TSCVZqsKa1zJ5p3VPAWlsnu11c0uo+SIu+D 1r9AIEN2Gu4VBYS0jVXtGut8RkNIIC0tZDKsY7b3kmQ6jT2qoWhDnNWxOhq0d0LcltAp y4bQ== 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=etNquy5SxOQC1aMlXLPUqpIGvmXEUNHIuZQKCbEkutY=; b=Egh8WQdqHF7HE8DA2tYtO0y4lVMNa+gJ+gwk37pNlYkOg1RcUhQizUxdqSO0xjnAw7 zthiMPcYLWxJXTdoP2UKEDlRDH9qdetLjQbAa+Dw6mMf/ak6QBSCrjb3iQOUaHMjaBeF 5T0nQ1MyyD/7tQuDKFKoCA/iPU9Ilrg2YxEVHqOYMGh7dPX+zvUkkxAMJoom7LCZGYIA 0AGQSha/EZjm1g/t2Fm5xjYQZsDduBc5/3H9yDH/yU0vIUxKASNtrb7Duuu4fOaN8OpL JAOmqdZBLGefxoRmqDuxrYjYzkV4N3vEFUZUSP8idu/bPMxkf1EzoXLxShAK3evMZVpo FVHA== 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 bi6-v6si12423104plb.348.2018.10.30.18.58.35; Tue, 30 Oct 2018 18:58:50 -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 S1728740AbeJaKxB (ORCPT + 99 others); Wed, 31 Oct 2018 06:53:01 -0400 Received: from mga01.intel.com ([192.55.52.88]:20706 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728471AbeJaKxB (ORCPT ); Wed, 31 Oct 2018 06:53:01 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2018 18:57:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,446,1534834800"; d="scan'208";a="85510295" Received: from yisun1-ubuntu.bj.intel.com (HELO localhost) ([10.238.156.104]) by orsmga007.jf.intel.com with ESMTP; 30 Oct 2018 18:57:03 -0700 Date: Wed, 31 Oct 2018 09:54:17 +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: <20181031015417.GC15378@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> <20181023093328.GA15378@yi.y.sun> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181023093328.GA15378@yi.y.sun> 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 17:33:28, Yi Sun wrote: > 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. After checking codes, there is one issue to call vcpu_is_preempted. There are two spin loops in qspinlock_paravirt.h. One loop in 'pv_wait_node' calls vcpu_is_preempted. But another loop in 'pv_wait_head_or_lock' does not call vcpu_is_preempted. It also does not call any other ops of 'pv_lock_ops' in the loop. So I am afraid we have to add one more ops in 'pv_lock_ops' to do this.