Skip to content

Commit 91787b1

Browse files
committed
sched: introduce per-cpu var next_cpu to track search limit
Introduce a per-cpu variable to track the limit upto which idle cpu search was done in select_idle_cpu(). This will help to start the search next time from there. This is necessary for rotating the search window over entire LLC domain. Orabug: 28482695 Signed-off-by: subhra mazumdar <[email protected]> Reviewed-by: Rohit Jain <[email protected]>
1 parent 670075c commit 91787b1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

kernel/sched/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <trace/events/sched.h>
4343

4444
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
45+
DEFINE_PER_CPU_SHARED_ALIGNED(int, next_cpu);
4546

4647
/*
4748
* Debugging: various feature bits
@@ -5891,6 +5892,7 @@ void __init sched_init(void)
58915892
for_each_possible_cpu(i) {
58925893
struct rq *rq;
58935894

5895+
per_cpu(next_cpu, i) = -1;
58945896
rq = cpu_rq(i);
58955897
raw_spin_lock_init(&rq->lock);
58965898
rq->nr_running = 0;

kernel/sched/sched.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ static inline void update_idle_core(struct rq *rq) { }
843843
#endif
844844

845845
DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
846+
DECLARE_PER_CPU_SHARED_ALIGNED(int, next_cpu);
846847

847848
#define cpu_rq(cpu) (&per_cpu(runqueues, (cpu)))
848849
#define this_rq() this_cpu_ptr(&runqueues)

0 commit comments

Comments
 (0)