mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Chris Wedgwood <cw@f00f.org>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] -mm: hard/softirq_ctx __read_mostly (CONFIG_4KSTACKS)
Date: Thu, 20 Apr 2006 19:27:33 +0200	[thread overview]
Message-ID: <20060420172733.GA13852@rhlx01.fht-esslingen.de> (raw)

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?)

                 reply	other threads:[~2006-04-20 17:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060420172733.GA13852@rhlx01.fht-esslingen.de \
    --to=andi@rhlx01.fht-esslingen.de \
    --cc=akpm@osdl.org \
    --cc=cw@f00f.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®