linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yi Sun <yi.y.sun@linux.intel.com>
To: "Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"chao.p.peng@intel.com" <chao.p.peng@intel.com>,
	"chao.gao@intel.com" <chao.gao@intel.com>,
	"isaku.yamahata@intel.com" <isaku.yamahata@intel.com>,
	Tianyu Lan <Tianyu.Lan@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V
Date: Tue, 25 Sep 2018 15:11:43 +0800	[thread overview]
Message-ID: <20180925071143.GF11769@yi.y.sun> (raw)
In-Reply-To: <CY4PR21MB0773F63A6367C5C1CE26F5ADDC120@CY4PR21MB0773.namprd21.prod.outlook.com>

On 18-09-21 17:02:54, Michael Kelley (EOSG) wrote:
> From: Yi Sun <yi.y.sun@linux.intel.com> Sent: Friday, September 21, 2018 12:25 AM
> > +
> > +#define pr_fmt(fmt) "hv: " fmt
> 
> Other Hyper-V messages use "Hyper-V: " as the prefix, not "hv: ".  Take
> a quick look at 'dmesg' output for reference.
> 
Will modify this. Thanks!

> > +
> > +#include <linux/kernel_stat.h>
> > +#include <linux/spinlock.h>
> > +#include <linux/debugfs.h>
> > +#include <linux/log2.h>
> > +#include <linux/gfp.h>
> 
> Some of these #includes look like they might be leftovers from
> some other code.  Please check and see whether kernel_stat.h,
> debugsfs.h, log2.h, and gfp.h are actually needed.
> 
Sure, I will check them.

> > +static void hv_qlock_wait(u8 *byte, u8 val)
> > +{
> > +	unsigned long msr_val;
> > +
> > +	if (READ_ONCE(*byte) != val)
> > +		return;
> > +
> > +	/*
> > +	 * Read HV_X64_MSR_GUEST_IDLE MSR can trigger the guest's
> > +	 * transition to the idle power state which can be exited
> > +	 * by an IPI even if IF flag is disabled.
> > +	 */
> > +	if (ms_hyperv.features & HV_X64_MSR_GUEST_IDLE_AVAILABLE)
> 
> I can't see a case where this test is actually needed.  hv_qlock_wait()
> can only get called if the flag is set when hv_init_spinlocks() is run, and
> the flag value doesn't change after it is set.
> 
Yes, it is redundant. Will remove it.

> > +		rdmsrl(HV_X64_MSR_GUEST_IDLE, msr_val);
> > +}
> 
> Michael

  reply	other threads:[~2018-09-25  7:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21  7:25 [PATCH v2 0/2] Enable PV qspinlock for Hyper-V Yi Sun
2018-09-21  7:25 ` [PATCH v2 1/2] X86/Hyper-V: Add Guest IDLE MSR support Yi Sun
2018-09-21 16:52   ` Michael Kelley (EOSG)
2018-09-21  7:25 ` [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Yi Sun
2018-09-21 17:02   ` Michael Kelley (EOSG)
2018-09-25  7:11     ` Yi Sun [this message]
2018-09-21 19:09   ` kbuild test robot
2018-09-26  2:15   ` kbuild test robot
2018-09-26  8:23   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180925071143.GF11769@yi.y.sun \
    --to=yi.y.sun@linux.intel.com \
    --cc=Michael.H.Kelley@microsoft.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=chao.gao@intel.com \
    --cc=chao.p.peng@intel.com \
    --cc=haiyangz@microsoft.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).