[lkml]   [2007]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch 3/8] Immediate Values - Kconfig menu in EMBEDDED
Immediate values provide a way to use dynamic code patching to update variables
sitting within the instruction stream. It saves caches lines normally used by
static read mostly variables. Enable it by default, but let users disable it
through the EMBEDDED menu with the "Disable immediate values" submenu entry.

Signed-off-by: Mathieu Desnoyers <>
CC: Adrian Bunk <>
CC: Andi Kleen <>
CC: Alexey Dobriyan <>
CC: Christoph Hellwig <>
init/Kconfig | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

Index: linux-2.6-lttng/init/Kconfig
--- linux-2.6-lttng.orig/init/Kconfig 2007-09-04 11:53:59.000000000 -0400
+++ linux-2.6-lttng/init/Kconfig 2007-09-04 12:12:03.000000000 -0400
@@ -407,6 +407,17 @@ config CC_OPTIMIZE_FOR_SIZE
config SYSCTL

+ default y if !DISABLE_IMMEDIATE
+ depends on X86_32 || PPC || PPC64
+ bool
+ help
+ Immediate values are used as read mostly variables that are rarely
+ updated. They use code patching to modify the values inscribed in the
+ instruction stream. It provides a way to save precious cache lines
+ that would otherwise have to be used by these variables. Can be
+ disabled through the EMBEDDED menu.
menuconfig EMBEDDED
bool "Configure standard kernel features (for small systems)"
@@ -645,6 +656,16 @@ config PROC_KPAGEMAP
information on page-level memory usage. Disabling this interface
will reduce the size of the kernel by around 600 bytes.

+ default y if EMBEDDED
+ bool "Disable immediate values" if EMBEDDED
+ depends on X86_32 || PPC || PPC64
+ help
+ Disable code patching based immediate values for embedded systems. It
+ consumes slightly more memory and requires to modify the instruction
+ stream each time a variable is updated. Should really be disabled for
+ embedded systems with read-only text.
endmenu # General setup

Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-09-06 22:11    [W:0.118 / U:8.736 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site