mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Huang Ying <ying.huang@intel.com>
Subject: Re: x86: Inconsistent xAPIC synchronization in arch_irq_work_raise?
Date: Tue, 21 Jan 2014 15:51:05 +0100	[thread overview]
Message-ID: <20140121145105.GE3694@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20140121140113.GL30183@twins.programming.kicks-ass.net>

On Tue, Jan 21, 2014 at 03:01:13PM +0100, Peter Zijlstra wrote:
> On Tue, Jan 21, 2014 at 02:02:06PM +0100, Jan Kiszka wrote:
> > Hi all,
> > 
> > while trying to plug a race in the CPU hotplug code on xAPIC systems, I
> > was analyzing IPI transmission patterns. The handlers in
> > arch/x86/include/asm/ipi.h first wait for ICR, then send. In contrast,
> > arch_irq_work_raise sends the self-IPI directly and then waits. This
> > looks inconsistent. Is it intended?
> > 
> > BTW, the races are in wakeup_secondary_cpu_via_init and
> > wakeup_secondary_cpu_via_nmi (lacking IRQ disable around ICR accesses).
> > There we also send first, then wait for completion. But I guess that is
> > due to the code originally only being used during boot. Will send fixes
> > for those once the sync pattern is clear to me.
> 
> Could be I had no clue what I was doing and copy/pasted the code until
> it compiled and ran.
> 
> In fact, I've got no clue what an ICR is.

I dug about a bit, I borrowed that code from:

lkml.kernel.org/r/1277348698-17311-3-git-send-email-ying.huang@intel.com

Huang Ying, can you explain to Jan why you do the wait afterwards?

  parent reply	other threads:[~2014-01-21 14:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 13:02 Jan Kiszka
2014-01-21 14:01 ` Peter Zijlstra
2014-01-21 14:10   ` Ingo Molnar
2014-01-21 14:11   ` Jan Kiszka
2014-01-21 14:34     ` Jan Kiszka
2014-01-21 14:51   ` Peter Zijlstra [this message]
2014-01-21 23:20     ` Huang Ying
2014-01-22 18:43       ` Andi Kleen
2014-01-23 18:51         ` Jan Kiszka
2014-01-23 19:11           ` Peter Zijlstra
2014-01-23 19:22           ` Andi Kleen
2014-01-23 19:51             ` Jan Kiszka
2014-01-23 20:17               ` Andi Kleen

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=20140121145105.GE3694@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jan.kiszka@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=ying.huang@intel.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

Powered by JetHome