linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/fair: move capacity_margin definition into #ifdef
@ 2018-12-10 21:01 Arnd Bergmann
  2018-12-11  7:46 ` Vincent Guittot
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-12-10 21:01 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra
  Cc: Muchun Song, Morten Rasmussen, Arnd Bergmann, Mel Gorman,
	Vincent Guittot, Srikar Dronamraju, Patrick Bellasi,
	linux-kernel

Marking the variable static showed that it's only used for
SMP builds, as seen from this warning:

kernel/sched/fair.c:119:21: error: 'capacity_margin' defined but not used [-Werror=unused-variable]
 static unsigned int capacity_margin   = 1280;

This has apparently been true since the variable has first been
introduced, but only now started causing a compile time warning.

Fixes: ed8885a14433 ("sched/fair: Make some variables static")
Fixes: 3273163c6775 ("sched/fair: Let asymmetric CPU configurations balance at wake-up")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 kernel/sched/fair.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e30dea59d215..27928809e6ed 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -110,14 +110,6 @@ int __weak arch_asym_cpu_priority(int cpu)
 unsigned int sysctl_sched_cfs_bandwidth_slice		= 5000UL;
 #endif
 
-/*
- * The margin used when comparing utilization with CPU capacity:
- * util * margin < capacity * 1024
- *
- * (default: ~20%)
- */
-static unsigned int capacity_margin			= 1280;
-
 static inline void update_load_add(struct load_weight *lw, unsigned long inc)
 {
 	lw->weight += inc;
@@ -3046,6 +3038,14 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
 }
 
 #ifdef CONFIG_SMP
+/*
+ * The margin used when comparing utilization with CPU capacity:
+ * util * margin < capacity * 1024
+ *
+ * (default: ~20%)
+ */
+static unsigned int capacity_margin			= 1280;
+
 #ifdef CONFIG_FAIR_GROUP_SCHED
 /**
  * update_tg_load_avg - update the tg's load avg
-- 
2.20.0


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

* Re: [PATCH] sched/fair: move capacity_margin definition into #ifdef
  2018-12-10 21:01 [PATCH] sched/fair: move capacity_margin definition into #ifdef Arnd Bergmann
@ 2018-12-11  7:46 ` Vincent Guittot
  2018-12-11 15:20   ` Olof Johansson
  0 siblings, 1 reply; 3+ messages in thread
From: Vincent Guittot @ 2018-12-11  7:46 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Ingo Molnar, Peter Zijlstra, smuchun, Morten Rasmussen,
	Mel Gorman, Srikar Dronamraju, Patrick Bellasi, linux-kernel

Hi Arnd,

On Mon, 10 Dec 2018 at 22:01, Arnd Bergmann <arnd@arndb.de> wrote:
>
> Marking the variable static showed that it's only used for
> SMP builds, as seen from this warning:
>
> kernel/sched/fair.c:119:21: error: 'capacity_margin' defined but not used [-Werror=unused-variable]
>  static unsigned int capacity_margin   = 1280;

Olof sent a similar patch 2 weeks ago: https://lkml.org/lkml/2018/11/26/115

Vincent
>
> This has apparently been true since the variable has first been
> introduced, but only now started causing a compile time warning.
>
> Fixes: ed8885a14433 ("sched/fair: Make some variables static")
> Fixes: 3273163c6775 ("sched/fair: Let asymmetric CPU configurations balance at wake-up")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  kernel/sched/fair.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index e30dea59d215..27928809e6ed 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -110,14 +110,6 @@ int __weak arch_asym_cpu_priority(int cpu)
>  unsigned int sysctl_sched_cfs_bandwidth_slice          = 5000UL;
>  #endif
>
> -/*
> - * The margin used when comparing utilization with CPU capacity:
> - * util * margin < capacity * 1024
> - *
> - * (default: ~20%)
> - */
> -static unsigned int capacity_margin                    = 1280;
> -
>  static inline void update_load_add(struct load_weight *lw, unsigned long inc)
>  {
>         lw->weight += inc;
> @@ -3046,6 +3038,14 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
>  }
>
>  #ifdef CONFIG_SMP
> +/*
> + * The margin used when comparing utilization with CPU capacity:
> + * util * margin < capacity * 1024
> + *
> + * (default: ~20%)
> + */
> +static unsigned int capacity_margin                    = 1280;
> +
>  #ifdef CONFIG_FAIR_GROUP_SCHED
>  /**
>   * update_tg_load_avg - update the tg's load avg
> --
> 2.20.0
>

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

* Re: [PATCH] sched/fair: move capacity_margin definition into #ifdef
  2018-12-11  7:46 ` Vincent Guittot
@ 2018-12-11 15:20   ` Olof Johansson
  0 siblings, 0 replies; 3+ messages in thread
From: Olof Johansson @ 2018-12-11 15:20 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: Arnd Bergmann, Ingo Molnar, Peter Zijlstra, Muchun Song,
	morten.rasmussen, mgorman, srikar, patrick.bellasi,
	Linux Kernel Mailing List

On Mon, Dec 10, 2018 at 11:46 PM Vincent Guittot
<vincent.guittot@linaro.org> wrote:
>
> Hi Arnd,
>
> On Mon, 10 Dec 2018 at 22:01, Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > Marking the variable static showed that it's only used for
> > SMP builds, as seen from this warning:
> >
> > kernel/sched/fair.c:119:21: error: 'capacity_margin' defined but not used [-Werror=unused-variable]
> >  static unsigned int capacity_margin   = 1280;
>
> Olof sent a similar patch 2 weeks ago: https://lkml.org/lkml/2018/11/26/115

Yeah, Ingo seems to be high latency right now. :( Anyone else able to
pick it up? Peter?


-Olof

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

end of thread, other threads:[~2018-12-11 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 21:01 [PATCH] sched/fair: move capacity_margin definition into #ifdef Arnd Bergmann
2018-12-11  7:46 ` Vincent Guittot
2018-12-11 15:20   ` Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).