lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 04 Dec 2009 14:59:18 +0530
From:	Suresh Jayaraman <sjayaraman@...e.de>
To:	mingo@...e.hu, Peter Zijlstra <peterz@...radead.org>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: [RFC][PATCH] sched: fix GENTLE_FAIR_SLEEPERS dependency

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@...e.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;
 		}
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ