Skip to content

Commit

Permalink
sched: fair: Add strict skip buddy support
Browse files Browse the repository at this point in the history
Skip buddy i.e task called yield() is always skipped and the
next entity is selected to run irrespective of the unfairness.

Change-Id: Ia9b9fbe46917152b58dc6406c718eb1cfb3b0fb2
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
  • Loading branch information
sixtaku authored and mylove90 committed Jan 24, 2024
1 parent a87ee54 commit 54cfff6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -4343,7 +4343,8 @@ pick_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *curr)
second = curr;
}

if (second && wakeup_preempt_entity(second, left) < 1)
if (second && (sched_feat(STRICT_SKIP_BUDDY) ||
wakeup_preempt_entity(second, left) < 1))
se = second;
}

Expand Down
6 changes: 6 additions & 0 deletions kernel/sched/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
*/
#define SCHED_FEAT_LAST_BUDDY 1

/*
* skip buddy i.e task called yield() is always skipped and the
* next entity is selected to run irrespective of the vruntime
*/
#define SCHED_FEAT_STRICT_SKIP_BUDDY 1

/*
* Consider buddies to be cache hot, decreases the likelyness of a
* cache buddy being migrated away, increases cache locality.
Expand Down

0 comments on commit 54cfff6

Please sign in to comment.