linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Yi Sun <yi.y.sun@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de,
	jgross@suse.com, 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" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [PATCH v4 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V
Date: Wed, 10 Oct 2018 07:50:26 +0200	[thread overview]
Message-ID: <20181010055026.GA17688@gmail.com> (raw)
In-Reply-To: <20181010022536.GH11769@yi.y.sun>


* Yi Sun <yi.y.sun@linux.intel.com> wrote:

> On 18-10-09 12:54:27, Ingo Molnar wrote:
> > 
> > * Yi Sun <yi.y.sun@linux.intel.com> wrote:
> > 
> > > Follow PV spinlock mechanism to implement the callback functions
> > > to allow the CPU idling and kicking operations on Hyper-V.
> > 
> > > +#if defined(CONFIG_SMP)
> > > +	smp_ops.smp_prepare_boot_cpu = hv_smp_prepare_boot_cpu;
> > > +#endif
> > 
> > What's wrong with using the common pattern of:
> > 
> > 	#ifdef CONFIG_SMP
> > 
> > ?
> 
> There is no difference between "#ifdef" and "#if defined". I just copied
> it from "hv_smp_prepare_boot_cpu()". Do you need me submit a fix patch
> after this set is merged?

It's equivalent code, my point was that '#ifdef CONFIG_XYZ' is the shorter, more canonical 
pattern we use in the kernel most of the time, it's shorter, easier to read. We only use 
defined() for longer preprocessor directive conditions, and it's a pattern for "there's 
something more complex here than a simple CONFIG_XYZ dependency".

Anyway, Thomas fixed it up in the latest iteration.

Thanks,

	Ingo

  reply	other threads:[~2018-10-10  5:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08  8:29 [PATCH v4 0/2] Enable PV qspinlock for Hyper-V Yi Sun
2018-10-08  8:29 ` [PATCH v4 1/2] X86/Hyper-V: Add Guest IDLE MSR support Yi Sun
2018-10-08  8:29 ` [PATCH v4 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Yi Sun
2018-10-08  9:15   ` Juergen Gross
2018-10-09  9:30   ` [tip:x86/hyperv] x86/hyperv: " tip-bot for Yi Sun
2018-10-09 10:54   ` [PATCH v4 2/2] locking/pvqspinlock, hv: " Ingo Molnar
2018-10-10  2:25     ` Yi Sun
2018-10-10  5:50       ` Ingo Molnar [this message]
2018-10-10  8:02         ` Yi Sun
2018-10-09 12:28   ` [tip:x86/paravirt] x86/hyperv: " tip-bot for Yi Sun

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=20181010055026.GA17688@gmail.com \
    --to=mingo@kernel.org \
    --cc=chao.gao@intel.com \
    --cc=chao.p.peng@intel.com \
    --cc=haiyangz@microsoft.com \
    --cc=isaku.yamahata@intel.com \
    --cc=jgross@suse.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.h.kelley@microsoft.com \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=tianyu.lan@microsoft.com \
    --cc=x86@kernel.org \
    --cc=yi.y.sun@linux.intel.com \
    /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).