mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.6.13-rc2] [RFD] Text section for "slow" code
Date: Sat, 9 Jul 2005 23:39:12 -0400	[thread overview]
Message-ID: <200507092341_MC3-1-A40A-8EA@compuserve.com> (raw)


I came up with this patch for moving slow code to its own section, but
some questions arose:

        1.  How to implement for each arch?

        2.  What name to use for the text section?

Patch for X86 and PPC follows, then a test patch for i386 to show it
boots and runs.


Index: 2.6.13-rc2a/arch/i386/kernel/vmlinux.lds.S
===================================================================
--- 2.6.13-rc2a.orig/arch/i386/kernel/vmlinux.lds.S
+++ 2.6.13-rc2a/arch/i386/kernel/vmlinux.lds.S
@@ -23,6 +23,7 @@
 	SCHED_TEXT
 	LOCK_TEXT
 	*(.fixup)
+	*(.slow.text)
 	*(.gnu.warning)
 	} = 0x9090
 
Index: 2.6.13-rc2a/arch/ppc/kernel/vmlinux.lds.S
===================================================================
--- 2.6.13-rc2a.orig/arch/ppc/kernel/vmlinux.lds.S
+++ 2.6.13-rc2a/arch/ppc/kernel/vmlinux.lds.S
@@ -34,6 +34,7 @@
     SCHED_TEXT
     LOCK_TEXT
     *(.fixup)
+    *(.slow.text)
     *(.got1)
     __got2_start = .;
     *(.got2)
Index: 2.6.13-rc2a/arch/ppc64/kernel/vmlinux.lds.S
===================================================================
--- 2.6.13-rc2a.orig/arch/ppc64/kernel/vmlinux.lds.S
+++ 2.6.13-rc2a/arch/ppc64/kernel/vmlinux.lds.S
@@ -16,6 +16,7 @@
 	SCHED_TEXT
 	LOCK_TEXT
 	*(.fixup)
+	*(.slow.text)
 	. = ALIGN(4096);
 	_etext = .;
 	}
Index: 2.6.13-rc2a/arch/x86_64/kernel/vmlinux.lds.S
===================================================================
--- 2.6.13-rc2a.orig/arch/x86_64/kernel/vmlinux.lds.S
+++ 2.6.13-rc2a/arch/x86_64/kernel/vmlinux.lds.S
@@ -22,6 +22,7 @@
 	SCHED_TEXT
 	LOCK_TEXT
 	*(.fixup)
+	*(.slow.text)
 	*(.gnu.warning)
 	} = 0x9090
   				/* out-of-line lock text */
Index: 2.6.13-rc2a/include/linux/compiler.h
===================================================================
--- 2.6.13-rc2a.orig/include/linux/compiler.h
+++ 2.6.13-rc2a/include/linux/compiler.h
@@ -48,6 +48,17 @@
 # error Sorry, your compiler is too old/not recognized.
 #endif
 
+/* Text section for code that is not speed-critical.
+ * Temporary hack includes arch-specific test in generic header.
+ */
+#if defined(CONFIG_X86) || defined(CONFIG_PPC)
+# define __slow		noinline __attribute__((__section__(".slow.text")))
+#endif
+
+#if !defined(__slow)
+# define __slow		noinline
+#endif
+
 /* Intel compiler defines __GNUC__. So we will overwrite implementations
  * coming from above header files here
  */

=======================================================================================

Test patch:

Index: 2.6.13-rc2a/arch/i386/kernel/irq.c
===================================================================
--- 2.6.13-rc2a.orig/arch/i386/kernel/irq.c
+++ 2.6.13-rc2a/arch/i386/kernel/irq.c
@@ -210,7 +210,7 @@
  * /proc/interrupts printing:
  */
 
-int show_interrupts(struct seq_file *p, void *v)
+int __slow show_interrupts(struct seq_file *p, void *v)
 {
 	int i = *(loff_t *) v, j;
 	struct irqaction * action;


--
Chuck

                 reply	other threads:[~2005-07-10  3:41 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=200507092341_MC3-1-A40A-8EA@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®