diff mbox series

[v2,1/9] xen/sched: move schedulers and cpupool coding to dedicated directory

Message ID 20200108152328.27194-2-jgross@suse.com (mailing list archive)
State New, archived
Headers show
Series xen: scheduler cleanups | expand

Commit Message

Jürgen Groß Jan. 8, 2020, 3:23 p.m. UTC
Move sched*c and cpupool.c to a new directory common/sched.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- renamed sources (Dario Faggioli, Andrew Cooper)
---
 MAINTAINERS                                       |  8 +--
 xen/common/Kconfig                                | 66 +----------------------
 xen/common/Makefile                               |  8 +--
 xen/common/sched/Kconfig                          | 65 ++++++++++++++++++++++
 xen/common/sched/Makefile                         |  7 +++
 xen/common/{sched_arinc653.c => sched/arinc653.c} |  0
 xen/common/{compat/schedule.c => sched/compat.c}  |  2 +-
 xen/common/{schedule.c => sched/core.c}           |  2 +-
 xen/common/{ => sched}/cpupool.c                  |  0
 xen/common/{sched_credit.c => sched/credit.c}     |  0
 xen/common/{sched_credit2.c => sched/credit2.c}   |  0
 xen/common/{sched_null.c => sched/null.c}         |  0
 xen/common/{sched_rt.c => sched/rt.c}             |  0
 13 files changed, 80 insertions(+), 78 deletions(-)
 create mode 100644 xen/common/sched/Kconfig
 create mode 100644 xen/common/sched/Makefile
 rename xen/common/{sched_arinc653.c => sched/arinc653.c} (100%)
 rename xen/common/{compat/schedule.c => sched/compat.c} (97%)
 rename xen/common/{schedule.c => sched/core.c} (99%)
 rename xen/common/{ => sched}/cpupool.c (100%)
 rename xen/common/{sched_credit.c => sched/credit.c} (100%)
 rename xen/common/{sched_credit2.c => sched/credit2.c} (100%)
 rename xen/common/{sched_null.c => sched/null.c} (100%)
 rename xen/common/{sched_rt.c => sched/rt.c} (100%)

Comments

Dario Faggioli Jan. 22, 2020, 1:03 p.m. UTC | #1
On Wed, 2020-01-08 at 16:23 +0100, Juergen Gross wrote:
> Move sched*c and cpupool.c to a new directory common/sched.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - renamed sources (Dario Faggioli, Andrew Cooper)
>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

Regards
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index eaea4620e2..9d2ac631ba 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -174,7 +174,7 @@  M:	Josh Whitehead <josh.whitehead@dornerworks.com>
 M:	Stewart Hildebrand <stewart.hildebrand@dornerworks.com>
 S:	Supported
 L:	DornerWorks Xen-Devel <xen-devel@dornerworks.com>
-F:	xen/common/sched_arinc653.c
+F:	xen/common/sched/arinc653.c
 F:	tools/libxc/xc_arinc653.c
 
 ARM (W/ VIRTUALISATION EXTENSIONS) ARCHITECTURE
@@ -212,7 +212,7 @@  CPU POOLS
 M:	Juergen Gross <jgross@suse.com>
 M:	Dario Faggioli <dfaggioli@suse.com>
 S:	Supported
-F:	xen/common/cpupool.c
+F:	xen/common/sched/cpupool.c
 
 DEVICE TREE
 M:	Stefano Stabellini <sstabellini@kernel.org>
@@ -378,13 +378,13 @@  RTDS SCHEDULER
 M:	Dario Faggioli <dfaggioli@suse.com>
 M:	Meng Xu <mengxu@cis.upenn.edu>
 S:	Supported
-F:	xen/common/sched_rt.c
+F:	xen/common/sched/rt.c
 
 SCHEDULING
 M:	George Dunlap <george.dunlap@eu.citrix.com>
 M:	Dario Faggioli <dfaggioli@suse.com>
 S:	Supported
-F:	xen/common/sched*
+F:	xen/common/sched/
 
 SEABIOS UPSTREAM
 M:	Wei Liu <wl@xen.org>
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index b3d161d057..9d6d09eb37 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -275,71 +275,7 @@  config ARGO
 
 	  If unsure, say N.
 
-menu "Schedulers"
-	visible if EXPERT = "y"
-
-config SCHED_CREDIT
-	bool "Credit scheduler support"
-	default y
-	---help---
-	  The traditional credit scheduler is a general purpose scheduler.
-
-config SCHED_CREDIT2
-	bool "Credit2 scheduler support"
-	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 DEBUG
-	---help---
-	  The ARINC653 scheduler is a hard real-time scheduler for single
-	  cores, targeted for avionics, drones, and medical devices.
-
-config SCHED_NULL
-	bool "Null scheduler support (EXPERIMENTAL)"
-	default y
-	---help---
-	  The null scheduler is a static, zero overhead scheduler,
-	  for when there always are less vCPUs than pCPUs, typically
-	  in embedded or HPC scenarios.
-
-choice
-	prompt "Default Scheduler?"
-	default SCHED_CREDIT2_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
-	config SCHED_NULL_DEFAULT
-		bool "Null Scheduler" if SCHED_NULL
-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 "null" if SCHED_NULL_DEFAULT
-	default "credit2"
-
-endmenu
+source "common/sched/Kconfig"
 
 config CRYPTO
 	bool
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 62b34e69e9..2abb8250b0 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -3,7 +3,6 @@  obj-y += bitmap.o
 obj-y += bsearch.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
-obj-y += cpupool.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
 obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
 obj-y += domctl.o
@@ -38,12 +37,6 @@  obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += rcupdate.o
 obj-y += rwlock.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-$(CONFIG_SCHED_NULL) += sched_null.o
-obj-y += schedule.o
 obj-y += shutdown.o
 obj-y += softirq.o
 obj-y += sort.o
@@ -74,6 +67,7 @@  obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall
 extra-y := symbols-dummy.o
 
 subdir-$(CONFIG_COVERAGE) += coverage
+subdir-y += sched
 subdir-$(CONFIG_UBSAN) += ubsan
 
 subdir-$(CONFIG_NEEDS_LIBELF) += libelf
diff --git a/xen/common/sched/Kconfig b/xen/common/sched/Kconfig
new file mode 100644
index 0000000000..883ac87cab
--- /dev/null
+++ b/xen/common/sched/Kconfig
@@ -0,0 +1,65 @@ 
+menu "Schedulers"
+	visible if EXPERT = "y"
+
+config SCHED_CREDIT
+	bool "Credit scheduler support"
+	default y
+	---help---
+	  The traditional credit scheduler is a general purpose scheduler.
+
+config SCHED_CREDIT2
+	bool "Credit2 scheduler support"
+	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 DEBUG
+	---help---
+	  The ARINC653 scheduler is a hard real-time scheduler for single
+	  cores, targeted for avionics, drones, and medical devices.
+
+config SCHED_NULL
+	bool "Null scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The null scheduler is a static, zero overhead scheduler,
+	  for when there always are less vCPUs than pCPUs, typically
+	  in embedded or HPC scenarios.
+
+choice
+	prompt "Default Scheduler?"
+	default SCHED_CREDIT2_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
+	config SCHED_NULL_DEFAULT
+		bool "Null Scheduler" if SCHED_NULL
+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 "null" if SCHED_NULL_DEFAULT
+	default "credit2"
+
+endmenu
diff --git a/xen/common/sched/Makefile b/xen/common/sched/Makefile
new file mode 100644
index 0000000000..3537f2a68d
--- /dev/null
+++ b/xen/common/sched/Makefile
@@ -0,0 +1,7 @@ 
+obj-y += cpupool.o
+obj-$(CONFIG_SCHED_ARINC653) += arinc653.o
+obj-$(CONFIG_SCHED_CREDIT) += credit.o
+obj-$(CONFIG_SCHED_CREDIT2) += credit2.o
+obj-$(CONFIG_SCHED_RTDS) += rt.o
+obj-$(CONFIG_SCHED_NULL) += null.o
+obj-y += core.o
diff --git a/xen/common/sched_arinc653.c b/xen/common/sched/arinc653.c
similarity index 100%
rename from xen/common/sched_arinc653.c
rename to xen/common/sched/arinc653.c
diff --git a/xen/common/compat/schedule.c b/xen/common/sched/compat.c
similarity index 97%
rename from xen/common/compat/schedule.c
rename to xen/common/sched/compat.c
index 8b6e6f107d..040b4caca2 100644
--- a/xen/common/compat/schedule.c
+++ b/xen/common/sched/compat.c
@@ -37,7 +37,7 @@  static int compat_poll(struct compat_sched_poll *compat)
 #define do_poll compat_poll
 #define sched_poll compat_sched_poll
 
-#include "../schedule.c"
+#include "core.c"
 
 int compat_set_timer_op(u32 lo, s32 hi)
 {
diff --git a/xen/common/schedule.c b/xen/common/sched/core.c
similarity index 99%
rename from xen/common/schedule.c
rename to xen/common/sched/core.c
index 54a07ff9e8..4d8eb4c617 100644
--- a/xen/common/schedule.c
+++ b/xen/common/sched/core.c
@@ -3128,7 +3128,7 @@  void __init sched_setup_dom0_vcpus(struct domain *d)
 #endif
 
 #ifdef CONFIG_COMPAT
-#include "compat/schedule.c"
+#include "compat.c"
 #endif
 
 #endif /* !COMPAT */
diff --git a/xen/common/cpupool.c b/xen/common/sched/cpupool.c
similarity index 100%
rename from xen/common/cpupool.c
rename to xen/common/sched/cpupool.c
diff --git a/xen/common/sched_credit.c b/xen/common/sched/credit.c
similarity index 100%
rename from xen/common/sched_credit.c
rename to xen/common/sched/credit.c
diff --git a/xen/common/sched_credit2.c b/xen/common/sched/credit2.c
similarity index 100%
rename from xen/common/sched_credit2.c
rename to xen/common/sched/credit2.c
diff --git a/xen/common/sched_null.c b/xen/common/sched/null.c
similarity index 100%
rename from xen/common/sched_null.c
rename to xen/common/sched/null.c
diff --git a/xen/common/sched_rt.c b/xen/common/sched/rt.c
similarity index 100%
rename from xen/common/sched_rt.c
rename to xen/common/sched/rt.c