Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fix from Ingo Molnar: "Fix a NULL pointer dereference crash in certain environments" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Do not re-read ->h_load_next during hierarchical load calculation
This commit is contained in:
commit
5e6f1fee60
|
@ -7784,10 +7784,10 @@ static void update_cfs_rq_h_load(struct cfs_rq *cfs_rq)
|
|||
if (cfs_rq->last_h_load_update == now)
|
||||
return;
|
||||
|
||||
cfs_rq->h_load_next = NULL;
|
||||
WRITE_ONCE(cfs_rq->h_load_next, NULL);
|
||||
for_each_sched_entity(se) {
|
||||
cfs_rq = cfs_rq_of(se);
|
||||
cfs_rq->h_load_next = se;
|
||||
WRITE_ONCE(cfs_rq->h_load_next, se);
|
||||
if (cfs_rq->last_h_load_update == now)
|
||||
break;
|
||||
}
|
||||
|
@ -7797,7 +7797,7 @@ static void update_cfs_rq_h_load(struct cfs_rq *cfs_rq)
|
|||
cfs_rq->last_h_load_update = now;
|
||||
}
|
||||
|
||||
while ((se = cfs_rq->h_load_next) != NULL) {
|
||||
while ((se = READ_ONCE(cfs_rq->h_load_next)) != NULL) {
|
||||
load = cfs_rq->h_load;
|
||||
load = div64_ul(load * se->avg.load_avg,
|
||||
cfs_rq_load_avg(cfs_rq) + 1);
|
||||
|
|
Loading…
Reference in New Issue