* [PATCH] irq: better struct irqaction layout
@ 2010-11-04 10:13 Eric Dumazet
2010-11-04 14:35 ` Andi Kleen
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2010-11-04 10:13 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Thomas Gleixner, linux-kernel, Andi Kleen, Peter Zijlstra
We currently use kmalloc-96 slab for struct irqaction allocations on
64bit arches.
This is unfortunate because of possible false sharing and two cache
lines accesses.
Move 'name' and 'dir' fields at the end of the structure, and force a
suitable alignement.
Hot path fields now use one cache line on x86_64.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Peter Zijlstra <peterz@infradead.org>
---
include/linux/interrupt.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 79d0c4f..55e0d42 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -114,15 +114,15 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
struct irqaction {
irq_handler_t handler;
unsigned long flags;
- const char *name;
void *dev_id;
struct irqaction *next;
int irq;
- struct proc_dir_entry *dir;
irq_handler_t thread_fn;
struct task_struct *thread;
unsigned long thread_flags;
-};
+ const char *name;
+ struct proc_dir_entry *dir;
+} ____cacheline_internodealigned_in_smp;
extern irqreturn_t no_action(int cpl, void *dev_id);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] irq: better struct irqaction layout
2010-11-04 10:13 [PATCH] irq: better struct irqaction layout Eric Dumazet
@ 2010-11-04 14:35 ` Andi Kleen
0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2010-11-04 14:35 UTC (permalink / raw)
To: Eric Dumazet
Cc: Ingo Molnar, Thomas Gleixner, linux-kernel, Andi Kleen, Peter Zijlstra
On Thu, Nov 04, 2010 at 11:13:48AM +0100, Eric Dumazet wrote:
> We currently use kmalloc-96 slab for struct irqaction allocations on
> 64bit arches.
>
> This is unfortunate because of possible false sharing and two cache
> lines accesses.
>
> Move 'name' and 'dir' fields at the end of the structure, and force a
> suitable alignement.
>
> Hot path fields now use one cache line on x86_64.
Looks good. It would be nice if some of the fields could be merged (like
thread_flags and flags), but I assume it would be tought to get it back
to 64 bytes again.
Reviewed-by: Andi Kleen <ak@linux.intel.com>
-Andi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-04 14:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-04 10:13 [PATCH] irq: better struct irqaction layout Eric Dumazet
2010-11-04 14:35 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®