linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Kelley <mikelley@microsoft.com>
To: Dexuan Cui <decui@microsoft.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	vkuznets <vkuznets@redhat.com>, KY Srinivasan <kys@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"sashal@kernel.org" <sashal@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"will@kernel.org" <will@kernel.org>,
	"Ganapatrao.Kulkarni@cavium.com" <Ganapatrao.Kulkarni@cavium.com>,
	"james.morse@arm.com" <james.morse@arm.com>,
	"steven.price@arm.com" <steven.price@arm.com>,
	"josephl@nvidia.com" <josephl@nvidia.com>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Subject: RE: [PATCH v2 1/1] x86/hyperv: Initialize clockevents earlier in CPU onlining
Date: Mon, 18 Nov 2019 01:23:15 +0000	[thread overview]
Message-ID: <CY4PR21MB062904EB8E4B90192E893750D74D0@CY4PR21MB0629.namprd21.prod.outlook.com> (raw)
In-Reply-To: <PU1P153MB0169807BF9CE60FC3CA51B31BF700@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM>

From: Dexuan Cui <decui@microsoft.com>  Sent: Thursday, November 14, 2019 10:49 PM
> > From: Michael Kelley <mikelley@microsoft.com>
> > Sent: Tuesday, November 12, 2019 5:12 PM
> > ...
> > @@ -190,14 +278,20 @@ void hv_stimer_free(void)
> >  void hv_stimer_global_cleanup(void)
> >  {
> >  	int	cpu;
> >  ...
> > +	/*
> > +	 * hv_stime_legacy_cleanup() will stop the stimer if Direct
> > +	 * Mode is not enabled, and fallback to the LAPIC timer.
> > +	 */
> > +	for_each_present_cpu(cpu) {
> > +		hv_stimer_legacy_cleanup(cpu);
> >  	}
> > +
> > +	/*
> > +	 * If Direct Mode is enabled, the cpuhp teardown callback
> > +	 * (hv_stimer_cleanup) will be run on all CPUs to stop the
> > +	 * stimers.
> > +	 */
> >  	hv_stimer_free();
> >  }
> 
> In the case of direct_mode_enabled == true: When hv_vmbus unloads,
> vmbus_exit() -> hv_stimer_global_cleanup() -> hv_stimer_free() ->
> cpuhp_remove_state() disables the direct mode timers.
> 
> This does not look symmetric since hv_stimer_alloc() is called before
> hv_vmbus loads, but I suppose this is not a real issue because hv_vmbus
> should never unload in practice. :-)

Thanks for the review.  Looking at this a bit more, ideally
hv_stimer_global_cleanup() should go away entirely.  vmbus_exit() should
let the call to cpuhp_remove_state() clean up the stimer on each CPU via 
hv_synic_cleanup().   But vmbus_exit() shuts down the VMbus first, which
is really the wrong order.

As you say, vmbus_exit() never gets called in practice, so it's not a
current issue.  But I'll look at fixing this in a future patch so that it
makes logical sense.

Michael

> 
> Tested-by: Dexuan Cui <decui@microsoft.com>
> Reviewed-by: Dexuan Cui <decui@microsoft.com>


  reply	other threads:[~2019-11-18  1:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13  1:11 [PATCH v2 1/1] x86/hyperv: Initialize clockevents earlier in CPU onlining Michael Kelley
2019-11-15  6:48 ` Dexuan Cui
2019-11-18  1:23   ` Michael Kelley [this message]
2019-11-15  9:37 ` [tip: x86/hyperv] " tip-bot2 for Michael Kelley

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=CY4PR21MB062904EB8E4B90192E893750D74D0@CY4PR21MB0629.namprd21.prod.outlook.com \
    --to=mikelley@microsoft.com \
    --cc=Ganapatrao.Kulkarni@cavium.com \
    --cc=bp@alien8.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=decui@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=josephl@nvidia.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mingo@redhat.com \
    --cc=sashal@kernel.org \
    --cc=steven.price@arm.com \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=will@kernel.org \
    --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).