public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: mingo@elte.hu, akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [10/23] SCHED: Only allocate per cpu cpu mask buffer with offstack cpumasks
Date: Thu, 10 Jun 2010 17:19:36 +0200	[thread overview]
Message-ID: <1276183176.2077.484.camel@twins> (raw)
In-Reply-To: <87fx0v3p1x.fsf@basil.nowhere.org>

On Thu, 2010-06-10 at 17:06 +0200, Andi Kleen wrote:
> +#if defined(CONFIG_CPUMASK_OFFSTACK) || defined(CONFIG_FAIR_GROUP_SCHED)

Still wrong.. something like the below might work, but I really think
its not worth the trouble.

---
 kernel/sched.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 19b3c5d..af40894 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7689,7 +7689,9 @@ static void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq,
 void __init sched_init(void)
 {
 	int i, j;
-	unsigned long alloc_size = 0, ptr;
+
+#if defined CONFIG_FAIR_GROUP_SCHED || defined CONFIG_RT_GROUP_SCHED || defined CONFIG_CPUMASK_OFFSTACK
+	unsigned long alloc_size = 0;
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
 	alloc_size += 2 * nr_cpu_ids * sizeof(void **);
@@ -7701,6 +7703,8 @@ void __init sched_init(void)
 	alloc_size += num_possible_cpus() * cpumask_size();
 #endif
 	if (alloc_size) {
+		unsigned long ptr;
+	       
 		ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT);
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
@@ -7726,6 +7730,7 @@ void __init sched_init(void)
 		}
 #endif /* CONFIG_CPUMASK_OFFSTACK */
 	}
+#endif /* {FAIR,RT}_GROUP,OFFSTACK */
 
 #ifdef CONFIG_SMP
 	init_defrootdomain();
@@ -7762,7 +7767,6 @@ void __init sched_init(void)
 #ifdef CONFIG_FAIR_GROUP_SCHED
 		init_task_group.shares = init_task_group_load;
 		INIT_LIST_HEAD(&rq->leaf_cfs_rq_list);
-#ifdef CONFIG_CGROUP_SCHED
 		/*
 		 * How much cpu bandwidth does init_task_group get?
 		 *
@@ -7783,16 +7787,13 @@ void __init sched_init(void)
 		 * directly in rq->cfs (i.e init_task_group->se[] = NULL).
 		 */
 		init_tg_cfs_entry(&init_task_group, &rq->cfs, NULL, i, 1, NULL);
-#endif
 #endif /* CONFIG_FAIR_GROUP_SCHED */
 
 		rq->rt.rt_runtime = def_rt_bandwidth.rt_runtime;
 #ifdef CONFIG_RT_GROUP_SCHED
 		INIT_LIST_HEAD(&rq->leaf_rt_rq_list);
-#ifdef CONFIG_CGROUP_SCHED
 		init_tg_rt_entry(&init_task_group, &rq->rt, NULL, i, 1, NULL);
 #endif
-#endif
 
 		for (j = 0; j < CPU_LOAD_IDX_MAX; j++)
 			rq->cpu_load[j] = 0;


  reply	other threads:[~2010-06-10 15:19 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10 11:10 [PATCH] [0/23] Fix gcc 4.6 set but unused variable warnings Andi Kleen
2010-06-10 11:10 ` [PATCH] [1/23] x86: percpu: Avoid warnings of unused variables in per cpu Andi Kleen
2010-06-10 11:14   ` Tejun Heo
2010-06-10 12:09     ` Ingo Molnar
2010-06-10 17:43       ` Justin P. Mattock
2010-06-10 18:10         ` Andi Kleen
2010-06-10 18:26           ` Justin P. Mattock
2010-06-10 20:10           ` Justin P. Mattock
2010-06-10 12:24     ` [tip:x86/urgent] percpu, x86: " tip-bot for Andi Kleen
2010-06-10 11:10 ` [PATCH] [2/23] IRQ: Move alloc_desk_mask variables inside ifdef Andi Kleen
2010-06-10 11:10 ` [PATCH] [3/23] x86: Avoid unused by set variables in rdmsr Andi Kleen
2010-06-10 11:10 ` [PATCH] [4/23] pagemap: Avoid unused-but-set variable Andi Kleen
2010-06-18 23:28   ` Andrew Morton
2010-06-19  7:44     ` Andi Kleen
2010-06-10 11:10 ` [PATCH] [5/23] x86 boot: Set ax register in boot vga query Andi Kleen
2010-06-10 17:13   ` H. Peter Anvin
2010-06-10 23:42   ` [tip:x86/urgent] x86, setup: " tip-bot for Andi Kleen
2010-06-10 11:10 ` [PATCH] [6/23] perf: Fix set but unused variables in perf Andi Kleen
2010-06-10 11:10 ` [PATCH] [7/23] x86: fix set but not read variables Andi Kleen
2010-06-10 11:10 ` [PATCH] [8/23] KGDB: Remove set but unused newPC Andi Kleen
2010-07-30 11:59   ` Jason Wessel
2010-06-10 11:10 ` [PATCH] [9/23] PRINTK: Use stable variable to dump kmsg buffer Andi Kleen
2010-06-10 11:10 ` [PATCH] [10/23] SCHED: Only allocate per cpu cpu mask buffer with offstack cpumasks Andi Kleen
2010-06-10 14:43   ` Peter Zijlstra
2010-06-10 14:52     ` Andi Kleen
2010-06-10 14:55       ` Peter Zijlstra
2010-06-10 15:06         ` Andi Kleen
2010-06-10 15:19           ` Peter Zijlstra [this message]
2010-06-10 15:34             ` Andi Kleen
2010-06-10 11:10 ` [PATCH] [11/23] KVM: Fix KVM_SET_SIGNAL_MASK Andi Kleen
2010-06-10 14:16   ` Avi Kivity
2010-06-10 11:10 ` [PATCH] [12/23] BTRFS: Clean up unused variables -- bugs Andi Kleen
2010-06-10 11:10 ` [PATCH] [13/23] BTRFS: Clean up unused variables -- nonbugs Andi Kleen
2010-06-10 11:10 ` [PATCH] [14/23] NFSD: Fix initialized but not read warnings Andi Kleen
2010-06-10 11:10 ` [PATCH] [15/23] EXT4: Fix initialized but not read variables Andi Kleen
2010-06-14 17:20   ` tytso
2010-06-10 11:10 ` [PATCH] [16/23] XFS: Fix gcc 4.6 set but not read and unused statement warnings Andi Kleen
2010-06-11 16:20   ` Christoph Hellwig
2010-06-11 16:36     ` Andi Kleen
2010-06-14  4:27   ` Dave Chinner
2010-06-14  7:43     ` Andi Kleen
2010-06-14 13:37       ` Dave Chinner
2010-06-14 14:37         ` Andi Kleen
2010-06-14 22:24           ` Dave Chinner
2010-06-15  7:02             ` Andi Kleen
2010-06-15  7:40               ` Christoph Hellwig
2010-06-15  7:46                 ` Andi Kleen
2010-06-10 11:10 ` [PATCH] [17/23] EXT3: Fix set but unused variables Andi Kleen
2010-06-14 17:21   ` tytso
2010-06-14 17:27   ` tytso
2010-06-15 14:01     ` Jan Kara
2010-06-10 11:10 ` [PATCH] [18/23] ACPI: Fix unused but set variables in ACPI Andi Kleen
2010-06-10 11:10 ` [PATCH] [19/23] KVM: Fix unused but set warnings Andi Kleen
2010-06-10 14:19   ` Avi Kivity
2010-06-10 11:10 ` [PATCH] [20/23] MM: " Andi Kleen
2010-06-10 11:10 ` [PATCH] [21/23] kernel/*: " Andi Kleen
2010-06-10 11:10 ` [PATCH] [22/23] BLOCK: Fix unused but set variables in blk-merge Andi Kleen
2010-06-10 11:10 ` [PATCH] [23/23] FS: Fix unused but set warnings Andi Kleen

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=1276183176.2077.484.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.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