Skip to content

Commit 3c0c767

Browse files
committed
anolis: Fix the bug that cfs_rq->h_nr_expel_immune underflow
ANBZ: torvalds#378 There are two stages in unthrottle_cfs_rq(), and in the second stage, cfs_rq->h_nr_expel_immune wasn't updated, and it'll be less than the actual value. Once there is only expellee tasks on the cfs_rq, as cfs_rq->h_nr_expel_immune isn't zero, expellee_only() will return false, but pick_next_entity() will return NULL as expellee se are moved from rb_tree to expel_list, which will result that set_next_entity() access the NULL pointer and then panic. This patch is to fix this problem. Fixes: 2df6821("sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list") Signed-off-by: Cruz Zhao <CruzZhao@linux.alibaba.com> Acked-by: Michael Wang <yun.wang@linux.alibaba.com>
1 parent 87e3403 commit 3c0c767

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6085,6 +6085,7 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
60856085
update_load_avg(cfs_rq, se, UPDATE_TG);
60866086

60876087
cfs_rq->h_nr_running += task_delta;
6088+
update_nr_expel_immune(cfs_rq, se, &immune, ei_delta);
60886089

60896090
/* end evaluation on encountering a throttled cfs_rq */
60906091
if (cfs_rq_throttled(cfs_rq))

0 commit comments

Comments
 (0)