Subject: sched: reinstate FAIR_SLEEPERS feature
From: Mike Galbraith <mgalbraith@suse.de>
Date: Tue Oct 18 15:16:42 CEST 2011
Patch-mainline: Never
References: bnc#724577

S390 does a lot of heavy lifting batch processing, where wakeup
preemption is neither desired nor beneficial.  SLE11-SP1 had
FAIR_SLEEPERS turned off because of this, but SP2 has no knob,
and mistakenly wired up CONFIG_FAIR_SLEEPERS_ON_BY_DEFAULT to
GENTLE_FAIR_SLEEPERS, applying full sleeper fairness only to
S390, where previously there was none at all.

Per agreement with IBM, restore the feature, but unlike SP1,
enable it for s390.  This makes FAIR_SLEEPERS_ON_BY_DEFAULT
superfluous, as all arches now have FAIR_SLEEPERS enabled, so
remove the config option.

Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
---
 arch/Kconfig            |    3 ---
 kernel/sched_fair.c     |    2 +-
 kernel/sched_features.h |   11 +++++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

Index: linux-3.0-SLE11-SP2/kernel/sched_fair.c
===================================================================
--- linux-3.0-SLE11-SP2.orig/kernel/sched_fair.c
+++ linux-3.0-SLE11-SP2/kernel/sched_fair.c
@@ -959,7 +959,7 @@ place_entity(struct cfs_rq *cfs_rq, stru
 		vruntime += sched_vslice(cfs_rq, se);
 
 	/* sleeps up to a single latency don't count. */
-	if (!initial) {
+	if (!initial && sched_feat(FAIR_SLEEPERS)) {
 		unsigned long thresh = sysctl_sched_latency;
 
 		/*
Index: linux-3.0-SLE11-SP2/kernel/sched_features.h
===================================================================
--- linux-3.0-SLE11-SP2.orig/kernel/sched_features.h
+++ linux-3.0-SLE11-SP2/kernel/sched_features.h
@@ -1,13 +1,16 @@
 /*
+ * Disregards a certain amount of sleep time (sched_latency_ns) and
+ * considers the task to be running during that period. This gives it
+ * a service deficit on wakeup, allowing it to run sooner.
+ */
+SCHED_FEAT(FAIR_SLEEPERS, 1)
+
+/*
  * Only give sleepers 50% of their service deficit. This allows
  * them to run sooner, but does not allow tons of sleepers to
  * rip the spread apart.
  */
-#ifdef CONFIG_FAIR_SLEEPERS_ON_BY_DEFAULT
 SCHED_FEAT(GENTLE_FAIR_SLEEPERS, 1)
-#else
-SCHED_FEAT(GENTLE_FAIR_SLEEPERS, 0)
-#endif
 
 /*
  * Place new tasks ahead so that they do not starve already running
Index: linux-3.0-SLE11-SP2/arch/Kconfig
===================================================================
--- linux-3.0-SLE11-SP2.orig/arch/Kconfig
+++ linux-3.0-SLE11-SP2/arch/Kconfig
@@ -180,6 +180,3 @@ config HAVE_RCU_TABLE_FREE
 
 source "kernel/gcov/Kconfig"
 
-config FAIR_SLEEPERS_ON_BY_DEFAULT
-	bool
-	default y if !S390
