[lkml]   [2010]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH] x86-64: software IRQ masking and handling

On 07/12/2010 03:18 AM, Linus Torvalds wrote:
> On Sun, Jul 11, 2010 at 3:03 PM, Steven Rostedt <> 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.



 \ /
  Last update: 2010-07-12 09:45    [W:0.031 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site