summaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2024-05-23 11:00:10 +0200
committerPeter Zijlstra <peterz@infradead.org>2024-08-17 11:06:42 +0200
commite28b5f8bda01720b5ce8456b48cf4b963f9a80a1 (patch)
tree03c616dc79d8654d689eaa366f8353f14078548c /kernel/sched/fair.c
parentsched/uclamg: Handle delayed dequeue (diff)
downloadlinux-e28b5f8bda01720b5ce8456b48cf4b963f9a80a1.tar.xz
linux-e28b5f8bda01720b5ce8456b48cf4b963f9a80a1.zip
sched/fair: Assert {set_next,put_prev}_entity() are properly balanced
Just a little sanity test.. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Valentin Schneider <vschneid@redhat.com> Tested-by: Valentin Schneider <vschneid@redhat.com> Link: https://lkml.kernel.org/r/20240727105029.486423066@infradead.org
Diffstat (limited to '')
-rw-r--r--kernel/sched/fair.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 59b00d78d456..37acd530f413 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5452,6 +5452,7 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
}
update_stats_curr_start(cfs_rq, se);
+ SCHED_WARN_ON(cfs_rq->curr);
cfs_rq->curr = se;
/*
@@ -5513,6 +5514,7 @@ static void put_prev_entity(struct cfs_rq *cfs_rq, struct sched_entity *prev)
/* in !on_rq case, update occurred at dequeue */
update_load_avg(cfs_rq, prev, 0);
}
+ SCHED_WARN_ON(cfs_rq->curr != prev);
cfs_rq->curr = NULL;
}