Skip to content

Commit f6cd247

Browse files
Eric DumazetKAGA-KOKO
authored andcommitted
irq: Better struct irqaction layout
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 <[email protected]> Reviewed-by: Andi Kleen <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <1288865628.2659.69.camel@edumazet-laptop> Signed-off-by: Thomas Gleixner <[email protected]>
1 parent 814ce25 commit f6cd247

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/linux/interrupt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
114114
struct irqaction {
115115
irq_handler_t handler;
116116
unsigned long flags;
117-
const char *name;
118117
void *dev_id;
119118
struct irqaction *next;
120119
int irq;
121-
struct proc_dir_entry *dir;
122120
irq_handler_t thread_fn;
123121
struct task_struct *thread;
124122
unsigned long thread_flags;
125-
};
123+
const char *name;
124+
struct proc_dir_entry *dir;
125+
} ____cacheline_internodealigned_in_smp;
126126

127127
extern irqreturn_t no_action(int cpl, void *dev_id);
128128

0 commit comments

Comments
 (0)