linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com,
	mingo@elte.hu, tglx@linutronix.de,
	"Paul E. McKenney" <paulmck@us.ibm.com>
Subject: Re: [PATCH -tip] x86,trace: Add rcu_irq_enter/exit() in smp_trace_reschedule_interrupt()
Date: Fri, 28 Jun 2013 17:19:06 +0200	[thread overview]
Message-ID: <20130628151906.GE6626@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1372429303.18733.325.camel@gandalf.local.home>

On Fri, Jun 28, 2013 at 10:21:43AM -0400, Steven Rostedt wrote:
> [ Added Peter Z. and Paul ]
> >  void smp_trace_reschedule_interrupt(struct pt_regs *regs)
> >  {
> >  	ack_APIC_irq();
> > +	rcu_irq_enter();
> >  	trace_reschedule_entry(RESCHEDULE_VECTOR);
> >  	__smp_reschedule_interrupt();
> >  	trace_reschedule_exit(RESCHEDULE_VECTOR);
> > +	rcu_irq_exit();
> 
> The question is, should we add normal irq_enter/exit here? As that
> should be OK to nest. There's a comment in scheduler_ipi():
> 
> 	/*
> 	 * Not all reschedule IPI handlers call irq_enter/irq_exit, since
> 	 * traditionally all their work was done from the interrupt return
> 	 * path. Now that we actually do some work, we need to make sure
> 	 * we do call them.
> 	 *
> 	 * Some archs already do call them, luckily irq_enter/exit nest
> 	 * properly.
> 	 *
> 	 * Arguably we should visit all archs and update all handlers,
> 	 * however a fair share of IPIs are still resched only so this would
> 	 * somewhat pessimize the simple resched case.
> 	 */
> 
> just before it calls irq_enter(). Seems that not calling irq_enter() for
> the reschedule ipi interrupt is more of a legacy thing. It also states
> that its OK for an arch to call irq_enter() before calling this as it
> can nest. I wonder if we should invest time in fixing all archs and
> remove this irq_enter? But that's out of scope for this change.

That comment also states why I never did the arch sweep; doing
irq_enter()/irq_exit() for the pure empty reschedule interrupt makes it
more expensive.

Back when I introduced scheduler_ipi() I measured the amount of pure
resched interrupts (no schedule_ipi() content, pure interrupt return
path work) vs actually doing something in schedule_ipi() and found a
significant number of interrupts were 'pure'.

Things might have changed; but you'd better remeasure if you want to go
sweep the arch tree.

  parent reply	other threads:[~2013-06-28 15:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 20:21 [PATCH -tip] x86,trace: Add rcu_irq_enter/exit() in smp_trace_reschedule_interrupt() Seiji Aguchi
2013-06-28 14:01 ` Seiji Aguchi
2013-06-28 14:21 ` Steven Rostedt
2013-06-28 15:13   ` Seiji Aguchi
2013-06-28 15:36     ` Steven Rostedt
2013-06-28 15:48       ` Seiji Aguchi
2013-06-28 15:19   ` Peter Zijlstra [this message]
2013-06-28 15:37     ` Steven Rostedt

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=20130628151906.GE6626@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@us.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=seiji.aguchi@hds.com \
    --cc=tglx@linutronix.de \
    --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).