public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] sched: fix GENTLE_FAIR_SLEEPERS dependency
@ 2009-12-04  9:29 Suresh Jayaraman
  2009-12-04  9:54 ` Ingo Molnar
  2009-12-04 10:06 ` Mike Galbraith
  0 siblings, 2 replies; 10+ messages in thread
From: Suresh Jayaraman @ 2009-12-04  9:29 UTC (permalink / raw)
  To: mingo, Peter Zijlstra; +Cc: LKML

The newly introduced GENTLE_FAIR_SLEEPERS does not seem to have any
effect without FAIR_SLEEPERS. Fix sysctl.sched_features to reflect
this. Without this change, a user who sets GENTLE_FAIR_SLEEPERS
without FAIR_SLEEPERS would assume gentle sleeper fairness which
is not guaranteed.

Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
---

Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ linux-2.6/kernel/sched.c
@@ -761,10 +761,22 @@ sched_feat_write(struct file *filp, cons
 		int len = strlen(sched_feat_names[i]);
 
 		if (strncmp(cmp, sched_feat_names[i], len) == 0) {
-			if (neg)
+			if (neg) {
 				sysctl_sched_features &= ~(1UL << i);
-			else
+				/*
+				 * GENTLE_FAIR_SLEEPERS have no effect without
+				 * FAIR_SLEEPERS.
+				 */
+				if (strncmp(cmp, "FAIR_SLEEPERS",
+					    strlen("FAIR_SLEEPERS")) == 0)
+					sysctl_sched_features &= ~(1UL << i+1);
+			} else {
 				sysctl_sched_features |= (1UL << i);
+				if (strncmp(cmp, "GENTLE_FAIR_SLEEPERS",
+					    strlen("GENTLE_FAIR_SLEEPERS"))
+						== 0)
+					sysctl_sched_features |= (1UL << i-1);
+			}
 			break;
 		}
 	}

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

end of thread, other threads:[~2009-12-04 13:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-04  9:29 [RFC][PATCH] sched: fix GENTLE_FAIR_SLEEPERS dependency Suresh Jayaraman
2009-12-04  9:54 ` Ingo Molnar
2009-12-04 10:20   ` Suresh Jayaraman
2009-12-04 11:08     ` Peter Zijlstra
2009-12-04 11:12       ` Peter Zijlstra
2009-12-04 11:42       ` Suresh Jayaraman
2009-12-04 12:08         ` Peter Zijlstra
2009-12-04 13:12           ` Suresh Jayaraman
2009-12-04 13:12         ` Mike Galbraith
2009-12-04 10:06 ` Mike Galbraith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox