[..snip..]
I wonder if we can only take care of the NO_RUN_TO_PARITY case? Something like this,
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.cif (sched_feat(RUN_TO_PARITY) || cfs_rq->nr_running <= 1 ||
index 03be0d1330a6..5e49a15bbdd3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -745,6 +745,21 @@ int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se)
return vruntime_eligible(cfs_rq, se->vruntime);
}
+static bool check_entity_need_preempt(struct cfs_rq *cfs_rq, struct sched_entity *se)
+{
!entity_eligible(cfs_rq, se))
return false;
return true;
Thoughts?
This does indeed look better. In that case, do I need to make the changes this way and send
out a version 3?
If you mean the following changes, maybe we can continue the discussion here.
This is just my 2 cents, not sure what others think of it. Anyway, I can launch some tests.
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8a5b1ae0aa55..c0fdb25f0695 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -744,6 +744,15 @@ int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se)
return vruntime_eligible(cfs_rq, se->vruntime);
}
+static bool check_curr_preempt(struct cfs_rq *cfs_rq, struct sched_entity *curr)
+{
+ if (sched_feat(RUN_TO_PARITY) || cfs_rq->nr_running <= 1 ||
+ !entity_eligible(cfs_rq, curr))
+ return false;
+
+ return true;
+}
+
static u64 __update_min_vruntime(struct cfs_rq *cfs_rq, u64 vruntime)
{
u64 min_vruntime = cfs_rq->min_vruntime;
[..snip..]