From: Tejun Heo <tj@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Rusty Russell <rusty@rustcorp.com.au>,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
the arch/x86 maintainers <x86@kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Christoph Lameter <cl@linux-foundation.org>,
Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [RFC PATCH] x86-64: software IRQ masking and handling
Date: Mon, 12 Jul 2010 09:41:41 +0200 [thread overview]
Message-ID: <4C3AC735.80806@kernel.org> (raw)
In-Reply-To: <AANLkTim5a4OxT518REsmNow-wo3T2qdkUORv876Adcqj@mail.gmail.com>
Hello,
On 07/12/2010 03:18 AM, Linus Torvalds wrote:
> On Sun, Jul 11, 2010 at 3:03 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
>>
>> I have seen some hits with cli-sti. I was considering swapping all
>> preempt_disable() with local_irq_save() in ftrace, but hackbench showed
>> a 30% performance degradation when I did that.
>
> Yeah, but in that case you almost certainly keep the per-cpu cacheline
> hot in the D$ L1 cache, and the stack tracer is presumably also not
> taking any extra I$ L1 misses. So you're not seeing any of the
> downsides. The upside of plain cli/sti is that they're small, and have
> no D$ footprint.
>
> And it's possible that the interrupt flag - at least if/when
> positioned right - wouldn't have any additional D$ footprint under
> normal load either. IOW, if there is an existing per-cpu cacheline
> that is effectively always already dirty and in the cache,
> But that's something that really needs macro-benchmarks - exactly
> because microbenchmarks don't show those effects since they are always
> basically hot-cache.
I think I can pack everything into the space irq_count occupies now.
16 bit for pending, and a byte for enable and count each.
> Also, the preempt code is pretty optimized and uses "add". Tejun uses
> "btrl" at least in some places, which is generally not a fast
> instruction. So there's a few caveats there too. Which is why I'd
> want numbers.
That can be replaced with bt + mov. I wasn't sure which would be
cheaper tho.
Thanks.
--
tejun
next prev parent reply other threads:[~2010-07-12 7:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-11 18:01 [RFC PATCH] x86-64: software IRQ masking and handling Tejun Heo
2010-07-11 19:26 ` Ingo Molnar
2010-07-11 20:29 ` Linus Torvalds
2010-07-11 22:03 ` Steven Rostedt
2010-07-12 1:18 ` Linus Torvalds
2010-07-12 5:11 ` Eric Dumazet
2010-07-12 8:02 ` Rusty Russell
2010-07-12 7:41 ` Tejun Heo [this message]
2010-07-12 2:19 ` Rusty Russell
2010-07-12 2:49 ` Linus Torvalds
2010-07-12 7:45 ` Tejun Heo
2010-07-12 7:35 ` Tejun Heo
2010-07-12 13:55 ` Christoph Lameter
2010-08-03 21:37 ` Jeremy Fitzhardinge
2010-08-04 2:09 ` Rusty Russell
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=4C3AC735.80806@kernel.org \
--to=tj@kernel.org \
--cc=cl@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--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