lkml.org 
[lkml]   [2010]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [10/23] SCHED: Only allocate per cpu cpu mask buffer with offstack cpumasks
Date

This will save a few bytes in the non offstack cpumask case.

Found by gcc 4.6's new warnings.

Cc: peterz@infradead.org
Cc: mingo@elte.hu
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
kernel/sched.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6.35-rc2-gcc/kernel/sched.c
===================================================================
--- linux-2.6.35-rc2-gcc.orig/kernel/sched.c
+++ linux-2.6.35-rc2-gcc/kernel/sched.c
@@ -7482,7 +7482,7 @@ static void init_tg_rt_entry(struct task
void __init sched_init(void)
{
int i, j;
- unsigned long alloc_size = 0, ptr;
+ unsigned long alloc_size = 0;

#ifdef CONFIG_FAIR_GROUP_SCHED
alloc_size += 2 * nr_cpu_ids * sizeof(void **);
@@ -7494,7 +7494,10 @@ void __init sched_init(void)
alloc_size += num_possible_cpus() * cpumask_size();
#endif
if (alloc_size) {
+#ifdef CONFIG_CPUMASK_OFFSTACK
+ unsigned long ptr;
ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT);
+#endif

#ifdef CONFIG_FAIR_GROUP_SCHED
init_task_group.se = (struct sched_entity **)ptr;

\
 
 \ /
  Last update: 2010-06-10 13:13    [W:0.304 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site