linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: zhouchengming <zhouchengming1@huawei.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>, x86 <x86@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	"Liang, Kan" <kan.liang@intel.com>,
	David Carrillo Cisneros <davidcc@google.com>,
	dave.hansen@linux.intel.com, qiaonuohan@huawei.com,
	guohanjun@huawei.com
Subject: Re: [PATCH] fix race caused by hyperthreads when online an offline cpu
Date: Mon, 16 Jan 2017 10:36:14 -0800	[thread overview]
Message-ID: <CABPqkBSTcr7F7Y1hVOtm-34WLwjdv_PwsZseyFQBEfumcBpThw@mail.gmail.com> (raw)
In-Reply-To: <587C980C.3090300@huawei.com>

On Mon, Jan 16, 2017 at 1:53 AM, zhouchengming
<zhouchengming1@huawei.com> wrote:
> On 2017/1/16 17:05, Thomas Gleixner wrote:
>>
>> On Mon, 16 Jan 2017, Zhou Chengming wrote:
>>
>> Can you please stop sending the same patch over and over every other day?
>>
>> Granted, things get forgotten, but sending a polite reminder after a week
>> is definitely enough.
>>
>> Maintainers are not machines responding within a split second on every
>> mail
>> they get. And that patch is not so substantial that it justifies that kind
>> of spam.
>>
>
> Very sorry for the noise. We are just not sure this is the right fix because
> it's
> hard to reproduce.
>
I believe this is the right fixed. I tried it and instrumented the
code to verify thread_id
assignment. The problem is easy to reproduce.

$ echo 0 >/sys/devices/system/cpu/cpu2/online
$ echo 1 >/sys/devices/system/cpu/cpu2/online

Normally on Haswell Desktop part,  CPU2 gets thread_id 0 on boot, CPU6
gets thread_id 1.
If you offline CPU2 and bring it back in, it will get thread_id 1 and
thus both sibling will point
to the same exclusive state. The fix is, indeed, to check if the
sibling is not already assigned 1,
and if so to keep 0 for the CPU being online'd.

  reply	other threads:[~2017-01-16 18:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16  3:21 [PATCH] fix race caused by hyperthreads when online an offline cpu Zhou Chengming
2017-01-16  9:05 ` Thomas Gleixner
2017-01-16  9:53   ` zhouchengming
2017-01-16 18:36     ` Stephane Eranian [this message]
2017-01-17 10:05       ` Thomas Gleixner
2017-01-17 10:12 ` [tip:perf/urgent] perf/x86/intel: Handle exclusive threadid correctly on CPU hotplug tip-bot for Zhou Chengming
  -- strict thread matches above, loose matches on Subject: below --
2017-01-14 11:21 [PATCH] fix race caused by hyperthreads when online an offline cpu Zhou Chengming
2017-01-12  9:32 Zhou Chengming
2017-01-14  1:33 ` qiaonuohan

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=CABPqkBSTcr7F7Y1hVOtm-34WLwjdv_PwsZseyFQBEfumcBpThw@mail.gmail.com \
    --to=eranian@google.com \
    --cc=ak@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=davidcc@google.com \
    --cc=guohanjun@huawei.com \
    --cc=hpa@zytor.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qiaonuohan@huawei.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=zhouchengming1@huawei.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).