All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Proper initialization of root_task_group
@ 2011-11-30  5:42 Heechul Yun
  2011-11-30 10:13 ` Kamalesh Babulal
  2011-11-30 11:17 ` Peter Zijlstra
  0 siblings, 2 replies; 3+ messages in thread
From: Heechul Yun @ 2011-11-30  5:42 UTC (permalink / raw)
  To: pjt; +Cc: linux-kernel, a.p.zijlstra

Hi,

The following patch fix a initialization issue.

Thanks

Heechul

---
The root_task_group.cfs_bandwidth and root_task_group.shares
were initialized multiple times unnecessarily which are corrected
by this patch.

Signed-off-by: Heechul Yun <heechul@illinois.edu>
---
 kernel/sched/core.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ca8fd44..0ed6978 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6772,6 +6772,11 @@ void __init sched_init(void)
 	autogroup_init(&init_task);
 #endif /* CONFIG_CGROUP_SCHED */
 
+#ifdef CONFIG_FAIR_GROUP_SCHED
+	root_task_group.shares = ROOT_TASK_GROUP_LOAD;
+	init_cfs_bandwidth(&root_task_group.cfs_bandwidth);
+#endif /* CONFIG_FAIR_GROUP_SCHED */
+
 	for_each_possible_cpu(i) {
 		struct rq *rq;
 
@@ -6783,7 +6788,6 @@ void __init sched_init(void)
 		init_cfs_rq(&rq->cfs);
 		init_rt_rq(&rq->rt, rq);
 #ifdef CONFIG_FAIR_GROUP_SCHED
-		root_task_group.shares = ROOT_TASK_GROUP_LOAD;
 		INIT_LIST_HEAD(&rq->leaf_cfs_rq_list);
 		/*
 		 * How much cpu bandwidth does root_task_group get?
@@ -6804,7 +6808,6 @@ void __init sched_init(void)
 		 * We achieve this by letting root_task_group's tasks sit
 		 * directly in rq->cfs (i.e root_task_group->se[] = NULL).
 		 */
-		init_cfs_bandwidth(&root_task_group.cfs_bandwidth);
 		init_tg_cfs_entry(&root_task_group, &rq->cfs, NULL, i, NULL);
 #endif /* CONFIG_FAIR_GROUP_SCHED */
 
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched: Proper initialization of root_task_group
  2011-11-30  5:42 [PATCH] sched: Proper initialization of root_task_group Heechul Yun
@ 2011-11-30 10:13 ` Kamalesh Babulal
  2011-11-30 11:17 ` Peter Zijlstra
  1 sibling, 0 replies; 3+ messages in thread
From: Kamalesh Babulal @ 2011-11-30 10:13 UTC (permalink / raw)
  To: Heechul Yun; +Cc: pjt, linux-kernel, a.p.zijlstra

* Heechul Yun <heechul@illinois.edu> [2011-11-29 23:42:29]:

> Hi,
> 
> The following patch fix a initialization issue.
> 
> Thanks
> 
> Heechul
> 
> ---
> The root_task_group.cfs_bandwidth and root_task_group.shares
> were initialized multiple times unnecessarily which are corrected
> by this patch.
> 
> Signed-off-by: Heechul Yun <heechul@illinois.edu>

Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>


Thanks,
Kamalesh.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched: Proper initialization of root_task_group
  2011-11-30  5:42 [PATCH] sched: Proper initialization of root_task_group Heechul Yun
  2011-11-30 10:13 ` Kamalesh Babulal
@ 2011-11-30 11:17 ` Peter Zijlstra
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2011-11-30 11:17 UTC (permalink / raw)
  To: Heechul Yun; +Cc: pjt, linux-kernel

On Tue, 2011-11-29 at 23:42 -0600, Heechul Yun wrote:
> Hi,
> 
> The following patch fix a initialization issue.
> 
> Thanks
> 
> Heechul
> 
> ---
> The root_task_group.cfs_bandwidth and root_task_group.shares
> were initialized multiple times unnecessarily which are corrected
> by this patch.

The changelog and you comment above contradict each other. Multiple
initialization isn't a bug, therefore there isn't anything an issue as
such and nothing to 'fix'.

Anyway, the patch adds #ifdeffery, I really rather prefer the double
init over more #ifdeffery.

If you can sort it without introducing more #ifdeffery, or rather, even
reduce the #ifdeffery, I'll take it.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-30 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-30  5:42 [PATCH] sched: Proper initialization of root_task_group Heechul Yun
2011-11-30 10:13 ` Kamalesh Babulal
2011-11-30 11:17 ` Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.