[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xm2637ppzsfz.fsf@bsegall-linux.mtv.corp.google.com>
Date: Tue, 10 May 2016 11:19:44 -0700
From: bsegall@...gle.com
To: Xunlei Pang <xlpang@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@....com>,
Ingo Molnar <mingo@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>, pjt@...gle.com
Subject: Re: [PATCH] sched/fair: Fix the wrong throttled clock time for cfs_rq_clock_task()
Xunlei Pang <xlpang@...hat.com> writes:
> Two minor fixes for cfs_rq_clock_task().
> 1) If cfs_rq is currently being throttled, we need to subtract the cfs
> throttled clock time.
>
> 2) Make "throttled_clock_task_time" update SMP unrelated. Now UP cases
> need it as well.
>
> Signed-off-by: Xunlei Pang <xlpang@...hat.com>
> ---
> kernel/sched/fair.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 1708729e..fb80a12 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3655,7 +3655,7 @@ static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg)
> static inline u64 cfs_rq_clock_task(struct cfs_rq *cfs_rq)
> {
> if (unlikely(cfs_rq->throttle_count))
> - return cfs_rq->throttled_clock_task;
> + return cfs_rq->throttled_clock_task - cfs_rq->throttled_clock_task_time;
>
> return rq_clock_task(rq_of(cfs_rq)) - cfs_rq->throttled_clock_task_time;
> }
> @@ -3793,13 +3793,11 @@ static int tg_unthrottle_up(struct task_group *tg, void *data)
> struct cfs_rq *cfs_rq = tg->cfs_rq[cpu_of(rq)];
>
> cfs_rq->throttle_count--;
> -#ifdef CONFIG_SMP
> if (!cfs_rq->throttle_count) {
> /* adjust cfs_rq_clock_task() */
> cfs_rq->throttled_clock_task_time += rq_clock_task(rq) -
> cfs_rq->throttled_clock_task;
> }
> -#endif
>
> return 0;
> }
[Cc: pjt@...gle.com]
This looks reasonable to me (at least the first part; I'm not
certain why the CONFIG_SMP ifdef was put in place).
Powered by blists - more mailing lists