Skip to contentSkip to conversation

sched/core: Fix compiling warring in smp=n case

PATCH In review Dou Liyang 4 participants 4 messages Aug 10, 2018 – Sep 14, 2018 Scheduler

lore
Share & tools
lore

Dou Liyang

author
#0 lore raw

PATCH 1/1 sched/core: Fix compiling warring in smp=n case

When compiling kernel with SMP disabled, the build warns with:

kernel/sched/core.c: In function ‘update_rq_clock_task’:
kernel/sched/core.c:139:17: warning: unused variable ‘irq_delta’ [-Wunused-variable]
s64 steal = 0, irq_delta = 0;

Fix this by revert the HAVE_SCHED_AVG_IRQ to

  defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)
Fixes 2e62c4743adc ("sched/fair: Remove #ifdefs from scale_rt_capacity()")
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/core.c +1 -1
index c45de46fdf10..ef954d96c80c 100644
@@ -177,7 +177,7 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)
 
 	rq->clock_task += delta;
 
-#ifdef HAVE_SCHED_AVG_IRQ
+#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)
 	if ((irq_delta + steal) && sched_feat(NONTASK_CAPACITY))
 		update_irq_load_avg(rq, irq_delta + steal);
 #endif
Signature · 1 line
2.14.3
maintainer Acked-by on v1 1/1
#1 lore raw

Hi Dou,

Quoted 7 lines · Dou Liyang

When compiling kernel with SMP disabled, the build warns with:

kernel/sched/core.c: In function ‘update_rq_clock_task’:
kernel/sched/core.c:139:17: warning: unused variable ‘irq_delta’ [-Wunused-variable]
s64 steal = 0, irq_delta = 0;

Quoted 6 lines

Fix this by revert the HAVE_SCHED_AVG_IRQ to

  defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)
Fixes 2e62c4743adc ("sched/fair: Remove #ifdefs from scale_rt_capacity()")
Quoted 22 lines
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/core.c +1 -2
index c45de46fdf10..ef954d96c80c 100644
@@ -177,7 +177,7 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)
 
        rq->clock_task += delta;
 
-#ifdef HAVE_SCHED_AVG_IRQ
+#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)
        if ((irq_delta + steal) && sched_feat(NONTASK_CAPACITY))
                update_irq_load_avg(rq, irq_delta + steal);
 #endif
--

2.14.3

#2 lore raw
In reply to Dou Liyang
Quoted 11 lines · Dou Liyang

When compiling kernel with SMP disabled, the build warns with:

kernel/sched/core.c: In function ‘update_rq_clock_task’:
kernel/sched/core.c:139:17: warning: unused variable ‘irq_delta’ [-Wunused-variable]
s64 steal = 0, irq_delta = 0;

Fix this by revert the HAVE_SCHED_AVG_IRQ to

   defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)
Fixes 2e62c4743adc ("sched/fair: Remove #ifdefs from scale_rt_capacity()")

Hi,

 Miguel also found this warning. Can we pick it up now? ;-)

Thanks,
dou

Acked-by
#3 lore raw

Hi,

Quoted 16 lines · Dou Liyang
Quoted 13 lines · Dou Liyang

When compiling kernel with SMP disabled, the build warns with:

kernel/sched/core.c: In function ‘update_rq_clock_task’:
kernel/sched/core.c:139:17: warning: unused variable ‘irq_delta’ [-Wunused-variable]
s64 steal = 0, irq_delta = 0;

Fix this by revert the HAVE_SCHED_AVG_IRQ to

   defined(CONFIG_IRQ_TIME_ACCOUNTING) ||

defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)

Quoted 7 lines
Quoted 2 lines
Fixes 2e62c4743adc ("sched/fair: Remove #ifdefs from

scale_rt_capacity()")

Hi,

Miguel also found this warning. Can we pick it up now? ;-)

Also Zhong has just sent another patch for this.

Whenever this is picked up, feel free to add:

Cheers,
Miguel