mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Clouter <alex-kernel@digriz.org.uk>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Cc: davej@redhat.com, davej@codemonkey.org.uk, blaisorblade@yahoo.it
Subject: [patch 1/1] cpufreq_conservative/ondemand: invert meaning of 'ignore nice'
Date: Thu, 10 Nov 2005 15:11:11 +0000	[thread overview]
Message-ID: <20051110151111.GA16994@inskipp.digriz.org.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 752 bytes --]

The use of the 'ignore_nice' sysfs file is confusing to anyone using it.  
This removes the sysfs file 'ignore_nice' and in its place creates a 
'ignore_nice_load' entry which defaults to '1'; meaning nice'd processes are 
not counted towards the 'business' caclulation.

WARNING: this obvious breaks any userland tools that expected 'ignore_nice' 
to exist, to draw attention to this fact it was concluded on the mailing list 
that the entry should be removed altogether so the userland app breaks and so 
the author can build simple to detect workaround.  Having said that it seems 
currently very few tools even make use of this functionality; all I could 
find was a Gentoo Wiki entry.

Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk>

[-- Attachment #2: 01_inverse_ignore_nice_flag.diff --]
[-- Type: text/plain, Size: 3704 bytes --]

diff -r -u -d linux-2.6.14-rc2.orig/drivers/cpufreq/cpufreq_conservative.c \
                linux-2.6.14-rc2/drivers/cpufreq/cpufreq_conservative.c
--- linux-2.6.14-rc2.orig/drivers/cpufreq/cpufreq_conservative.c	2005-10-03 \
                20:05:30.742334750 +0100
+++ linux-2.6.14-rc2/drivers/cpufreq/cpufreq_conservative.c	2005-10-06 \
21:10:47.785133750 +0100 @@ -93,7 +93,7 @@
 {
 	return	kstat_cpu(cpu).cpustat.idle +
 		kstat_cpu(cpu).cpustat.iowait +
-		( !dbs_tuners_ins.ignore_nice ? 
+		( dbs_tuners_ins.ignore_nice ? 
 		  kstat_cpu(cpu).cpustat.nice :
 		  0);
 }
@@ -127,7 +127,7 @@
 show_one(sampling_down_factor, sampling_down_factor);
 show_one(up_threshold, up_threshold);
 show_one(down_threshold, down_threshold);
-show_one(ignore_nice, ignore_nice);
+show_one(ignore_nice_load, ignore_nice);
 show_one(freq_step, freq_step);
 
 static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, 
@@ -207,7 +207,7 @@
 	return count;
 }
 
-static ssize_t store_ignore_nice(struct cpufreq_policy *policy,
+static ssize_t store_ignore_nice_load(struct cpufreq_policy *policy,
 		const char *buf, size_t count)
 {
 	unsigned int input;
@@ -272,7 +272,7 @@
 define_one_rw(sampling_down_factor);
 define_one_rw(up_threshold);
 define_one_rw(down_threshold);
-define_one_rw(ignore_nice);
+define_one_rw(ignore_nice_load);
 define_one_rw(freq_step);
 
 static struct attribute * dbs_attributes[] = {
@@ -282,7 +282,7 @@
 	&sampling_down_factor.attr,
 	&up_threshold.attr,
 	&down_threshold.attr,
-	&ignore_nice.attr,
+	&ignore_nice_load.attr,
 	&freq_step.attr,
 	NULL
 };
@@ -515,7 +515,7 @@
 			def_sampling_rate = (latency / 1000) *
 					DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
 			dbs_tuners_ins.sampling_rate = def_sampling_rate;
-			dbs_tuners_ins.ignore_nice = 0;
+			dbs_tuners_ins.ignore_nice = 1;
 			dbs_tuners_ins.freq_step = 5;
 
 			dbs_timer_init();
diff -r -u -d linux-2.6.14-rc2.orig/drivers/cpufreq/cpufreq_ondemand.c \
                linux-2.6.14-rc2/drivers/cpufreq/cpufreq_ondemand.c
--- linux-2.6.14-rc2.orig/drivers/cpufreq/cpufreq_ondemand.c	2005-10-03 \
                20:05:30.742334750 +0100
+++ linux-2.6.14-rc2/drivers/cpufreq/cpufreq_ondemand.c	2005-10-06 21:10:23.979646000 \
+0100 @@ -86,7 +86,7 @@
 {
 	return	kstat_cpu(cpu).cpustat.idle +
 		kstat_cpu(cpu).cpustat.iowait +
-		( !dbs_tuners_ins.ignore_nice ? 
+		( dbs_tuners_ins.ignore_nice ? 
 		  kstat_cpu(cpu).cpustat.nice :
 		  0);
 }
@@ -119,7 +119,7 @@
 show_one(sampling_rate, sampling_rate);
 show_one(sampling_down_factor, sampling_down_factor);
 show_one(up_threshold, up_threshold);
-show_one(ignore_nice, ignore_nice);
+show_one(ignore_nice_load, ignore_nice);
 
 static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, 
 		const char *buf, size_t count)
@@ -179,7 +179,7 @@
 	return count;
 }
 
-static ssize_t store_ignore_nice(struct cpufreq_policy *policy,
+static ssize_t store_ignore_load_tasks(struct cpufreq_policy *policy,
 		const char *buf, size_t count)
 {
 	unsigned int input;
@@ -220,7 +220,7 @@
 define_one_rw(sampling_rate);
 define_one_rw(sampling_down_factor);
 define_one_rw(up_threshold);
-define_one_rw(ignore_nice);
+define_one_rw(ignore_nice_load);
 
 static struct attribute * dbs_attributes[] = {
 	&sampling_rate_max.attr,
@@ -228,7 +228,7 @@
 	&sampling_rate.attr,
 	&sampling_down_factor.attr,
 	&up_threshold.attr,
-	&ignore_nice.attr,
+	&ignore_nice_load.attr,
 	NULL
 };
 
@@ -424,7 +424,7 @@
 			def_sampling_rate = (latency / 1000) *
 					DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
 			dbs_tuners_ins.sampling_rate = def_sampling_rate;
-			dbs_tuners_ins.ignore_nice = 0;
+			dbs_tuners_ins.ignore_nice = 1;
 
 			dbs_timer_init();
 		}

             reply	other threads:[~2005-11-10 15:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-10 15:11 Alexander Clouter [this message]
2005-11-10 15:48 ` Con Kolivas
2005-11-10 15:54   ` Alexander Clouter
2005-11-13 19:59   ` Pavel Machek
2005-11-18 12:07   ` Stefan Seyfried
2005-11-21 15:29 ` Dave Jones
2005-11-10 17:00 Alexander Clouter
2005-11-10 23:12 ` Con Kolivas
2005-11-11  9:09   ` Alexander Clouter
2005-11-12  3:30 Pallipadi, Venkatesh
2005-11-21 18:17 Alexander Clouter
2005-11-22  1:21 ` Ken Moffat
2005-11-22  2:22   ` Dave Jones
2005-11-22  2:31     ` Con Kolivas
2005-11-22 11:43       ` Ken Moffat
2005-11-22  8:52   ` Alexander Clouter
2005-11-22 11:38     ` Ken Moffat
2005-11-23  9:46 ` Andrew Morton

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=20051110151111.GA16994@inskipp.digriz.org.uk \
    --to=alex-kernel@digriz.org.uk \
    --cc=akpm@osdl.org \
    --cc=blaisorblade@yahoo.it \
    --cc=davej@codemonkey.org.uk \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome