diff mbox

sched: Do not zero sg->cpumask and sg->sgp->power in build_sched_groups

Message ID 1398865178-12577-1-git-send-email-dietmar.eggemann@arm.com
State Accepted
Commit caffcdd8d27ba78730d5540396ce72ad022aff2c
Headers show

Commit Message

Dietmar Eggemann April 30, 2014, 1:39 p.m. UTC
From: Dietmar Eggemann <Dietmar.Eggemann@arm.com>

There is no need to zero struct sched_group member cpumask and struct
sched_group_power member power since both structures are already allocated
as zeroed memory in __sdt_alloc().

This patch has been tested with
BUG_ON(!cpumask_empty(sched_group_cpus(sg))); and BUG_ON(sg->sgp->power);
in build_sched_groups() on ARM TC2 and INTEL i5 M520 platform including
CPU hotplug scenarios.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
---
 kernel/sched/core.c |    2 --
 1 file changed, 2 deletions(-)

Comments

Dietmar Eggemann May 13, 2014, 8:32 a.m. UTC | #1
Hi Peter,

On 30/04/14 14:39, Dietmar Eggemann wrote:
> From: Dietmar Eggemann <Dietmar.Eggemann@arm.com>
> 
> There is no need to zero struct sched_group member cpumask and struct
> sched_group_power member power since both structures are already allocated
> as zeroed memory in __sdt_alloc().
> 
> This patch has been tested with
> BUG_ON(!cpumask_empty(sched_group_cpus(sg))); and BUG_ON(sg->sgp->power);
> in build_sched_groups() on ARM TC2 and INTEL i5 M520 platform including
> CPU hotplug scenarios.
> 
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> ---
>  kernel/sched/core.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 9cae286824bb..6bc51aebbf1b 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -5807,8 +5807,6 @@ build_sched_groups(struct sched_domain *sd, int cpu)
>  			continue;
>  
>  		group = get_group(i, sdd, &sg);
> -		cpumask_clear(sched_group_cpus(sg));
> -		sg->sgp->power = 0;
>  		cpumask_setall(sched_group_mask(sg));
>  
>  		for_each_cpu(j, span) {
> 

I think this one slipped through the cracks. Could you have a look?

Thanks,

-- Dietmar

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Peter Zijlstra May 13, 2014, 10:32 a.m. UTC | #2
On Tue, May 13, 2014 at 09:32:53AM +0100, Dietmar Eggemann wrote:
> Hi Peter,
> 
> On 30/04/14 14:39, Dietmar Eggemann wrote:
> > From: Dietmar Eggemann <Dietmar.Eggemann@arm.com>
> > 
> > There is no need to zero struct sched_group member cpumask and struct
> > sched_group_power member power since both structures are already allocated
> > as zeroed memory in __sdt_alloc().
> > 
> > This patch has been tested with
> > BUG_ON(!cpumask_empty(sched_group_cpus(sg))); and BUG_ON(sg->sgp->power);
> > in build_sched_groups() on ARM TC2 and INTEL i5 M520 platform including
> > CPU hotplug scenarios.
> > 
> > Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> > ---
> >  kernel/sched/core.c |    2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 9cae286824bb..6bc51aebbf1b 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -5807,8 +5807,6 @@ build_sched_groups(struct sched_domain *sd, int cpu)
> >  			continue;
> >  
> >  		group = get_group(i, sdd, &sg);
> > -		cpumask_clear(sched_group_cpus(sg));
> > -		sg->sgp->power = 0;
> >  		cpumask_setall(sched_group_mask(sg));
> >  
> >  		for_each_cpu(j, span) {
> > 
> 
> I think this one slipped through the cracks. Could you have a look?

Yeah, got stuck in the backlog :/

Seems simple enough, queued it, we'll see if anything explodes ;-)
diff mbox

Patch

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9cae286824bb..6bc51aebbf1b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5807,8 +5807,6 @@  build_sched_groups(struct sched_domain *sd, int cpu)
 			continue;
 
 		group = get_group(i, sdd, &sg);
-		cpumask_clear(sched_group_cpus(sg));
-		sg->sgp->power = 0;
 		cpumask_setall(sched_group_mask(sg));
 
 		for_each_cpu(j, span) {