linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: subhra mazumdar <subhra.mazumdar@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@redhat.com,
	steven.sistare@oracle.com, dhaval.giani@oracle.com,
	rohit.k.jain@oracle.com, daniel.lezcano@linaro.org
Subject: [PATCH 2/5] sched: introduce per-cpu var next_cpu to track search limit
Date: Tue, 12 Jun 2018 10:49:59 -0700	[thread overview]
Message-ID: <20180612175002.31453-3-subhra.mazumdar@oracle.com> (raw)
In-Reply-To: <20180612175002.31453-1-subhra.mazumdar@oracle.com>

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.

Signed-off-by: subhra mazumdar <subhra.mazumdar@oracle.com>
---
 kernel/sched/core.c  | 2 ++
 kernel/sched/sched.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 8d59b25..b3e4ec1 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -20,6 +20,7 @@
 #include <trace/events/sched.h>
 
 DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
+DEFINE_PER_CPU_SHARED_ALIGNED(int, next_cpu);
 
 #if defined(CONFIG_SCHED_DEBUG) && defined(HAVE_JUMP_LABEL)
 /*
@@ -5996,6 +5997,7 @@ void __init sched_init(void)
 	for_each_possible_cpu(i) {
 		struct rq *rq;
 
+		per_cpu(next_cpu, i) = -1;
 		rq = cpu_rq(i);
 		raw_spin_lock_init(&rq->lock);
 		rq->nr_running = 0;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 67702b4..eb12b50 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -912,6 +912,7 @@ static inline void update_idle_core(struct rq *rq) { }
 #endif
 
 DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
+DECLARE_PER_CPU_SHARED_ALIGNED(int, next_cpu);
 
 #define cpu_rq(cpu)		(&per_cpu(runqueues, (cpu)))
 #define this_rq()		this_cpu_ptr(&runqueues)
-- 
2.9.3


  parent reply	other threads:[~2018-06-12 17:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 17:49 [RFC/RFT V2 PATCH 0/5] Improve scheduler scalability for fast path subhra mazumdar
2018-06-12 17:49 ` [PATCH 1/5] sched: limit cpu search in select_idle_cpu subhra mazumdar
2018-06-12 20:33   ` kbuild test robot
2018-06-12 22:12     ` Subhra Mazumdar
2018-06-20  7:32   ` [lkp-robot] [sched] 8dd662615c: reaim.jobs_per_min -3.3% regression kernel test robot
2018-06-12 17:49 ` subhra mazumdar [this message]
2018-06-12 17:50 ` [PATCH 3/5] sched: rotate the cpu search window for better spread subhra mazumdar
2018-06-12 17:50 ` [PATCH 4/5] sched: add sched feature to disable idle core search subhra mazumdar
2018-06-12 17:50 ` [PATCH 5/5] sched: SIS_CORE " subhra mazumdar
2018-06-28 22:44 [RESEND RFC/RFT V2 PATCH 0/5] Improve scheduler scalability for fast path subhra mazumdar
2018-06-28 22:44 ` [PATCH 2/5] sched: introduce per-cpu var next_cpu to track search limit subhra mazumdar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180612175002.31453-3-subhra.mazumdar@oracle.com \
    --to=subhra.mazumdar@oracle.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=dhaval.giani@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rohit.k.jain@oracle.com \
    --cc=steven.sistare@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).