mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] -mm: hard/softirq_ctx __read_mostly (CONFIG_4KSTACKS)
@ 2006-04-20 17:27 Andreas Mohr
  0 siblings, 0 replies; only message in thread
From: Andreas Mohr @ 2006-04-20 17:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Chris Wedgwood, Ingo Molnar, linux-kernel

Hello all,

the hardirq_ctx and softirq_ctx variables are written to on init only,
but in the final kernel image they may easily get linked together with other
often-written variables in the same cacheline, so put them into __read_mostly
section since they are in the highly critical IRQ path.

Patch compiled and tested on 2.6.17-rc1-mm3.
I did not test the powerpc part, though, for obvious reasons.

Signed-off-by: Andreas Mohr <andi@lisas.de>


--- linux-2.6.17-rc1-mm3.orig/arch/i386/kernel/irq.c	2006-04-18 11:46:04.000000000 +0200
+++ linux-2.6.17-rc1-mm3/arch/i386/kernel/irq.c	2006-04-20 18:33:14.000000000 +0200
@@ -42,8 +42,8 @@
 	u32                     stack[THREAD_SIZE/sizeof(u32)];
 };
 
-static union irq_ctx *hardirq_ctx[NR_CPUS];
-static union irq_ctx *softirq_ctx[NR_CPUS];
+static union irq_ctx *hardirq_ctx[NR_CPUS] __read_mostly;
+static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly;
 #endif
 
 /*
--- linux-2.6.17-rc1-mm3.orig/arch/powerpc/kernel/irq.c	2006-04-20 18:47:22.000000000 +0200
+++ linux-2.6.17-rc1-mm3/arch/powerpc/kernel/irq.c	2006-04-20 19:19:25.000000000 +0200
@@ -379,8 +379,8 @@
 #endif /* CONFIG_PPC64 */
 
 #ifdef CONFIG_IRQSTACKS
-struct thread_info *softirq_ctx[NR_CPUS];
-struct thread_info *hardirq_ctx[NR_CPUS];
+struct thread_info *softirq_ctx[NR_CPUS] __read_mostly;
+struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly;
 
 void irq_ctx_init(void)
 {



-- 
No programming skills!? Why not help translate many Linux applications! 
https://launchpad.ubuntu.com/rosetta
(or alternatively buy nicely packaged Linux distros/OSS software to help
support Linux developers creating shiny new things for you?)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-20 17:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-20 17:27 [PATCH] -mm: hard/softirq_ctx __read_mostly (CONFIG_4KSTACKS) Andreas Mohr

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®