summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2015-06-24 12:41:47 -0700
committerIngo Molnar <mingo@kernel.org>2015-07-06 14:15:08 +0200
commitd49db342f0e276b354383b3281c5668b6b80f5c2 (patch)
tree646345871947652187cedb234ee08ffb2ef4974e /kernel
parent1c4c7159ed2468f3ac4ce5a7f08d79663d381a93 (diff)
downloadop-kernel-dev-d49db342f0e276b354383b3281c5668b6b80f5c2.zip
op-kernel-dev-d49db342f0e276b354383b3281c5668b6b80f5c2.tar.gz
sched/fair: Test list head instead of list entry in throttle_cfs_rq()
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. Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Cong Wang <cwang@twopensource.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Ben Segall <bsegall@google.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1435174907-432-1-git-send-email-xiyou.wangcong@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 65c8f3e..d113c3b 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
OpenPOWER on IntegriCloud