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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 23 Dec 2010 14:17:04 +0800
From:	Youquan Song <youquan.song@...el.com>
To:	davej@...hat.com, cpufreq@...r.kernle.org
Cc:	venki@...gle.com, arjan@...ux.intel.com, lenb@...nel.org,
	suresh.b.siddha@...el.com, kent.liu@...el.com,
	chaohong.guo@...el.com, linux-kernel@...r.kernel.org,
	linux-acpi@...r.kernel.org,
	Youquan Song <youquan.song@...ux.intel.com>,
	Youquan Song <youquan.song@...el.com>
Subject: [PATCH 4/6] cpufreq: Add dynamic sampling window tunable

Add window_is_dynamic tuable, which will use to enable or disable dynamic
adjust current sampling window size.
It is useful. Such as in my test platform, kernel build benchmark will achieve
better power performance when dynamic sampling window is disabled. While 
compress-7zip will achieve better perforamance when dynamic sampling window is
enabled.


Signed-off-by: Youquan Song <youquan.song@...el.com>
---
 drivers/cpufreq/cpufreq_ondemand.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 5242d24..5dd3770 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -296,6 +296,7 @@ show_one(sampling_down_factor, sampling_down_factor);
 show_one(ignore_nice_load, ignore_nice);
 show_one(powersave_bias, powersave_bias);
 show_one(sampling_window, sampling_window);
+show_one(window_is_dynamic, window_is_dynamic);
 
 /*** delete after deprecation time ***/
 
@@ -492,6 +493,26 @@ static ssize_t store_sampling_window(struct kobject *a, struct attribute *b,
 	return count;
 }
 
+static ssize_t store_window_is_dynamic(struct kobject *a, struct attribute *b,
+				    const char *buf, size_t count)
+{
+	unsigned int input;
+	int ret;
+	ret = sscanf(buf, "%u", &input);
+
+	if (ret != 1)
+		return -EINVAL;
+
+	if (input != 0)
+		input = 1;
+
+	mutex_lock(&dbs_mutex);
+	dbs_tuners_ins.window_is_dynamic = input;
+	mutex_unlock(&dbs_mutex);
+
+	return count;
+}
+
 define_one_global_rw(sampling_rate);
 define_one_global_rw(io_is_busy);
 define_one_global_rw(up_threshold);
@@ -499,6 +520,7 @@ define_one_global_rw(sampling_down_factor);
 define_one_global_rw(ignore_nice_load);
 define_one_global_rw(powersave_bias);
 define_one_global_rw(sampling_window);
+define_one_global_rw(window_is_dynamic);
 
 static struct attribute *dbs_attributes[] = {
 	&sampling_rate_max.attr,
@@ -510,6 +532,7 @@ static struct attribute *dbs_attributes[] = {
 	&powersave_bias.attr,
 	&io_is_busy.attr,
 	&sampling_window.attr,
+	&window_is_dynamic.attr,
 	NULL
 };
 
-- 
1.6.4.2

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