All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/5] Allow schedulers to be selectable through Kconfig
@ 2016-01-15 17:01 Jonathan Creekmore
  2016-01-15 17:01 ` [PATCH v6 1/5] build: Env var to enable expert config options Jonathan Creekmore
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Jonathan Creekmore @ 2016-01-15 17:01 UTC (permalink / raw)
  To: xen-devel; +Cc: Jonathan Creekmore

Add machinery to allow the schedulers to be individually selectable
through the Kconfig interface. The first patch in the series sets up
the CONFIG_EXPERT Kconfig variable that is only enabled by passing an
environment variable to the build. The second patch in the series sets up
the Kconfig options for the schedulers and places the appropriate CONFIG_
options around the scheduler list. The third, fourth, and fifth patches
rework the scheduler list from being manually curated into a model
where just compiling any schedulers into the hypervisor causes the
scheduler list to be built up.

---
Changed since v5:
 * Removed extra default options since credit is always compiled in
 * Changed to a #define for the schedulers array instead of a 
   static const **

Changed since v4:
 * Removed the ability to configure the credit scheduler. It is always
   compiled in, so there is no need for the defensive check for schedulers
   in the linker (added in v4) and no reason to provide the static inlines
   (added in v3) since credit is always present. 
 * Remove extra size field that was accidentally left in.

Changed since v3:
 * Add defensive check for schedulers in the linker

Changed since v2:
 * Added a predecessor patch that introduces a environment
   variable for the build to enable expert configuration options
   (1/5)
 * Hide the scheduler menu behind the expert option (2/5)
 * Provide static inlines for credit functions that are assumed to be
   present if it is compiled out (2/5)
 * Provide an absolute default of the credit scheduler if the 
   scheduler menu is not visible (2/5)

Changed since v1:
 * Marked credit2 as EXPERIMENTAL
 * Removed confusing language from the commit message
 * Alphabetize the schedulers
 * rename the __start and __end symbols to better match
   the rest of the file
 * Simplify the calculation of the number of schedulers
 * Make the scheduler ops structures static to their files


Jonathan Creekmore (5):
  build: Env var to enable expert config options
  build: Hook the schedulers into Kconfig
  build: Alloc space for sched list in the link file
  sched: Register the schedulers into the list
  sched: Use the auto-generated list of schedulers

 xen/Kconfig                 |  4 ++++
 xen/Makefile                |  1 +
 xen/arch/arm/xen.lds.S      |  4 ++++
 xen/arch/x86/xen.lds.S      |  4 ++++
 xen/common/Kconfig          | 56 +++++++++++++++++++++++++++++++++++++++++++++
 xen/common/Makefile         |  8 +++----
 xen/common/sched_arinc653.c |  4 +++-
 xen/common/sched_credit.c   |  4 +++-
 xen/common/sched_credit2.c  |  4 +++-
 xen/common/sched_rt.c       |  4 +++-
 xen/common/schedule.c       | 19 +++++++--------
 xen/include/xen/sched-if.h  |  7 ++----
 12 files changed, 95 insertions(+), 24 deletions(-)

-- 
2.6.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v6 1/5] build: Env var to enable expert config options
  2016-01-15 17:01 [PATCH v6 0/5] Allow schedulers to be selectable through Kconfig Jonathan Creekmore
@ 2016-01-15 17:01 ` Jonathan Creekmore
  2016-01-15 17:20   ` Jan Beulich
  2016-01-15 17:01 ` [PATCH v6 2/5] build: Hook the schedulers into Kconfig Jonathan Creekmore
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Jonathan Creekmore @ 2016-01-15 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Jonathan Creekmore, Ian Jackson,
	Tim Deegan, Jan Beulich

Add an additional environment variable, defaulting to disabled,
that enables the CONFIG_EXPERT configuration option. The purpose
of the CONFIG_EXPERT configuration option is to make non-standard
Kconfig options visible during the configuration process. The
CONFIG_EXPERT option is not, itself, visible during the Kconfig
configuration process, so typical users will never see it nor
any of the non-standard configuration options.

CC: Ian Campbell <ian.campbell@citrix.com>
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Keir Fraser <keir@xen.org>
CC: Tim Deegan <tim@xen.org>
Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/Kconfig  | 4 ++++
 xen/Makefile | 1 +
 2 files changed, 5 insertions(+)

diff --git a/xen/Kconfig b/xen/Kconfig
index ffe3f45..fa8b27c 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -22,3 +22,7 @@ config DEFCONFIG_LIST
 	string
 	option defconfig_list
 	default "$ARCH_DEFCONFIG"
+
+config EXPERT
+	string
+	option env="XEN_CONFIG_EXPERT"
diff --git a/xen/Makefile b/xen/Makefile
index 3699b20..e03e79b 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -11,6 +11,7 @@ export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) |
 export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
 export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
 export XEN_BUILD_HOST	?= $(shell hostname)
+export XEN_CONFIG_EXPERT ?= n
 
 export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v6 2/5] build: Hook the schedulers into Kconfig
  2016-01-15 17:01 [PATCH v6 0/5] Allow schedulers to be selectable through Kconfig Jonathan Creekmore
  2016-01-15 17:01 ` [PATCH v6 1/5] build: Env var to enable expert config options Jonathan Creekmore
@ 2016-01-15 17:01 ` Jonathan Creekmore
  2016-01-19 10:55   ` Dario Faggioli
  2016-01-15 17:01 ` [PATCH v6 3/5] build: Alloc space for sched list in the link file Jonathan Creekmore
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Jonathan Creekmore @ 2016-01-15 17:01 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Jonathan Creekmore, Dario Faggioli

Allow the schedulers to be independently enabled or disabled at
compile-time. To match existing behavior, all four schedulers are
compiled in by default, although the Credit2, RTDS, and ARINC653 are
marked EXPERIMENTAL to match their not currently supported status.

CC: George Dunlap <george.dunlap@eu.citrix.com>
CC: Dario Faggioli <dario.faggioli@citrix.com>
Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>

---
Changed since v5:

  * Remove extra defaults for schedulers since credit is always there

Changed since v4:

  * Removed the "if unsure" language
  * Removed ability to disable the "credit" scheduler
  * Remove stub vcpu_migration_delay functions since credit cannot be disabled

Changed since v2:

  * Hid the scheduler menu behind the EXPERT option
  * Provide static inlines for credit functions that are assumed to be
    always available
  * Provide an absolute default of the credit scheduler if the
    scheduler menu is not visible

Changed since v1:

  * Marked credit2 as EXPERIMENTAL
  * Removed confusing language from the commit message
  * Alphabetize the schedulers
---
 xen/common/Kconfig    | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++
 xen/common/Makefile   |  8 ++++----
 xen/common/schedule.c | 12 +++++++++--
 3 files changed, 70 insertions(+), 6 deletions(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index eadfc3b..7cc99c7 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -97,4 +97,60 @@ config XSM
 
 	  If unsure, say N.
 
+# Enable schedulers
+menu "Schedulers"
+	visible if EXPERT = "y"
+
+config SCHED_CREDIT
+	bool
+	default y
+	---help---
+	  The traditional credit scheduler is a general purpose scheduler.
+
+config SCHED_CREDIT2
+	bool "Credit2 scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The credit2 scheduler is a general purpose scheduler that is
+	  optimized for lower latency and higher VM density.
+
+config SCHED_RTDS
+	bool "RTDS scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The RTDS scheduler is a soft and firm real-time scheduler for
+	  multicore, targeted for embedded, automotive, graphics and gaming
+	  in the cloud, and general low-latency workloads.
+
+config SCHED_ARINC653
+	bool "ARINC653 scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The ARINC653 scheduler is a hard real-time scheduler for single
+	  cores, targeted for avionics, drones, and medical devices.
+
+choice
+	prompt "Default Scheduler?"
+	default SCHED_CREDIT_DEFAULT 
+
+	config SCHED_CREDIT_DEFAULT
+		bool "Credit Scheduler" if SCHED_CREDIT
+	config SCHED_CREDIT2_DEFAULT
+		bool "Credit2 Scheduler" if SCHED_CREDIT2
+	config SCHED_RTDS_DEFAULT
+		bool "RT Scheduler" if SCHED_RTDS
+	config SCHED_ARINC653_DEFAULT
+		bool "ARINC653 Scheduler" if SCHED_ARINC653
+endchoice
+
+config SCHED_DEFAULT
+	string
+	default "credit" if SCHED_CREDIT_DEFAULT
+	default "credit2" if SCHED_CREDIT2_DEFAULT
+	default "rtds" if SCHED_RTDS_DEFAULT
+	default "arinc653" if SCHED_ARINC653_DEFAULT
+	default "credit"
+
+endmenu
+
 endmenu
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 9f8b214..4df71ee 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -30,10 +30,10 @@ obj-y += rangeset.o
 obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += rcupdate.o
-obj-y += sched_credit.o
-obj-y += sched_credit2.o
-obj-y += sched_arinc653.o
-obj-y += sched_rt.o
+obj-$(CONFIG_SCHED_ARINC653) += sched_arinc653.o
+obj-$(CONFIG_SCHED_CREDIT) += sched_credit.o
+obj-$(CONFIG_SCHED_CREDIT2) += sched_credit2.o
+obj-$(CONFIG_SCHED_RTDS) += sched_rt.o
 obj-y += schedule.o
 obj-y += shutdown.o
 obj-y += softirq.o
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index d121896..2f98a48 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -38,8 +38,8 @@
 #include <public/sched.h>
 #include <xsm/xsm.h>
 
-/* opt_sched: scheduler - default to credit */
-static char __initdata opt_sched[10] = "credit";
+/* opt_sched: scheduler - default to configured value */
+static char __initdata opt_sched[10] = CONFIG_SCHED_DEFAULT;
 string_param("sched", opt_sched);
 
 /* if sched_smt_power_savings is set,
@@ -65,10 +65,18 @@ DEFINE_PER_CPU(struct schedule_data, schedule_data);
 DEFINE_PER_CPU(struct scheduler *, scheduler);
 
 static const struct scheduler *schedulers[] = {
+#ifdef CONFIG_SCHED_CREDIT
     &sched_credit_def,
+#endif
+#ifdef CONFIG_SCHED_CREDIT2
     &sched_credit2_def,
+#endif
+#ifdef CONFIG_SCHED_ARINC653
     &sched_arinc653_def,
+#endif
+#ifdef CONFIG_SCHED_RTDS
     &sched_rtds_def,
+#endif
 };
 
 static struct scheduler __read_mostly ops;
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v6 3/5] build: Alloc space for sched list in the link file
  2016-01-15 17:01 [PATCH v6 0/5] Allow schedulers to be selectable through Kconfig Jonathan Creekmore
  2016-01-15 17:01 ` [PATCH v6 1/5] build: Env var to enable expert config options Jonathan Creekmore
  2016-01-15 17:01 ` [PATCH v6 2/5] build: Hook the schedulers into Kconfig Jonathan Creekmore
@ 2016-01-15 17:01 ` Jonathan Creekmore
  2016-01-20 14:34   ` Jonathan Creekmore
  2016-01-15 17:01 ` [PATCH v6 4/5] sched: Register the schedulers into the list Jonathan Creekmore
  2016-01-15 17:01 ` [PATCH v6 5/5] sched: Use the auto-generated list of schedulers Jonathan Creekmore
  4 siblings, 1 reply; 12+ messages in thread
From: Jonathan Creekmore @ 2016-01-15 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Jonathan Creekmore,
	Stefano Stabellini, Jan Beulich, Andrew Cooper

Creates a section to contain scheduler entry pointers that are gathered
together into an array. This will allow, in a follow-on patch, scheduler
entries to be automatically gathered together into the array for
automatic parsing.

CC: Ian Campbell <ian.campbell@citrix.com>
CC: Stefano Stabellini <stefano.stabellini@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.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>

---
Changed since v4:
  * Remove defensive check for schedulers since the credit scheduler
    must always be present

Changed since v3:
  * Add defensive check for schedulers in the linker

Changed since v1:
  * rename the __start and __end symbols to better match
    the rest of the file
---
 xen/arch/arm/xen.lds.S | 4 ++++
 xen/arch/x86/xen.lds.S | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 0488f37..f501a2f 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -57,6 +57,10 @@ SECTIONS
        . = ALIGN(PAGE_SIZE);
        *(.data.page_aligned)
        *(.data)
+       . = ALIGN(8);
+       __start_schedulers_array = .;
+       *(.data.schedulers)
+       __end_schedulers_array = .;
        *(.data.rel)
        *(.data.rel.*)
        CONSTRUCTORS
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index e18e08f..c1ce027 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -80,6 +80,10 @@ SECTIONS
        __stop___pre_ex_table = .;
 
        *(.data.read_mostly)
+       . = ALIGN(8);
+       __start_schedulers_array = .;
+       *(.data.schedulers)
+       __end_schedulers_array = .;
        *(.data.rel.ro)
        *(.data.rel.ro.*)
   } :text
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v6 4/5] sched: Register the schedulers into the list
  2016-01-15 17:01 [PATCH v6 0/5] Allow schedulers to be selectable through Kconfig Jonathan Creekmore
                   ` (2 preceding siblings ...)
  2016-01-15 17:01 ` [PATCH v6 3/5] build: Alloc space for sched list in the link file Jonathan Creekmore
@ 2016-01-15 17:01 ` Jonathan Creekmore
  2016-01-15 17:01 ` [PATCH v6 5/5] sched: Use the auto-generated list of schedulers Jonathan Creekmore
  4 siblings, 0 replies; 12+ messages in thread
From: Jonathan Creekmore @ 2016-01-15 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: George Dunlap, Jonathan Creekmore, Dario Faggioli,
	Josh Whitehead, Robert VanVossen

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 02afddf..1645f9c 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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v6 5/5] sched: Use the auto-generated list of schedulers
  2016-01-15 17:01 [PATCH v6 0/5] Allow schedulers to be selectable through Kconfig Jonathan Creekmore
                   ` (3 preceding siblings ...)
  2016-01-15 17:01 ` [PATCH v6 4/5] sched: Register the schedulers into the list Jonathan Creekmore
@ 2016-01-15 17:01 ` Jonathan Creekmore
  4 siblings, 0 replies; 12+ messages in thread
From: Jonathan Creekmore @ 2016-01-15 17:01 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Jonathan Creekmore, Dario Faggioli

Instead of having a manually-curated list of schedulers, use the array
that was auto-generated simply by compiling in the scheduler files as
the sole source of truth of the available schedulers.

CC: George Dunlap <george.dunlap@eu.citrix.com>
CC: Dario Faggioli <dario.faggioli@citrix.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>

---
Changed since v6:
  * Make schedulers a #define instead of a static const **

Changed since v5:
  * Remove extra size field that was accidentally left in

Changed since v1:
  * Simplify the calculation of the number of schedulers
  * Make the scheduler ops structures static to their files
---
 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/common/schedule.c       | 23 ++++++-----------------
 xen/include/xen/sched-if.h  |  5 -----
 6 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index 3b59514..0606988 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -724,7 +724,7 @@ a653sched_adjust_global(const struct scheduler *ops,
  * callback functions.
  * The symbol must be visible to the rest of Xen at link time.
  */
-const struct scheduler sched_arinc653_def = {
+static const struct scheduler sched_arinc653_def = {
     .name           = "ARINC 653 Scheduler",
     .opt_name       = "arinc653",
     .sched_id       = XEN_SCHEDULER_ARINC653,
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 1645f9c..03fb2c2 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1991,7 +1991,7 @@ static void csched_tick_resume(const struct scheduler *ops, unsigned int cpu)
 
 static struct csched_private _csched_priv;
 
-const struct scheduler sched_credit_def = {
+static const struct scheduler sched_credit_def = {
     .name           = "SMP Credit Scheduler",
     .opt_name       = "credit",
     .sched_id       = XEN_SCHEDULER_CREDIT,
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 38b02d0..78220a7 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -2194,7 +2194,7 @@ csched2_deinit(const struct scheduler *ops)
 
 static struct csched2_private _csched2_priv;
 
-const struct scheduler sched_credit2_def = {
+static const struct scheduler sched_credit2_def = {
     .name           = "SMP Credit Scheduler rev2",
     .opt_name       = "credit2",
     .sched_id       = XEN_SCHEDULER_CREDIT2,
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 7640cd0..2e5430f 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1170,7 +1170,7 @@ rt_dom_cntl(
 
 static struct rt_private _rt_priv;
 
-const struct scheduler sched_rtds_def = {
+static const struct scheduler sched_rtds_def = {
     .name           = "SMP RTDS Scheduler",
     .opt_name       = "rtds",
     .sched_id       = XEN_SCHEDULER_RTDS,
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 2f98a48..7306d71 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -64,20 +64,9 @@ static void poll_timer_fn(void *data);
 DEFINE_PER_CPU(struct schedule_data, schedule_data);
 DEFINE_PER_CPU(struct scheduler *, scheduler);
 
-static const struct scheduler *schedulers[] = {
-#ifdef CONFIG_SCHED_CREDIT
-    &sched_credit_def,
-#endif
-#ifdef CONFIG_SCHED_CREDIT2
-    &sched_credit2_def,
-#endif
-#ifdef CONFIG_SCHED_ARINC653
-    &sched_arinc653_def,
-#endif
-#ifdef CONFIG_SCHED_RTDS
-    &sched_rtds_def,
-#endif
-};
+extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_array[];
+#define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
+#define schedulers __start_schedulers_array
 
 static struct scheduler __read_mostly ops;
 
@@ -1468,7 +1457,7 @@ void __init scheduler_init(void)
 
     open_softirq(SCHEDULE_SOFTIRQ, schedule);
 
-    for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+    for ( i = 0; i < NUM_SCHEDULERS; i++)
     {
         if ( schedulers[i]->global_init && schedulers[i]->global_init() < 0 )
             schedulers[i] = NULL;
@@ -1479,7 +1468,7 @@ void __init scheduler_init(void)
     if ( !ops.name )
     {
         printk("Could not find scheduler: %s\n", opt_sched);
-        for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+        for ( i = 0; i < NUM_SCHEDULERS; i++ )
             if ( schedulers[i] )
             {
                 ops = *schedulers[i];
@@ -1599,7 +1588,7 @@ struct scheduler *scheduler_alloc(unsigned int sched_id, int *perr)
     int i;
     struct scheduler *sched;
 
-    for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+    for ( i = 0; i < NUM_SCHEDULERS; i++ )
         if ( schedulers[i] && schedulers[i]->sched_id == sched_id )
             goto found;
     *perr = -ENOENT;
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 9c6e0f5..66dc9c8 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -165,11 +165,6 @@ struct scheduler {
     void         (*tick_resume)     (const struct scheduler *, unsigned int);
 };
 
-extern const struct scheduler sched_credit_def;
-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;
 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v6 1/5] build: Env var to enable expert config options
  2016-01-15 17:01 ` [PATCH v6 1/5] build: Env var to enable expert config options Jonathan Creekmore
@ 2016-01-15 17:20   ` Jan Beulich
  2016-01-15 17:33     ` Jonathan Creekmore
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Beulich @ 2016-01-15 17:20 UTC (permalink / raw)
  To: Jonathan Creekmore
  Cc: xen-devel, Keir Fraser, Ian Jackson, Ian Campbell, Tim Deegan

>>> On 15.01.16 at 18:01, <jonathan.creekmore@gmail.com> wrote:
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -11,6 +11,7 @@ export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) |
>  export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
>  export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
>  export XEN_BUILD_HOST	?= $(shell hostname)
> +export XEN_CONFIG_EXPERT ?= n

This, I'm afraid, invalidates what I've said in another reply on
the earlier thread a few minutes ago. What Makefile.kconfig
gets to see must be consistent for FORCE to not be added to
include/config/auto.conf's dependencies by auto.conf.cmd.

Or in other words - did you check (in conjunction with that other
patch fixing incremental rebuilds) whether incremental rebuilds
aren't again becoming full rebuilds because of this when there's
no XEN_CONFIG_EXPERT in the environment?

Jan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v6 1/5] build: Env var to enable expert config options
  2016-01-15 17:20   ` Jan Beulich
@ 2016-01-15 17:33     ` Jonathan Creekmore
  2016-01-18  7:46       ` Jan Beulich
  0 siblings, 1 reply; 12+ messages in thread
From: Jonathan Creekmore @ 2016-01-15 17:33 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Keir Fraser, Ian Jackson, Ian Campbell, Tim Deegan


> On Jan 15, 2016, at 11:20 AM, Jan Beulich <JBeulich@suse.com> wrote:
> 
>>>> On 15.01.16 at 18:01, <jonathan.creekmore@gmail.com> wrote:
>> --- a/xen/Makefile
>> +++ b/xen/Makefile
>> @@ -11,6 +11,7 @@ export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) |
>> export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
>> export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
>> export XEN_BUILD_HOST	?= $(shell hostname)
>> +export XEN_CONFIG_EXPERT ?= n
> 
> This, I'm afraid, invalidates what I've said in another reply on
> the earlier thread a few minutes ago. What Makefile.kconfig
> gets to see must be consistent for FORCE to not be added to
> include/config/auto.conf's dependencies by auto.conf.cmd.
> 
> Or in other words - did you check (in conjunction with that other
> patch fixing incremental rebuilds) whether incremental rebuilds
> aren't again becoming full rebuilds because of this when there's
> no XEN_CONFIG_EXPERT in the environment?

I have applied your patch on top of my branch and I do not see incremental 
rebuilds becoming full rebuilds whether XEN_CONFIG_EXPERT is not in the
environment.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v6 1/5] build: Env var to enable expert config options
  2016-01-15 17:33     ` Jonathan Creekmore
@ 2016-01-18  7:46       ` Jan Beulich
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Beulich @ 2016-01-18  7:46 UTC (permalink / raw)
  To: Jonathan Creekmore
  Cc: xen-devel, Keir Fraser, Ian Jackson, Ian Campbell, Tim Deegan

>>> On 15.01.16 at 18:33, <jonathan.creekmore@gmail.com> wrote:

>> On Jan 15, 2016, at 11:20 AM, Jan Beulich <JBeulich@suse.com> wrote:
>> 
>>>>> On 15.01.16 at 18:01, <jonathan.creekmore@gmail.com> wrote:
>>> --- a/xen/Makefile
>>> +++ b/xen/Makefile
>>> @@ -11,6 +11,7 @@ export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && 
> /bin/dnsdomainname) |
>>> export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
>>> export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
>>> export XEN_BUILD_HOST	?= $(shell hostname)
>>> +export XEN_CONFIG_EXPERT ?= n
>> 
>> This, I'm afraid, invalidates what I've said in another reply on
>> the earlier thread a few minutes ago. What Makefile.kconfig
>> gets to see must be consistent for FORCE to not be added to
>> include/config/auto.conf's dependencies by auto.conf.cmd.
>> 
>> Or in other words - did you check (in conjunction with that other
>> patch fixing incremental rebuilds) whether incremental rebuilds
>> aren't again becoming full rebuilds because of this when there's
>> no XEN_CONFIG_EXPERT in the environment?
> 
> I have applied your patch on top of my branch and I do not see incremental 
> rebuilds becoming full rebuilds whether XEN_CONFIG_EXPERT is not in the
> environment.

Thanks; indeed I've meanwhile realized that the "export" here
should be taking care of avoiding that situation

Jan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v6 2/5] build: Hook the schedulers into Kconfig
  2016-01-15 17:01 ` [PATCH v6 2/5] build: Hook the schedulers into Kconfig Jonathan Creekmore
@ 2016-01-19 10:55   ` Dario Faggioli
  0 siblings, 0 replies; 12+ messages in thread
From: Dario Faggioli @ 2016-01-19 10:55 UTC (permalink / raw)
  To: Jonathan Creekmore, xen-devel; +Cc: George Dunlap


[-- Attachment #1.1: Type: text/plain, Size: 1982 bytes --]

On Fri, 2016-01-15 at 11:01 -0600, Jonathan Creekmore wrote:
> Allow the schedulers to be independently enabled or disabled at
> compile-time. To match existing behavior, all four schedulers are
> compiled in by default, although the Credit2, RTDS, and ARINC653 are
> marked EXPERIMENTAL to match their not currently supported status.
> 
> CC: George Dunlap <george.dunlap@eu.citrix.com>
> CC: Dario Faggioli <dario.faggioli@citrix.com>
> Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
> Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
> 
> ---
> 
> diff --git a/xen/common/Kconfig b/xen/common/Kconfig
> index eadfc3b..7cc99c7 100644
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> 
> diff --git a/xen/common/Makefile b/xen/common/Makefile
> index 9f8b214..4df71ee 100644
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile

The above changes looks fine to me, but I really speak almost no
Kconfig. :-/

On the rest of the patch, I only have one comment.

> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index d121896..2f98a48 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -65,10 +65,18 @@ DEFINE_PER_CPU(struct schedule_data,
> schedule_data);
>  DEFINE_PER_CPU(struct scheduler *, scheduler);
>  
>  static const struct scheduler *schedulers[] = {
> +#ifdef CONFIG_SCHED_CREDIT
>      &sched_credit_def,
> +#endif
>
If I understood correctly, Credit is always going to be there, so I
guess these #ifdef could go away?

However, since this is just killed later, I don't think it should block
the patch (series). So:

Acked-by: Dario Faggioli <dario.faggioli@citrix.com>

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v6 3/5] build: Alloc space for sched list in the link file
  2016-01-15 17:01 ` [PATCH v6 3/5] build: Alloc space for sched list in the link file Jonathan Creekmore
@ 2016-01-20 14:34   ` Jonathan Creekmore
  2016-01-20 14:45     ` Ian Campbell
  0 siblings, 1 reply; 12+ messages in thread
From: Jonathan Creekmore @ 2016-01-20 14:34 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Stefano Stabellini, Ian Campbell, Jan Beulich,
	Andrew Cooper


> On Jan 15, 2016, at 11:01 AM, Jonathan Creekmore <jonathan.creekmore@gmail.com> wrote:
> 
> Creates a section to contain scheduler entry pointers that are gathered
> together into an array. This will allow, in a follow-on patch, scheduler
> entries to be automatically gathered together into the array for
> automatic parsing.
> 
> CC: Ian Campbell <ian.campbell@citrix.com>
> CC: Stefano Stabellini <stefano.stabellini@citrix.com>
> CC: Keir Fraser <keir@xen.org>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.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>
> 
> ---
> Changed since v4:
>  * Remove defensive check for schedulers since the credit scheduler
>    must always be present
> 
> Changed since v3:
>  * Add defensive check for schedulers in the linker
> 
> Changed since v1:
>  * rename the __start and __end symbols to better match
>    the rest of the file
> ---
> xen/arch/arm/xen.lds.S | 4 ++++
> xen/arch/x86/xen.lds.S | 4 ++++
> 2 files changed, 8 insertions(+)
> 
> diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
> index 0488f37..f501a2f 100644
> --- a/xen/arch/arm/xen.lds.S
> +++ b/xen/arch/arm/xen.lds.S
> @@ -57,6 +57,10 @@ SECTIONS
>        . = ALIGN(PAGE_SIZE);
>        *(.data.page_aligned)
>        *(.data)
> +       . = ALIGN(8);
> +       __start_schedulers_array = .;
> +       *(.data.schedulers)
> +       __end_schedulers_array = .;
>        *(.data.rel)
>        *(.data.rel.*)
>        CONSTRUCTORS
> diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
> index e18e08f..c1ce027 100644
> --- a/xen/arch/x86/xen.lds.S
> +++ b/xen/arch/x86/xen.lds.S
> @@ -80,6 +80,10 @@ SECTIONS
>        __stop___pre_ex_table = .;
> 
>        *(.data.read_mostly)
> +       . = ALIGN(8);
> +       __start_schedulers_array = .;
> +       *(.data.schedulers)
> +       __end_schedulers_array = .;
>        *(.data.rel.ro)
>        *(.data.rel.ro.*)
>   } :text
> -- 
> 2.6.4


I am pretty sure, with Dario’s latest ACK on (2/5), that this patch is the only one in the series that has not been 
ACKed yet. Is there anything else that I need to do to get this series in, especially since the (1/5) CONFIG_EXPERT
patch has already landed?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v6 3/5] build: Alloc space for sched list in the link file
  2016-01-20 14:34   ` Jonathan Creekmore
@ 2016-01-20 14:45     ` Ian Campbell
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Campbell @ 2016-01-20 14:45 UTC (permalink / raw)
  To: Jonathan Creekmore, xen-devel
  Cc: Keir Fraser, Stefano Stabellini, Jan Beulich, Andrew Cooper

On Wed, 2016-01-20 at 08:34 -0600, Jonathan Creekmore wrote:
> > 
> > diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
> > index 0488f37..f501a2f 100644
> > --- a/xen/arch/arm/xen.lds.S
> > +++ b/xen/arch/arm/xen.lds.S
> > @@ -57,6 +57,10 @@ SECTIONS
> >        . = ALIGN(PAGE_SIZE);
> >        *(.data.page_aligned)
> >        *(.data)
> > +       . = ALIGN(8);
> > +       __start_schedulers_array = .;
> > +       *(.data.schedulers)
> > +       __end_schedulers_array = .;
> >        *(.data.rel)
> >        *(.data.rel.*)
> >        CONSTRUCTORS

For this ARM change:
Acked-by: Ian Campbell <ian.campbell@citrix.com>

(FWIW I'd have done #3, #4 and #5 all in one patch, but no need to rework
now).

Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-01-20 14:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15 17:01 [PATCH v6 0/5] Allow schedulers to be selectable through Kconfig Jonathan Creekmore
2016-01-15 17:01 ` [PATCH v6 1/5] build: Env var to enable expert config options Jonathan Creekmore
2016-01-15 17:20   ` Jan Beulich
2016-01-15 17:33     ` Jonathan Creekmore
2016-01-18  7:46       ` Jan Beulich
2016-01-15 17:01 ` [PATCH v6 2/5] build: Hook the schedulers into Kconfig Jonathan Creekmore
2016-01-19 10:55   ` Dario Faggioli
2016-01-15 17:01 ` [PATCH v6 3/5] build: Alloc space for sched list in the link file Jonathan Creekmore
2016-01-20 14:34   ` Jonathan Creekmore
2016-01-20 14:45     ` Ian Campbell
2016-01-15 17:01 ` [PATCH v6 4/5] sched: Register the schedulers into the list Jonathan Creekmore
2016-01-15 17:01 ` [PATCH v6 5/5] sched: Use the auto-generated list of schedulers Jonathan Creekmore

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.