login
Header Space

 
 

[PATCH 11/12] cpumask: reduce stack usage in SD_x_INIT initializers

Previous thread: [PATCH 05/12] x86: use new set_cpus_allowed_ptr function by Mike Travis on Friday, April 4, 2008 - 9:11 pm. (1 message)

Next thread: [PATCH 10/12] nodemask: use new node_to_cpumask_ptr function by Mike Travis on Friday, April 4, 2008 - 9:11 pm. (1 message)
To: Ingo Molnar <mingo@...>
Cc: Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>, Andrew Morton <akpm@...>, <linux-kernel@...>
Date: Friday, April 4, 2008 - 9:11 pm

* Remove empty cpumask_t (and all non-zero/non-null) variables
    in SD_*_INIT macros.  Use memset(0) to clear.  Also, don't
    inline the initializer functions to save on stack space in
    build_sched_domains().

  * Merge change to include/linux/topology.h that uses the new
    node_to_cpumask_ptr function in the nr_cpus_node macro into
    this patch.

Depends on:
	[mm-patch]: asm-generic-add-node_to_cpumask_ptr-macro.patch
	[sched-devel]: sched: add new set_cpus_allowed_ptr function

Based on:
	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
    +   x86/latest          .../x86/linux-2.6-x86.git
    +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;

Signed-off-by: Mike Travis &lt;travis@sgi.com&gt;
---
 include/asm-x86/topology.h |    5 
 include/linux/topology.h   |   46 -----
 kernel/sched.c             |  368 ++++++++++++++++++++++++++++++---------------
 3 files changed, 256 insertions(+), 163 deletions(-)

--- linux-2.6.x86.orig/include/asm-x86/topology.h
+++ linux-2.6.x86/include/asm-x86/topology.h
@@ -155,10 +155,6 @@ extern unsigned long node_remap_size[];
 
 /* sched_domains SD_NODE_INIT for NUMAQ machines */
 #define SD_NODE_INIT (struct sched_domain) {		\
-	.span			= CPU_MASK_NONE,	\
-	.parent			= NULL,			\
-	.child			= NULL,			\
-	.groups			= NULL,			\
 	.min_interval		= 8,			\
 	.max_interval		= 32,			\
 	.busy_factor		= 32,			\
@@ -176,7 +172,6 @@ extern unsigned long node_remap_size[];
 				| SD_WAKE_BALANCE,	\
 	.last_balance		= jiffies,		\
 	.balance_interval	= 1,			\
-	.nr_balance_failed	= 0,			\
 }
 
 #ifdef CONFIG_X86_64_ACPI_NUMA
--- linux-2.6.x86.orig/include/linux/topology.h
+++ linux-2.6.x86/include/linux/topology.h
@@ -38,16 +38,15 @@
 #endif
 
 #ifndef nr_cpus_node
-#define nr_cpus_node(node)							\
-	({									\
-		cpumask_t __tmp__;						\
-		__tmp__ = node_to_cp...
Previous thread: [PATCH 05/12] x86: use new set_cpus_allowed_ptr function by Mike Travis on Friday, April 4, 2008 - 9:11 pm. (1 message)

Next thread: [PATCH 10/12] nodemask: use new node_to_cpumask_ptr function by Mike Travis on Friday, April 4, 2008 - 9:11 pm. (1 message)
speck-geostationary