diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 410b77aea216f959fb93f123df72b53a0ff1c288..3ac096e74fafff28ae7d91b91deb2abc7eb4c28d 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -485,9 +485,8 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) vruntime += sched_vslice_add(cfs_rq, se); if (!initial) { - struct task_struct *p = container_of(se, struct task_struct, se); - - if (sched_feat(NEW_FAIR_SLEEPERS) && p->policy != SCHED_BATCH) + if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se) && + task_of(se)->policy != SCHED_BATCH) vruntime -= sysctl_sched_latency; vruntime = max_t(s64, vruntime, se->vruntime);