[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xm26381fu305.fsf@sword-of-the-dawn.mtv.corp.google.com>
Date: Thu, 25 Jun 2015 10:11:38 -0700
From: bsegall@...gle.com
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Cong Wang <cwang@...pensource.com>
Subject: Re: [PATCH] sched_fair: test list head instead of list entry in throttle_cfs_rq()
Cong Wang <xiyou.wangcong@...il.com> writes:
> According to the comments, we need to test if this is
> the first throttled task, however, list_empty() tests on
> the entry cfs_rq->throttled_list, not the head, this is wrong.
>
> This is a bug because we don't re-init the list entry after
> removing it from the list, so list_empty() could return false
> even if the list is really empty.
>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
> Signed-off-by: Cong Wang <cwang@...pensource.com>
Agreed.
Reviewed-by: Ben Segall <bsegall@...gle.com>
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 40a7fcb..ee91917 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3683,7 +3683,7 @@ static void throttle_cfs_rq(struct cfs_rq *cfs_rq)
> cfs_rq->throttled = 1;
> cfs_rq->throttled_clock = rq_clock(rq);
> raw_spin_lock(&cfs_b->lock);
> - empty = list_empty(&cfs_rq->throttled_list);
> + empty = list_empty(&cfs_b->throttled_cfs_rq);
>
> /*
> * Add to the _head_ of the list, so that an already-started
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists