[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180705172922.GQ2458@hirez.programming.kicks-ass.net>
Date: Thu, 5 Jul 2018 19:29:22 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Quentin Perret <quentin.perret@....com>
Cc: rjw@...ysocki.net, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, gregkh@...uxfoundation.org,
mingo@...hat.com, dietmar.eggemann@....com,
morten.rasmussen@....com, chris.redpath@....com,
patrick.bellasi@....com, valentin.schneider@....com,
vincent.guittot@...aro.org, thara.gopinath@...aro.org,
viresh.kumar@...aro.org, tkjos@...gle.com, joel@...lfernandes.org,
smuckle@...gle.com, adharmap@...cinc.com, skannan@...cinc.com,
pkondeti@...eaurora.org, juri.lelli@...hat.com,
edubezval@...il.com, srinivas.pandruvada@...ux.intel.com,
currojerez@...eup.net, javi.merino@...nel.org
Subject: Re: [RFC PATCH v4 05/12] sched/topology: Reference the Energy Model
of CPUs when available
On Thu, Jun 28, 2018 at 12:40:36PM +0100, Quentin Perret wrote:
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 61a1125c1ae4..357eff55c1a7 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -201,6 +201,19 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent)
> return 1;
> }
>
> +#ifdef CONFIG_ENERGY_MODEL
> +static void free_fd(struct freq_domain *fd)
> +{
> + struct freq_domain *tmp;
> +
> + while (fd) {
> + tmp = fd->next;
> + kfree(fd);
> + fd = tmp;
> + }
> +}
> +#endif
> +
> static void free_rootdomain(struct rcu_head *rcu)
> {
> struct root_domain *rd = container_of(rcu, struct root_domain, rcu);
> @@ -211,6 +224,9 @@ static void free_rootdomain(struct rcu_head *rcu)
> free_cpumask_var(rd->rto_mask);
> free_cpumask_var(rd->online);
> free_cpumask_var(rd->span);
> +#ifdef CONFIG_ENERGY_MODEL
> + free_fd(rd->fd);
> +#endif
If you provide a stub function, you can reduce #ifdef.
> kfree(rd);
> }
>
> @@ -1635,6 +1651,104 @@ static struct sched_domain *build_sched_domain(struct sched_domain_topology_leve
> return sd;
> }
>
> +#ifdef CONFIG_ENERGY_MODEL
< snip content >
> +#endif
And is there any reason this #ifdef cannot be merged with the one above?
That is, try and do a pass of #ifdef reduction on this file.
Powered by blists - more mailing lists