All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: "tj@kernel.org" <tj@kernel.org>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	"rjw@sisk.pl" <rjw@sisk.pl>, "pavel@ucw.cz" <pavel@ucw.cz>,
	"len.brown@intel.com" <len.brown@intel.com>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"a.p.zijlstra@chello.nl" <a.p.zijlstra@chello.nl>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"suresh.b.siddha@intel.com" <suresh.b.siddha@intel.com>,
	"lucas.demarchi@profusion.mobi" <lucas.demarchi@profusion.mobi>,
	"rusty@rustcorp.com.au" <rusty@rustcorp.com.au>,
	"rdunlap@xenotime.net" <rdunlap@xenotime.net>,
	"vatsa@linux.vnet.ibm.com" <vatsa@linux.vnet.ibm.com>,
	"ashok.raj@intel.com" <ashok.raj@intel.com>,
	"tigran@aivazian.fsnet.co.uk" <tigran@aivazian.fsnet.co.uk>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v2 0/3] Freezer, CPU hotplug, x86 Microcode: Fix task freezing failures
Date: Mon, 10 Oct 2011 20:34:43 +0200	[thread overview]
Message-ID: <20111010183442.GC29415@aftab> (raw)
In-Reply-To: <20111010180848.GI8100@google.com>

Hi Tejun,

On Mon, Oct 10, 2011 at 02:08:48PM -0400, tj@kernel.org wrote:
> Maybe I'm confused but is that patch correct for actual CPU hotplug
> case?  If not, what's the point in doing that?  What are we gonna do
> after six month some people come up with "CPU hotplug fails to load
> new microcode for the new CPU"?

Ok, first of all, we still will load ucode on the onlining path - we're
simply not going to reload it when the CPU has gone offline and onlined
again. For that case people should simply reload the module so that
ucode on _all_ CPUs is updated pretty much at same time.

Now, actually, the ucode driver shouldn't even exist as it is - ucode
should be loaded much much earlier when the cores are being trampolined.
Normally, ucode is loaded by BIOS and I imagine this facility here
exists for the sole purpose to apply ucode only when there's no new BIOS
available.

So, here's what ucode handling should actually be, IMHO:

* load ucode very early during booting of each CPU

* keep ucode in memory in case not all cores have been onlined from the
get-go to apply when they're onlined later

* do NOT reapply it when cores are off-/onlined because there's no need
(cores retain ucode when we offline them (basically, they enter C1,
probably C3 on Intel or similar so no problem)).

* when you have new ucode image, trigger a replacement of the image in
memory and subsequently trigger a re-application of the new ucode (sysfs
write, whatever).

> The invalidation code is there for a reason.

... and that reason being?

> The CPU is going away and the microcode tied to the CPU should go away
> too.

This is what I don't understand - as I said earlier, ucode is not
something you get on a monthly basis: you get only a very few updates
and that's it in the majority of the cases. So users going the trouble
of reloading the microcode.ko module a very few times (if ever!) during
a system's lifetime shouldn't be an issue.

> If somebody is sure that microcode don't need to be changed once
> loaded, then all's good and dandy but that's not the case here, right?

Well, basically the current situation didn't change the ucode - it
simply reloaded the same image from before going offline.

See, there's this another problem with what we have right now: imagine
you've just updated the ucode image on disk and offline only a subset of
the cores. Then you online them again and they now get the newer ucode
image while the others still run the old ucode. This could explode or
could not, one thing's for sure: all bets are off. If we don't reload it
on hotplug, we're fine - only module reload triggers the ucode update in
a fairly synchronized manner.

> If you want to optimize away microcode unloading during
> suspend/resume, the RTTD is doing revalidation / reload during
> CPU_ONLINE as necessary.

see above.

> If this use case doesn't really matter too much to anyone, just
> leaving it alone would be better than adding band aid which can lead
> to very obscure issues down the road (oooh, that microcode shouldn't
> have been loaded to that cpu).

I'd like to actually hear someone justify such a requirement.

I hope I'm making some sense here.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

  reply	other threads:[~2011-10-10 18:34 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 12:31 [PATCH v2 0/3] Freezer, CPU hotplug, x86 Microcode: Fix task freezing failures Srivatsa S. Bhat
2011-10-10 12:32 ` [PATCH v2 1/3] Introduce helper functions Srivatsa S. Bhat
2011-10-10 12:33 ` [PATCH v2 2/3] Mutually exclude cpu online and suspend/hibernate Srivatsa S. Bhat
2011-10-10 12:45   ` Srivatsa S. Bhat
2011-10-10 14:26     ` Peter Zijlstra
2011-10-10 15:16       ` Srivatsa S. Bhat
2011-10-11 20:32         ` Srivatsa S. Bhat
2011-10-11 21:56           ` Rafael J. Wysocki
2011-10-12  3:57             ` Srivatsa S. Bhat
2011-10-12 19:31               ` Rafael J. Wysocki
2011-10-12 21:25                 ` Srivatsa S. Bhat
2011-10-12 22:09                   ` Rafael J. Wysocki
2011-10-13 15:42                     ` Srivatsa S. Bhat
2011-10-13 16:06                       ` Tejun Heo
2011-10-13 17:01                         ` Borislav Petkov
2011-10-13 17:29                           ` Srivatsa S. Bhat
2011-10-19 17:29                             ` Srivatsa S. Bhat
2011-10-13 18:03                           ` Alan Stern
2011-10-13 19:07                             ` Rafael J. Wysocki
2011-10-13 19:08                         ` Rafael J. Wysocki
2011-10-10 15:25       ` Alan Stern
2011-10-10 17:00     ` Tejun Heo
2011-10-11  9:18       ` Peter Zijlstra
2011-10-11  9:37         ` Srivatsa S. Bhat
2011-10-10 12:33 ` [PATCH v2 3/3] Update documentation Srivatsa S. Bhat
2011-10-10 15:23 ` [PATCH v2 0/3] Freezer, CPU hotplug, x86 Microcode: Fix task freezing failures Alan Stern
2011-10-10 15:32   ` Srivatsa S. Bhat
2011-10-10 16:53     ` Borislav Petkov
2011-10-10 17:14       ` Pavel Machek
2011-10-10 17:30       ` Srivatsa S. Bhat
2011-10-10 17:53         ` Borislav Petkov
2011-10-10 18:08           ` tj
2011-10-10 18:34             ` Borislav Petkov [this message]
2011-10-10 18:45               ` Srivatsa S. Bhat
2011-10-10 18:53               ` tj
2011-10-10 19:00                 ` Srivatsa S. Bhat
2011-10-10 20:35                   ` Borislav Petkov
     [not found]                 ` <20111010202913.GA30798@aftab>
2011-10-10 21:13                   ` tj
2011-10-11  9:17       ` Peter Zijlstra
2011-10-10 16:57   ` Tejun Heo

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=20111010183442.GC29415@aftab \
    --to=bp@amd64.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=ashok.raj@intel.com \
    --cc=hpa@zytor.com \
    --cc=len.brown@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=mingo@elte.hu \
    --cc=pavel@ucw.cz \
    --cc=rdunlap@xenotime.net \
    --cc=rjw@sisk.pl \
    --cc=rusty@rustcorp.com.au \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=stern@rowland.harvard.edu \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tigran@aivazian.fsnet.co.uk \
    --cc=tj@kernel.org \
    --cc=vatsa@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.