From: Fenghua Yu <fenghua.yu@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
"Ingo Molnar" <mingo@redhat.com>,
"Borislav Petkov" <bp@alien8.de>,
x86@kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arch/x86/kernel/cpu/umwait.c - remove unused variable
Date: Fri, 9 Aug 2019 08:30:57 -0700 [thread overview]
Message-ID: <20190809153056.GB56628@romley-ivt3.sc.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1908091147290.21433@nanos.tec.linutronix.de>
On Fri, Aug 09, 2019 at 11:49:49AM +0200, Thomas Gleixner wrote:
> On Thu, 8 Aug 2019, Fenghua Yu wrote:
> > On Thu, Aug 08, 2019 at 10:32:38PM +0200, Thomas Gleixner wrote:
> > > Valdis,
> > >
> > > On Thu, 8 Aug 2019, Valdis Klētnieks wrote:
> > > > On Thu, 08 Aug 2019 22:04:03 +0200, Thomas Gleixner said: It isn't
> > > > clear that whatever is doing the device_initcall()s will be able to
> > > > do any reasonable recovery if we return an error, so any error
> > > > recovery is going to have to happen before the function returns. It
> > > > might make sense to do an 'if (ret) return;' before going further in
> > > > the function, but given the comment a few lines further down about
> > > > ignoring errors, it was apparently considered more important to
> > > > struggle through and register stuff in sysfs even if umwait was
> > > > broken....
> > >
> > > I missed that when going through it.
> > >
> > > The right thing to do is to have a cpu_offline callback which clears
> > > the umwait MSR. That covers also the failure in the cpu hotplug setup.
> > > Then handling an error return makes sense and keeps everything in a
> > > workable shape.
> >
> > When cpu is offline, the MSR won't be used. We don't need to clear it, right?
>
> Groan. If soemthing goes wrong when registering the hotplug callback, what
> undoes the MSR setup which might have happened and what takes care of it on
> cpus coming online later? Exactly nothing. Then you have a non-consistent
> behaviour.
>
> Make stuff symmmetric and correct and not optimized for the sunshine case.
I see.
Just want to make sure I understand it correctly:
sysfs_create_group() should not be called if cpuhp_setup_state() has
error.
Otherwise, the sysadmin can change the MSR through the sysfs interface.
After that, a CPU is online and its MSR is not updated because cpu_online
is not installed. Then this online CPU has different MSR value from
the other CPUs.
Is that right?
Thanks.
-Fenghua
next prev parent reply other threads:[~2019-08-09 15:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 13:52 Valdis Klētnieks
2019-08-08 20:04 ` Thomas Gleixner
2019-08-08 20:24 ` Valdis Klētnieks
2019-08-08 20:32 ` Thomas Gleixner
2019-08-08 22:04 ` Valdis Klētnieks
2019-08-09 0:44 ` Fenghua Yu
2019-08-09 9:49 ` Thomas Gleixner
2019-08-09 15:30 ` Fenghua Yu [this message]
2019-08-09 19:37 ` 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=20190809153056.GB56628@romley-ivt3.sc.intel.com \
--to=fenghua.yu@intel.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=valdis.kletnieks@vt.edu \
--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
all inboxes | Powered by JetHome®