summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCon Kolivas <kernel@kolivas.org>2016-12-06 17:01:28 +1100
committerCon Kolivas <kernel@kolivas.org>2016-12-06 17:01:28 +1100
commite4d2e01f84338d948be51202038842fe3e0f6ce9 (patch)
treeff8d0acd1246f82c14c7f8b86e03b0a042d5bec8
parent55fdaf70d2401d34cb0eeebb0d399a4a69100828 (diff)
Implement a yield_type for MuQSS with a tunable in sysctl and documentation, bumping version to 0.150
-rw-r--r--Documentation/sysctl/kernel.txt11
-rw-r--r--kernel/sched/MuQSS.c26
-rw-r--r--kernel/sysctl.c10
3 files changed, 40 insertions, 7 deletions
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 01e0a4a861e3..2a82a37242a5 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -95,6 +95,7 @@ show up in /proc/sys/kernel:
- unknown_nmi_panic
- watchdog
- watchdog_thresh
+- yield_type
- version
==============================================================
@@ -1082,3 +1083,13 @@ The softlockup threshold is (2 * watchdog_thresh). Setting this
tunable to zero will disable lockup detection altogether.
==============================================================
+
+yield_type: (MuQSS CPU scheduler only)
+
+This determines what type of yield calls to sched_yield will perform.
+
+ 0: No yield.
+ 1: Yield only to better priority/deadline tasks. (default)
+ 2: Expire timeslice and recalculate deadline.
+
+==============================================================
diff --git a/kernel/sched/MuQSS.c b/kernel/sched/MuQSS.c
index 18cb55ded3b7..7617ae49ab09 100644
--- a/kernel/sched/MuQSS.c
+++ b/kernel/sched/MuQSS.c
@@ -137,19 +137,20 @@
void print_scheduler_version(void)
{
- printk(KERN_INFO "MuQSS CPU scheduler v0.144 by Con Kolivas.\n");
+ printk(KERN_INFO "MuQSS CPU scheduler v0.150 by Con Kolivas.\n");
}
/*
* This is the time all tasks within the same priority round robin.
- * Value is in ms and set to a minimum of 6ms. Scales with number of cpus.
+ * Value is in ms and set to a minimum of 6ms.
* Tunable via /proc interface.
*/
int rr_interval __read_mostly = 6;
-/* Tunable to choose whether to prioritise latency or throughput, simple
- * binary yes or no */
-
+/*
+ * Tunable to choose whether to prioritise latency or throughput, simple
+ * binary yes or no
+ */
int sched_interactive __read_mostly = 1;
/*
@@ -160,6 +161,14 @@ int sched_interactive __read_mostly = 1;
int sched_iso_cpu __read_mostly = 70;
/*
+ * sched_yield_type - Choose what sort of yield sched_yield will perform.
+ * 0: No yield.
+ * 1: Yield only to better priority/deadline tasks. (default)
+ * 2: Expire timeslice and recalculate deadline.
+ */
+int sched_yield_type __read_mostly = 1;
+
+/*
* The relative length of deadline for each priority(nice) level.
*/
static int prio_ratios[NICE_WIDTH] __read_mostly;
@@ -5077,9 +5086,12 @@ SYSCALL_DEFINE0(sched_yield)
struct task_struct *p;
struct rq *rq;
+ if (!sched_yield_type)
+ goto out;
p = current;
rq = this_rq_lock();
- time_slice_expired(p, rq);
+ if (sched_yield_type > 1)
+ time_slice_expired(p, rq);
schedstat_inc(rq->yld_count);
/*
@@ -5092,7 +5104,7 @@ SYSCALL_DEFINE0(sched_yield)
sched_preempt_enable_no_resched();
schedule();
-
+out:
return 0;
}
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index d7a4df09cf58..2557e03c3c0d 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -131,6 +131,7 @@ static int __read_mostly one_thousand = 1000;
extern int rr_interval;
extern int sched_interactive;
extern int sched_iso_cpu;
+extern int sched_yield_type;
#endif
#ifdef CONFIG_PRINTK
static int ten_thousand = 10000;
@@ -1048,6 +1049,15 @@ static struct ctl_table kern_table[] = {
.extra1 = &zero,
.extra2 = &one_hundred,
},
+ {
+ .procname = "yield_type",
+ .data = &sched_yield_type,
+ .maxlen = sizeof (int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec_minmax,
+ .extra1 = &zero,
+ .extra2 = &two,
+ },
#endif
#if defined(CONFIG_S390) && defined(CONFIG_SMP)
{