Skip to content

Commit 763a9ec

Browse files
Qian CaiIngo Molnar
authored andcommitted
sched/fair: Fix -Wunused-but-set-variable warnings
Commit: de53fd7 ("sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices") introduced a few compilation warnings: kernel/sched/fair.c: In function '__refill_cfs_bandwidth_runtime': kernel/sched/fair.c:4365:6: warning: variable 'now' set but not used [-Wunused-but-set-variable] kernel/sched/fair.c: In function 'start_cfs_bandwidth': kernel/sched/fair.c:4992:6: warning: variable 'overrun' set but not used [-Wunused-but-set-variable] Also, __refill_cfs_bandwidth_runtime() does no longer update the expiration time, so fix the comments accordingly. Signed-off-by: Qian Cai <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Ben Segall <[email protected]> Reviewed-by: Dave Chiluk <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Fixes: de53fd7 ("sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices") Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 714e501 commit 763a9ec

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

kernel/sched/fair.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4353,21 +4353,16 @@ static inline u64 sched_cfs_bandwidth_slice(void)
43534353
}
43544354

43554355
/*
4356-
* Replenish runtime according to assigned quota and update expiration time.
4357-
* We use sched_clock_cpu directly instead of rq->clock to avoid adding
4358-
* additional synchronization around rq->lock.
4356+
* Replenish runtime according to assigned quota. We use sched_clock_cpu
4357+
* directly instead of rq->clock to avoid adding additional synchronization
4358+
* around rq->lock.
43594359
*
43604360
* requires cfs_b->lock
43614361
*/
43624362
void __refill_cfs_bandwidth_runtime(struct cfs_bandwidth *cfs_b)
43634363
{
4364-
u64 now;
4365-
4366-
if (cfs_b->quota == RUNTIME_INF)
4367-
return;
4368-
4369-
now = sched_clock_cpu(smp_processor_id());
4370-
cfs_b->runtime = cfs_b->quota;
4364+
if (cfs_b->quota != RUNTIME_INF)
4365+
cfs_b->runtime = cfs_b->quota;
43714366
}
43724367

43734368
static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg)
@@ -4983,15 +4978,13 @@ static void init_cfs_rq_runtime(struct cfs_rq *cfs_rq)
49834978

49844979
void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b)
49854980
{
4986-
u64 overrun;
4987-
49884981
lockdep_assert_held(&cfs_b->lock);
49894982

49904983
if (cfs_b->period_active)
49914984
return;
49924985

49934986
cfs_b->period_active = 1;
4994-
overrun = hrtimer_forward_now(&cfs_b->period_timer, cfs_b->period);
4987+
hrtimer_forward_now(&cfs_b->period_timer, cfs_b->period);
49954988
hrtimer_start_expires(&cfs_b->period_timer, HRTIMER_MODE_ABS_PINNED);
49964989
}
49974990

0 commit comments

Comments
 (0)