lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 06 Jun 2013 10:19:11 +0800
From:	Michael Wang <wangyun@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	LKML <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...nel.org>, Paul Turner <pjt@...gle.com>
Subject: Re: [PATCH v2 1/3] sched: don't repeat the initialization in sched_init()

On 06/05/2013 07:06 PM, Peter Zijlstra wrote:
> On Wed, Jun 05, 2013 at 10:24:18AM +0800, Michael Wang wrote:
>> v2:
>> 	Move comments back before init_tg_cfs_entry(). (Thanks for the notify from pjt)
>>
>> In sched_init(), there is no need to initialize 'root_task_group.shares' and
>> 'root_task_group.cfs_bandwidth' repeatedly.
>>
>> CC: Paul Tuner <pjt@...gle.com>
>> CC: Ingo Molnar <mingo@...nel.org>
>> CC: Peter Zijlstra <peterz@...radead.org>
>> Signed-off-by: Michael Wang <wangyun@...ux.vnet.ibm.com>
>> ---
>>  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 58453b8..96f69da 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -6955,6 +6955,11 @@ void __init sched_init(void)
>>  
>>  #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
>> +
>>  	for_each_possible_cpu(i) {
>>  		struct rq *rq;
>>  
>> @@ -6966,7 +6971,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?
>> @@ -6987,7 +6991,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 */
> 
> I would actually like a patch reducing the #ifdef forest there, not
> adding to it.

I see :)

> 
> There's no actual harm in doing the initialization mutliple times,
> right?

Yeah, it's safe to redo the init, cost some cycles but not so expensive.

Regards,
Michael Wang

> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ