Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84781e25 authored by Maria Yu's avatar Maria Yu
Browse files

sched: update depth before enqueue entity



When task is switching from rt to normal, depth is not
updated before __enqueue_entity. So it got chance when
in the process of pick next task, checking wrong depth
and get a NULL parent for proceeding.

Change-Id: Ie1052cbb965cf0c899e623ab773f4344c68bbf40
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
parent 830bf7cc
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4814,6 +4814,14 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)

	update_stats_enqueue(cfs_rq, se, !!(flags & ENQUEUE_MIGRATING));
	check_spread(cfs_rq, se);

#ifdef CONFIG_FAIR_GROUP_SCHED
	/*
	 * Update depth before it can be picked as next sched entity.
	 */
	se->depth = se->parent ? se->parent->depth + 1 : 0;
#endif

	if (se != cfs_rq->curr)
		__enqueue_entity(cfs_rq, se);
	se->on_rq = 1;
+8 −0
Original line number Diff line number Diff line
@@ -5023,6 +5023,14 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)

	update_stats_enqueue(cfs_rq, se, !!(flags & ENQUEUE_MIGRATING));
	check_spread(cfs_rq, se);

#ifdef CONFIG_FAIR_GROUP_SCHED
	/*
	 * Update depth before it can be picked as next sched entity.
	 */
	se->depth = se->parent ? se->parent->depth + 1 : 0;
#endif

	if (se != cfs_rq->curr)
		__enqueue_entity(cfs_rq, se);
	se->on_rq = 1;