public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Suresh Jayaraman <sjayaraman@suse.de>
To: mingo@elte.hu, Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [RFC][PATCH] sched: fix GENTLE_FAIR_SLEEPERS dependency
Date: Fri, 04 Dec 2009 14:59:18 +0530	[thread overview]
Message-ID: <4B18D66E.8020905@suse.de> (raw)

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;
 		}
 	}

             reply	other threads:[~2009-12-04  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04  9:29 Suresh Jayaraman [this message]
2009-12-04  9:54 ` [RFC][PATCH] sched: fix GENTLE_FAIR_SLEEPERS dependency 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B18D66E.8020905@suse.de \
    --to=sjayaraman@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox