All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Creekmore <jonathan.creekmore@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Jonathan Creekmore <jonathan.creekmore@gmail.com>,
	Dario Faggioli <dario.faggioli@citrix.com>,
	Josh Whitehead <josh.whitehead@dornerworks.com>,
	Robert VanVossen <robert.vanvossen@dornerworks.com>
Subject: [PATCH v4 4/5] sched: Register the schedulers into the list
Date: Fri,  8 Jan 2016 15:22:45 -0600	[thread overview]
Message-ID: <1452288166-43501-5-git-send-email-jonathan.creekmore@gmail.com> (raw)
In-Reply-To: <1452288166-43501-1-git-send-email-jonathan.creekmore@gmail.com>

Adds a simple macro to place a pointer to a scheduler into an array
section at compile time. Also, goes ahead and generates the array
entries with each of the schedulers.

CC: George Dunlap <george.dunlap@eu.citrix.com>
CC: Dario Faggioli <dario.faggioli@citrix.com>
CC: Josh Whitehead <josh.whitehead@dornerworks.com>
CC: Robert VanVossen <robert.vanvossen@dornerworks.com>
Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/common/sched_arinc653.c | 2 ++
 xen/common/sched_credit.c   | 2 ++
 xen/common/sched_credit2.c  | 2 ++
 xen/common/sched_rt.c       | 2 ++
 xen/include/xen/sched-if.h  | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index dbe02ed..3b59514 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -767,6 +767,8 @@ const struct scheduler sched_arinc653_def = {
     .tick_resume    = NULL,
 };
 
+REGISTER_SCHEDULER(sched_arinc653_def);
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 0dce790..e586248 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -2027,3 +2027,5 @@ const struct scheduler sched_credit_def = {
     .tick_suspend   = csched_tick_suspend,
     .tick_resume    = csched_tick_resume,
 };
+
+REGISTER_SCHEDULER(sched_credit_def);
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 3c49ffa..38b02d0 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -2228,3 +2228,5 @@ const struct scheduler sched_credit2_def = {
     .alloc_domdata  = csched2_alloc_domdata,
     .free_domdata   = csched2_free_domdata,
 };
+
+REGISTER_SCHEDULER(sched_credit2_def);
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 3f1d047..7640cd0 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1199,3 +1199,5 @@ const struct scheduler sched_rtds_def = {
     .wake           = rt_vcpu_wake,
     .context_saved  = rt_context_saved,
 };
+
+REGISTER_SCHEDULER(sched_rtds_def);
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 493d43f..9c6e0f5 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -170,6 +170,8 @@ extern const struct scheduler sched_credit2_def;
 extern const struct scheduler sched_arinc653_def;
 extern const struct scheduler sched_rtds_def;
 
+#define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
+  __used_section(".data.schedulers") = &x;
 
 struct cpupool
 {
-- 
2.6.4

  parent reply	other threads:[~2016-01-08 21:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 21:22 [PATCH v4 0/5] Allow schedulers to be selectable through Kconfig Jonathan Creekmore
2016-01-08 21:22 ` [PATCH v4 1/5] build: Env var to enable expert config options Jonathan Creekmore
2016-01-08 21:22 ` [PATCH v4 2/5] build: Hook the schedulers into Kconfig Jonathan Creekmore
2016-01-09 14:52   ` Andrew Cooper
2016-01-09 17:50     ` Jonathan Creekmore
2016-01-09 18:08       ` Andrew Cooper
2016-01-09 22:47         ` Jonathan Creekmore
2016-01-11 13:59         ` Jan Beulich
2016-01-11 14:07   ` Jan Beulich
2016-01-11 15:10     ` Jonathan Creekmore
2016-01-11 15:43       ` Jan Beulich
2016-01-11 16:31         ` Doug Goldstein
2016-01-11 16:49           ` Jan Beulich
2016-01-11 17:17             ` Doug Goldstein
2016-01-08 21:22 ` [PATCH v4 3/5] build: Alloc space for sched list in the link file Jonathan Creekmore
2016-01-09 18:25   ` Andrew Cooper
2016-01-09 22:46     ` Jonathan Creekmore
2016-01-08 21:22 ` Jonathan Creekmore [this message]
2016-01-08 21:22 ` [PATCH v4 5/5] sched: Use the auto-generated list of schedulers Jonathan Creekmore
2016-01-09 18:28   ` Andrew Cooper
2016-01-09 22:43     ` Jonathan Creekmore

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=1452288166-43501-5-git-send-email-jonathan.creekmore@gmail.com \
    --to=jonathan.creekmore@gmail.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=josh.whitehead@dornerworks.com \
    --cc=robert.vanvossen@dornerworks.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.