Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3948921imm; Mon, 17 Sep 2018 05:59:18 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdax7w9vhba92R9rc9sJcmUQzwqSCm3tXMUG2Q8LPsRjPYV8FD4IaEXJO5vzoTsyUHD3O8ev X-Received: by 2002:a63:f751:: with SMTP id f17-v6mr23678327pgk.410.1537189158519; Mon, 17 Sep 2018 05:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537189158; cv=none; d=google.com; s=arc-20160816; b=y9kzZ/HY/mkxdAXYFbJKT0qE4Cc7XiF+sh5URVGJe9evvL25oP35F84fZ3kYMfauhV EP+cazGmhYauHy4C+DHE6HA0WfAMEExzisPV3eL/iV8qwAaDfQGuf0yyxTW723nLxWX5 Y74wr+msLSBQiKIrnO5l+SrQaOo3nP1AOGBIuShMJ4DZ9C4YoPPeSZ6zU3CEDyMLnW7y bBUTTRYCuIQTzzeFEUNaKNN73uzA2mV/Ugso/Xtm42EDS1v2a8nQyfPHrzISlZ9JblQo qrFz2r3rNHeNjyl78ASXfpsCcIDM0bWeoIAarS1lYxMmdhR59yTab3vIA/zMS1O2zVOh WaoA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=NDedFvBNzGdKptJUnz24jVbxBe6nr1aoG+vH2jBeCYQ=; b=tGuGH9i66p6AddtXJDL9bIsjWgD8Jyckmh6XbA/GW9EGP9Z8MQmKCSgkanrlu3Y+G+ e00oVG2YBIbrGTqwIbGaIJTS2N1UTtcrXWrqP8Av2D4bkKm+7y0MyFBVlKytmiC6Do5i P4sNDl1I+Y6dX6cPZtFGvL8SRQ3S2/EFqKEoOYPkPs215inHsRFZAHycRHq9oT/E2FTp VvwzeNKE+h+S8V1i5/MwnP6JGn++OBJmn7ViFhcPmMGWvGgFowALfP7j4J5j4UqTu3rM 8n1mT8nMp78iYJOhuE8nUhJ+8AsHgAetkz9n6mFzkzsZ7amkb+g/AVv9TF2MEyrULyXw Xr1A== 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 d30-v6si15520048pla.200.2018.09.17.05.59.02; Mon, 17 Sep 2018 05:59:18 -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 S1727864AbeIQSYp (ORCPT + 99 others); Mon, 17 Sep 2018 14:24:45 -0400 Received: from mga14.intel.com ([192.55.52.115]:20909 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbeIQSYp (ORCPT ); Mon, 17 Sep 2018 14:24:45 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2018 05:57:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,385,1531810800"; d="scan'208";a="71462897" Received: from yisun1-ubuntu.bj.intel.com (HELO localhost) ([10.238.156.104]) by fmsmga008.fm.intel.com with ESMTP; 17 Sep 2018 05:57:25 -0700 Date: Mon, 17 Sep 2018 20:54:52 +0800 From: Yi Sun To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, x86@kernel.org, chao.p.peng@intel.com, chao.gao@intel.com, isaku.yamahata@intel.com, michael.h.kelly@microsoft.com, tianyu.lan@microsoft.com, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger Subject: Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Message-ID: <20180917125452.GC11769@yi.y.sun> References: <1536830005-37260-1-git-send-email-yi.y.sun@linux.intel.com> <1536830005-37260-3-git-send-email-yi.y.sun@linux.intel.com> <20180914090440.GB11769@yi.y.sun> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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-09-14 12:42:33, Thomas Gleixner wrote: > On Fri, 14 Sep 2018, Yi Sun wrote: > > > > +static void hv_notify_long_spin_wait(void) > > > > +{ > > > > + u64 input = spin_wait_info | 0x00000000ffffffff; > > > > > > What? The result is always 0x00000000ffffffff ..... > > > > > Oh, sorry for such error. > > > > > > + spin_wait_info++; > > > > + hv_do_fast_hypercall8(HVCALL_NOTIFY_LONG_SPIN_WAIT, input); > > > > +} > > > > + > > > > +static void hv_qlock_kick(int cpu) > > > > +{ > > > > + spin_wait_info--; > > > > > > Looking at the above this is completely pointless and I have no idea what > > > that variable is supposed to do. > > > > > Per Microsoft Hypervisor Top Level Functional Specification, the input > > parameter of HVCALL_NOTIFY_LONG_SPIN_WAIT is defined as below: > > > > SpinwaitInfo – Specifies the accumulated count the guest was spinning. > > > > So, it is increased when guest is spinning and reduced when spinlock is > > released. > > But that's a global variable, so it might be incremented and decremented by > several CPUs at once. I don't have the spec and have no time to study it > either, but global does not make any sense to me. The spin wait info comes > from a single guest CPU and the wakeup is targeted at that guest CPU as > well. So why global? It might be defined that way, but then you really want > to explain it proper. > > Thanks, > > tglx > Let me check this more. Will reply to you later. Thanks! BRs, Yi Sun