Update target value of Power Aware CPU scheduler tunable
Nanley Chery
cover Update target value of Power Aware CPU scheduler tunable
Hello,
This patch fixes a problem made evident by the debian bug 655843, 'powertop report[s] incorrect "bad" value.'
The issue is that the tunable for the "Power Aware CPU scheduler" has an outdated target value of "1". That value was correct in linux kernels before the 2.6.29 release. However, starting with the 2.6.29 release, the level setting for the scheduler that offered the greatest power savings was increased to "2" (linux kernel commit:afb8a9b70b86866a60e08b2956ae4e1406390336). Eventually, due to seemingly poor code maintenance, the power aware scheduler feature was removed altogther in the 3.5 linux kernel (linux kernel commit:8e7fbcbc22c12414bcc9dfdd683637f58fb32759).
According to the README file, we currently support kernels that have the updated power savings level (>= 2.6.38). Therefore, this patch updates the target value to "2" and conditionally omits adding the tunable for kernel versions that do not support the feature (>= 3.5).
Nanley Chery (1):
tunable: update sched_mc_power_savings target value
src/tuning/tuning.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.0.4
Nanley Chery
PATCH 1/1 tunable: update sched_mc_power_savings target value
Starting in kernel 2.6.29, the highest power savings level increased to "2". However, in kernel 3.5, the sched power savings feature was removed altogether.
--- src/tuning/tuning.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
src/tuning/tuning.cpp +4 -1
@@ -28,6 +28,7 @@ #include <stdio.h> #include <string.h> #include <ncurses.h> +#include <linux/version.h> #include "tuning.h"
@@ -58,7 +59,9 @@ static void init_tuning(void) { add_sysfs_tunable(_("Enable Audio codec power management"), "/sys/module/snd_hda_intel/parameters/power_save", "1"); add_sysfs_tunable(_("NMI watchdog should be turned off"), "/proc/sys/kernel/nmi_watchdog", "0"); - add_sysfs_tunable(_("Power Aware CPU scheduler"), "/sys/devices/system/cpu/sched_mc_power_savings", "1"); +#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,4,0) + add_sysfs_tunable(_("Power Aware CPU scheduler"), "/sys/devices/system/cpu/sched_mc_power_savings", "2"); +#endif add_sysfs_tunable(_("VM writeback timeout"), "/proc/sys/vm/dirty_writeback_centisecs", "1500"); add_sata_tunables(); add_usb_tunables();
Signature · 1 line
2.0.4
Sergey Senozhatsky
Re: [Powertop] [PATCH 1/1] tunable: update sched_mc_power_savings target value
Quoted 2 lines · Nanley Chery
Starting in kernel 2.6.29, the highest power savings level increased to "2". However, in kernel 3.5, the sched power savings feature was removed altogether.
hello,
thanks for reporting,
so, it's been removed 2 years ago (3.5 release date was 21 Jul 2012).
do we need to support it at all?
-ss
Quoted 36 lines
Signed-off-by Nanley Chery <nanleychery(a)gmail.com>--- src/tuning/tuning.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)src/tuning/tuning.cpp +4
-1@@ -28,6 +28,7 @@ #include <stdio.h> #include <string.h> #include <ncurses.h> +#include <linux/version.h> #include "tuning.h"@@ -58,7 +59,9 @@ static void init_tuning(void) { add_sysfs_tunable(_("Enable Audio codec power management"), "/sys/module/snd_hda_intel/parameters/power_save", "1"); add_sysfs_tunable(_("NMI watchdog should be turned off"), "/proc/sys/kernel/nmi_watchdog", "0"); - add_sysfs_tunable(_("Power Aware CPU scheduler"), "/sys/devices/system/cpu/sched_mc_power_savings", "1"); +#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,4,0) + add_sysfs_tunable(_("Power Aware CPU scheduler"), "/sys/devices/system/cpu/sched_mc_power_savings", "2"); +#endif add_sysfs_tunable(_("VM writeback timeout"), "/proc/sys/vm/dirty_writeback_centisecs", "1500"); add_sata_tunables(); add_usb_tunables();Signature · 6 lines
2.0.4 _______________________________________________ PowerTop mailing list PowerTop(a)lists.01.org https://lists.01.org/mailman/listinfo/powertop
Nanley Chery
Re: [Powertop] [PATCH 1/1] tunable: update sched_mc_power_savings target value
Quoted 6 lines · Sergey Senozhatsky
Quoted 1 line · Nanley Chery
Starting in kernel 2.6.29, the highest power savings level increased to
"2".
Quoted 1 line
However, in kernel 3.5, the sched power savings feature was removed
altogether.
Quoted 7 lines
hello,
thanks for reporting,so, it's been removed 2 years ago (3.5 release date was 21 Jul 2012).
do we need to support it at all?
Hello,
Good question. Our README file indicates linux-kernel >= 2.6.38 to be a build requirement. Does this mean we support power management features starting from that kernel? Or does it mean that this is only a build requirement and we target the latest kernels? It is not clear from the current documentation.
On a much smaller scope, supporting this feature is essentially free (maintenance-wise) and would keep some of our end users on older kernels happy. Btw, I submitted a simpler version 2 of this patch that does not check for the kernel version.
Thanks,
Nanley
Alexandra Yates
Re: [Powertop] [PATCH 1/1] tunable: update sched_mc_power_savings target value
Quoted 41 lines
Quoted 7 lines · Sergey Senozhatsky
Quoted 1 line · Nanley Chery
Starting in kernel 2.6.29, the highest power savings level increased
to
"2".Quoted 1 line
However, in kernel 3.5, the sched power savings feature was removed
altogether.
Quoted 7 lines
hello,
thanks for reporting,so, it's been removed 2 years ago (3.5 release date was 21 Jul 2012).
do we need to support it at all?
Hello,
Good question. Our README file indicates linux-kernel >= 2.6.38 to be a build requirement. Does this mean we support power management features starting from that kernel? Or does it mean that this is only a build requirement and we target the latest kernels? It is not clear from the current documentation.
On a much smaller scope, supporting this feature is essentially free (maintenance-wise) and would keep some of our end users on older kernels happy. Btw, I submitted a simpler version 2 of this patch that does not check for the kernel version.
Thanks,
Nanley
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop
Quoted 1 line
From PowerTOP 2.0 and up the requirement is to run at least Linux kernel
2.6.38. If it is not in the supported kernel then PowerTOP does not need it.
Thank you,
Alexandra.
Nanley Chery
Re: [Powertop] [PATCH 1/1] tunable: update sched_mc_power_savings target value
Quoted 41 lines · Alexandra Yates
Quoted 33 lines
Quoted 7 lines · Sergey Senozhatsky
Quoted 1 line · Nanley Chery
Starting in kernel 2.6.29, the highest power savings level increased
to
"2".Quoted 1 line
However, in kernel 3.5, the sched power savings feature was removed
altogether.
Quoted 7 lines
hello,
thanks for reporting,so, it's been removed 2 years ago (3.5 release date was 21 Jul 2012).
do we need to support it at all?
Hello,
Good question. Our README file indicates linux-kernel >= 2.6.38 to be a build requirement. Does this mean we support power management features starting from that kernel? Or does it mean that this is only a build requirement and we target the latest kernels? It is not clear from the current documentation.
On a much smaller scope, supporting this feature is essentially free (maintenance-wise) and would keep some of our end users on older kernels happy. Btw, I submitted a simpler version 2 of this patch that does not check for the kernel version.
Quoted 7 lines
Thanks,
Nanley
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop
Quoted 7 lines
From PowerTOP 2.0 and up the requirement is to run at least Linux kernel 2.6.38. If it is not in the supported kernel then PowerTOP does not need it.
Thank you,
Alexandra.
Since we're supporting kernels starting from 2.6.38 (which has this power management feature itself), please consider this patch which produces the correct behavior.
Thanks,
Nanley
Alexandra Yates
Re: [Powertop] [PATCH 1/1] tunable: update sched_mc_power_savings target value
Quoted 57 lines
Quoted 45 lines · Alexandra Yates
Quoted 6 lines
Quoted 2 lines · Sergey Senozhatsky
Quoted 1 line · Nanley Chery
Starting in kernel 2.6.29, the highest power savings level
increased
Quoted 9 lines
Quoted 9 lines
to
"2".Quoted 1 line
However, in kernel 3.5, the sched power savings feature was removed
altogether.
hello,
thanks for reporting,Quoted 8 lines
Quoted 3 lines
so, it's been removed 2 years ago (3.5 release date was 21 Jul 2012).
do we need to support it at all?
Hello,
Good question. Our README file indicates linux-kernel >= 2.6.38 to be
a
Quoted 7 lines
build requirement. Does this mean we support power management features starting from that kernel? Or does it mean that this is only a build requirement and we target the latest kernels? It is not clear from the current documentation.
On a much smaller scope, supporting this feature is essentially free (maintenance-wise) and would keep some of our end users on older
kernels
Quoted 1 line
happy. Btw, I submitted a simpler version 2 of this patch that does
not
Quoted 9 lines
check for the kernel version.
Thanks,
Nanley
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertopQuoted 7 lines
From PowerTOP 2.0 and up the requirement is to run at least Linux kernel 2.6.38. If it is not in the supported kernel then PowerTOP does not need it.
Thank you,
Alexandra.
Quoted 7 lines
Since we're supporting kernels starting from 2.6.38 (which has this power management feature itself), please consider this patch which produces the correct behavior.
Thanks,
Nanley
Hi Nanley,
Thank you for your patch. However, since this feature was faced out the kernel over two years ago it doesn't make sense to add it now to PowerTOP. I will update the release notes to use a later kernel. Please excuse the confusion.
Thank you,
Alexandra.
Nanley Chery
Re: [Powertop] [PATCH 1/1] tunable: update sched_mc_power_savings target value
Hi Alexandra,
Since we're going to require a later kernel, I think we should also remove the line that adds the (currently broken) sysfs_tunable for this feature as well.
Cheers,
Nanley
Quoted 76 lines · Alexandra Yates
Quoted 57 lines
Quoted 45 lines · Alexandra Yates
Quoted 6 lines
Quoted 2 lines · Sergey Senozhatsky
Quoted 1 line · Nanley Chery
Starting in kernel 2.6.29, the highest power savings level
increased
Quoted 9 lines
Quoted 9 lines
to
"2".Quoted 1 line
However, in kernel 3.5, the sched power savings feature was removed
altogether.
hello,
thanks for reporting,Quoted 8 lines
Quoted 3 lines
so, it's been removed 2 years ago (3.5 release date was 21 Jul 2012).
do we need to support it at all?
Hello,
Good question. Our README file indicates linux-kernel >= 2.6.38 to be
a
Quoted 7 lines
build requirement. Does this mean we support power management features starting from that kernel? Or does it mean that this is only a build requirement and we target the latest kernels? It is not clear from the current documentation.
On a much smaller scope, supporting this feature is essentially free (maintenance-wise) and would keep some of our end users on older
kernels
Quoted 1 line
happy. Btw, I submitted a simpler version 2 of this patch that does
not
Quoted 9 lines
check for the kernel version.
Thanks,
Nanley
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertopQuoted 7 lines
From PowerTOP 2.0 and up the requirement is to run at least Linux kernel 2.6.38. If it is not in the supported kernel then PowerTOP does not need it.
Thank you,
Alexandra.Quoted 7 lines
Since we're supporting kernels starting from 2.6.38 (which has this power management feature itself), please consider this patch which produces the correct behavior.
Thanks,
NanleyHi Nanley,
Thank you for your patch. However, since this feature was faced out the kernel over two years ago it doesn't make sense to add it now to PowerTOP. I will update the release notes to use a later kernel. Please excuse the confusion.
Thank you,
Alexandra.
Alexandra Yates
Re: [Powertop] [PATCH 1/1] tunable: update sched_mc_power_savings target value
Quoted 8 lines
Hi Alexandra,
Since we're going to require a later kernel, I think we should also remove the line that adds the (currently broken)
sysfs_tunablefor this feature as
well.
Quoted 96 lines
Cheers,
NanleyQuoted 89 lines · Alexandra Yates
Quoted 8 lines
Quoted 4 lines · Alexandra Yates
Quoted 4 lines
On Tue, Aug 19, 2014 at 7:49 AM, Sergey Senozhatsky < sergey.senozhatsky(a)gmail.com> wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines · Nanley Chery
Quoted 1 line
Starting in kernel 2.6.29, the highest power savings level
increased
Quoted 3 lines
Quoted 3 lines
to
"2".Quoted 1 line
However, in kernel 3.5, the sched power savings feature was
removed
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
altogether.
hello,
thanks for reporting,so, it's been removed 2 years ago (3.5 release date was 21 Jul
2012).
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
do we need to support it at all?
Hello,
Good question. Our README file indicates linux-kernel >= 2.6.38 to
be
Quoted 2 lines
Quoted 2 lines
a
Quoted 1 line
build requirement. Does this mean we support power management
features
Quoted 1 line
Quoted 1 line
Quoted 1 line
starting from that kernel? Or does it mean that this is only a
build
Quoted 1 line
Quoted 1 line
Quoted 1 line
requirement and we target the latest kernels? It is not clear from
the
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
current documentation.
On a much smaller scope, supporting this feature is essentially
free
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
(maintenance-wise) and would keep some of our end users on older
kernels
Quoted 1 line
happy. Btw, I submitted a simpler version 2 of this patch that does
not
Quoted 9 lines
check for the kernel version.
Thanks,
Nanley
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertopQuoted 1 line
Quoted 1 line
From PowerTOP 2.0 and up the requirement is to run at least Linux
kernel
Quoted 1 line
Quoted 1 line
2.6.38. If it is not in the supported kernel then PowerTOP does not
need
Quoted 7 lines
Quoted 5 lines
it.
Thank you,
Alexandra.Since we're supporting kernels starting from 2.6.38 (which has this
power
Quoted 1 line
management feature itself), please consider this patch which produces
the
Quoted 5 lines
correct behavior.
Thanks,
NanleyHi Nanley,
Thank you for your patch. However, since this feature was faced out the kernel over two years ago it doesn't make sense to add it now to PowerTOP.
I will update the release notes to use a later kernel. Please excuse the
confusion.Thank you,
Alexandra.
This makes sense Nanley. Since you have been working on this already, Do you want to send a patch with this change?
Thank you,
Alexandra.
Nanley Chery
PATCH 1/1 tunables: remove Power Aware CPU scheduler support
Due to seemingly poor code maintenance, the power aware scheduler feature was removed in the 3.5 linux kernel (see linux kernel commit:8e7fbcbc22c12414bcc9dfdd683637f58fb32759).
--- src/tuning/tuning.cpp | 1 - 1 file changed, 1 deletion(-)
src/tuning/tuning.cpp +0 -1
@@ -58,7 +58,6 @@ static void init_tuning(void) { add_sysfs_tunable(_("Enable Audio codec power management"), "/sys/module/snd_hda_intel/parameters/power_save", "1"); add_sysfs_tunable(_("NMI watchdog should be turned off"), "/proc/sys/kernel/nmi_watchdog", "0"); - add_sysfs_tunable(_("Power Aware CPU scheduler"), "/sys/devices/system/cpu/sched_mc_power_savings", "1"); add_sysfs_tunable(_("VM writeback timeout"), "/proc/sys/vm/dirty_writeback_centisecs", "1500"); add_sata_tunables(); add_usb_tunables();
Signature · 1 line
2.1.0
Nanley Chery
Re: [Powertop] [PATCH 1/1] tunable: update sched_mc_power_savings target value
In reply to Alexandra YatesQuoted 106 lines · Alexandra Yates
Quoted 4 lines
Hi Alexandra,
Since we're going to require a later kernel, I think we should also
remove
Quoted 4 lines
the line that adds the (currently broken)
sysfs_tunablefor this feature as
well.Quoted 96 lines
Cheers,
NanleyQuoted 89 lines · Alexandra Yates
Quoted 8 lines
Quoted 4 lines · Alexandra Yates
Quoted 4 lines
On Tue, Aug 19, 2014 at 7:49 AM, Sergey Senozhatsky < sergey.senozhatsky(a)gmail.com> wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines · Nanley Chery
Quoted 1 line
Starting in kernel 2.6.29, the highest power savings level
increased
Quoted 3 lines
Quoted 3 lines
to
"2".Quoted 1 line
However, in kernel 3.5, the sched power savings feature was
removed
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
altogether.
hello,
thanks for reporting,so, it's been removed 2 years ago (3.5 release date was 21 Jul
2012).
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
do we need to support it at all?
Hello,
Good question. Our README file indicates linux-kernel >= 2.6.38 to
be
Quoted 2 lines
Quoted 2 lines
a
Quoted 1 line
build requirement. Does this mean we support power management
features
Quoted 1 line
Quoted 1 line
Quoted 1 line
starting from that kernel? Or does it mean that this is only a
build
Quoted 1 line
Quoted 1 line
Quoted 1 line
requirement and we target the latest kernels? It is not clear from
the
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
current documentation.
On a much smaller scope, supporting this feature is essentially
free
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
(maintenance-wise) and would keep some of our end users on older
kernels
Quoted 1 line
happy. Btw, I submitted a simpler version 2 of this patch that does
not
Quoted 9 lines
check for the kernel version.
Thanks,
Nanley
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertopQuoted 1 line
Quoted 1 line
From PowerTOP 2.0 and up the requirement is to run at least Linux
kernel
Quoted 1 line
Quoted 1 line
2.6.38. If it is not in the supported kernel then PowerTOP does not
need
Quoted 7 lines
Quoted 5 lines
it.
Thank you,
Alexandra.Since we're supporting kernels starting from 2.6.38 (which has this
power
Quoted 1 line
management feature itself), please consider this patch which produces
the
Quoted 5 lines
correct behavior.
Thanks,
NanleyHi Nanley,
Thank you for your patch. However, since this feature was faced out the kernel over two years ago it doesn't make sense to add it now to PowerTOP.
I will update the release notes to use a later kernel. Please excuse the
confusion.Thank you,
Alexandra.
Quoted 4 lines
This makes sense Nanley. Since you have been working on this already, Do you want to send a patch with this change?
Sure, I just sent a patch with the change.
Cheers,
Nanley
Nanley Chery
v2 cover Update target value of Power Aware CPU scheduler tunable
In reply to Nanley CheryRemoved the check for the kernel version. add_sysfs_tunable() actually doesn't create the tunable if the sysfs file doesn't exist. This should be the case for kernel versions after 3.4, so the problem will be handled gracefully.
Also word-wrapped the commit to 72 columns.
Nanley Chery (1):
tunable: update sched_mc_power_savings target val
src/tuning/tuning.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.0.4
Nanley Chery
PATCH v2 1/1 tunable: update sched_mc_power_savings target val
Starting in kernel 2.6.29, the highest power savings level increased to "2". It should be noted that the sched power savings feature was removed altogether in kernel 3.5.
--- src/tuning/tuning.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/tuning/tuning.cpp +1 -1
@@ -58,7 +58,7 @@ static void init_tuning(void) { add_sysfs_tunable(_("Enable Audio codec power management"), "/sys/module/snd_hda_intel/parameters/power_save", "1"); add_sysfs_tunable(_("NMI watchdog should be turned off"), "/proc/sys/kernel/nmi_watchdog", "0"); - add_sysfs_tunable(_("Power Aware CPU scheduler"), "/sys/devices/system/cpu/sched_mc_power_savings", "1"); + add_sysfs_tunable(_("Power Aware CPU scheduler"), "/sys/devices/system/cpu/sched_mc_power_savings", "2"); add_sysfs_tunable(_("VM writeback timeout"), "/proc/sys/vm/dirty_writeback_centisecs", "1500"); add_sata_tunables(); add_usb_tunables();
Signature · 1 line
2.0.4