lkml.org 
[lkml]   [2018]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V
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

\
 
 \ /
  Last update: 2018-09-25 09:15    [W:0.167 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site