Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp611503imm; Fri, 14 Sep 2018 03:43:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaNi/leAxiFgNcMrkoPIhe+4tlpb1z7tR2Rb3taHcfBDGGbkur60G1bJJ0//pxYJ/8TPBKj X-Received: by 2002:a62:4e56:: with SMTP id c83-v6mr12017321pfb.240.1536921835588; Fri, 14 Sep 2018 03:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536921835; cv=none; d=google.com; s=arc-20160816; b=c40NYJFJzQvaV/RdCQthaAhxQ8SJxGl9ezlcS0QljZUoCR6tCqq8KSIjonHwXmKsA1 Z36YnEfctZGnN/4Y5v+SplSfvdnuhx0grvG0ZseVv8QaIhsCtP4hiUtWHTjy7FFNN7MY 2XTsEBQDZnNel6BedzNMhwhtAISzFwoaj4KaBc2FFRpYiKmyg5j63WrfB+amyK+mNk0G waQJLrf7KuE25bu0v9AUxc9q8cFixhSA3b/TvYPyIjkFe0Ae40lV2kLcEaghpnIITOZb GpuGZQrs68nyIfW3UDGOUaCePNMKATQusR09nHABSKk6nvC80V+Y1t9YLdYQF1AwkXvw Bvmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date; bh=6ijNxFeDBlYqfzwN7awbA0aFwYM25Pf0VLUDnn9g/LU=; b=H/NRDuYJk/d8SjcTRF4okgjEfnDa+v57GDtAg+cJbGbIkYArY26nIO7J8BADATBx/Q cmhPl/vGLgjWUXfsXqWjyM9aSd++pVRmpZs4i2g+PFs+jedHcdaydAMTmEZwXwWp5YYj jxyYvB5gVRkZNzWPcKsax77GFHCBG/T635qhrBAO+UXJcUFev2M1GwWrCP3KQ5bxBSrl sGzpddoNMFkFQ0AfCAMG00mKFqf0tAa6DUA2BGqf08g73ZUjHPkBcDq4cynC0IEKZ+Ll wayk0HC6dgQ9rlIY6n3fpFbyQD+wxjZPGjD2utOax5sV4wTqbhgkodMN7d95YjP8jsow cWrA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si6817917pgm.209.2018.09.14.03.43.39; Fri, 14 Sep 2018 03:43:55 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728219AbeINP4e (ORCPT + 99 others); Fri, 14 Sep 2018 11:56:34 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:47476 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727655AbeINP4e (ORCPT ); Fri, 14 Sep 2018 11:56:34 -0400 Received: from p4fea45ac.dip0.t-ipconnect.de ([79.234.69.172] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g0lYY-0002LJ-Do; Fri, 14 Sep 2018 12:42:34 +0200 Date: Fri, 14 Sep 2018 12:42:33 +0200 (CEST) From: Thomas Gleixner To: Yi Sun 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 In-Reply-To: <20180914090440.GB11769@yi.y.sun> Message-ID: 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> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-176408337-1536921492=:1473" Content-ID: X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-176408337-1536921492=:1473 Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: 8BIT Content-ID: 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 --8323329-176408337-1536921492=:1473--