From: Tang Chen <tangchen@cn.fujitsu.com>
To: Borislav Petkov <bp@amd64.org>
Cc: tony.luck@intel.com, tglx@linutronix.de, mingo@redhat.com,
hpa@zytor.com, miaox@cn.fujitsu.com, laijs@cn.fujitsu.com,
wency@cn.fujitsu.com, x86@kernel.org, linux-edac@vger.kernel.org,
linux-kernel@vger.kernel.org, Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH v2 1/2] Replace if statement with WARN_ON_ONCE() in cmci_rediscover().
Date: Mon, 22 Oct 2012 10:10:24 +0800 [thread overview]
Message-ID: <5084AB10.7010807@cn.fujitsu.com> (raw)
In-Reply-To: <20121019164045.GE11958@aftab.osrc.amd.com>
On 10/20/2012 12:40 AM, Borislav Petkov wrote:
> On Fri, Oct 19, 2012 at 01:45:27PM +0800, Tang Chen wrote:
>> cmci_rediscover() is only called by the CPU_POST_DEAD event handler,
>> which means the corresponding cpu has already dead. As a result, it
>> won't be accessed in the for_each_online_cpu loop.
>> So, we could change the if(cpu == dying) statement into a WARN_ON_ONCE().
>>
>> Signed-off-by: Tang Chen<tangchen@cn.fujitsu.com>
>> ---
>> arch/x86/kernel/cpu/mcheck/mce_intel.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c
>> index 38e49bc..481d152 100644
>> --- a/arch/x86/kernel/cpu/mcheck/mce_intel.c
>> +++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c
>> @@ -180,8 +180,8 @@ void cmci_rediscover(int dying)
>> cpumask_copy(old,¤t->cpus_allowed);
>>
>> for_each_online_cpu(cpu) {
>> - if (cpu == dying)
>> - continue;
>> + WARN_ON_ONCE(cpu == dying);
>
> Ok, I don't understand that:
>
> we want to warn that the rediscovering is happening on a dying cpu?? And
> before that, we simply jumped over it and didn't do the rediscovering
> there? Why should we warn at all?
Hi Borislav,
As far as I know, cmci_rediscover() is only called in
mce_cpu_callback() to handle CPU_POST_DEAD event.
2362 if (action == CPU_POST_DEAD) {
2363 /* intentionally ignoring frozen here */
2364 cmci_rediscover(cpu);
2365 }
I didn't find anywhere else using this function. So I think the cpu
should be dead already when this function is called.
I don't why before we just jumped over it. But I think if we have an
online cpu == dying here, it must be wrong. So I think we should warn
it, not just jump over it.
Thanks. :)
>
> Huh?
>
next prev parent reply other threads:[~2012-10-22 2:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-19 5:45 [PATCH v2 0/2] Do not change worker's running cpu in cmci_rediscover() Tang Chen
2012-10-19 5:45 ` [PATCH v2 1/2] Replace if statement with WARN_ON_ONCE() " Tang Chen
2012-10-19 14:07 ` Greg KH
2012-10-19 16:40 ` Borislav Petkov
2012-10-22 2:10 ` Tang Chen [this message]
2012-10-22 10:14 ` Borislav Petkov
2012-10-23 1:35 ` Tang Chen
2012-10-23 2:55 ` Tang Chen
2012-10-23 9:52 ` Borislav Petkov
2012-10-23 10:17 ` Miao Xie
2012-10-23 10:20 ` Borislav Petkov
2012-10-23 10:34 ` Miao Xie
2012-10-23 13:14 ` Borislav Petkov
2012-10-23 11:30 ` Tang Chen
2012-10-23 14:17 ` Borislav Petkov
2012-10-23 16:16 ` Luck, Tony
2012-10-24 1:31 ` Tang Chen
2012-10-19 5:45 ` [PATCH v2 2/2] Do not change worker's running cpu " Tang Chen
2012-10-19 16:42 ` Borislav Petkov
2012-10-19 17:21 ` Luck, Tony
2012-10-22 3:33 ` Tang Chen
2012-10-22 10:18 ` Borislav Petkov
2012-10-23 1:30 ` Tang Chen
2012-10-19 7:21 ` [PATCH v2 0/2] " Tang Chen
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=5084AB10.7010807@cn.fujitsu.com \
--to=tangchen@cn.fujitsu.com \
--cc=bp@alien8.de \
--cc=bp@amd64.org \
--cc=hpa@zytor.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaox@cn.fujitsu.com \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=wency@cn.fujitsu.com \
--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).