Bug 905195 - Tuned sets the value of Advanced power management level on the hard disk to 255
Summary: Tuned sets the value of Advanced power management level on the hard disk to 255
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tuned
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Škarvada
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-28 20:04 UTC by Dilyan Arsov
Modified: 2013-03-23 23:11 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-03-19 20:12:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dilyan Arsov 2013-01-28 20:04:36 UTC
Description of problem:
Tuned sets the value of Advanced power management level on the 
hard disk to disabled. This causes the load/unload Cycles.One to three cycles per minute.
If the hard drive has no activity for a while and wake up, the value of Advanced power management level increases progressively up to 255(disabled).


Version-Release number of selected component (if applicable):
tuned-2.1.2-1.fc18.noarch

How reproducible:
always

Steps to Reproduce:
1.tuned-adm active
Current active profile: powersave
2.hdparm -B 200 /dev/sda
/dev/sda:
 setting Advanced Power Management level to 0xc8 (200)
 APM_level	= 200
3.hdparm -I /dev/sda | grep Advanced
	Advanced power management level: disabled
	    	Advanced Power Management feature set
4.smartctl -a /dev/sda | grep Load_Cycle
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       90539
smartctl -a /dev/sda | grep Load_Cycle
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       90540
 smartctl -a /dev/sda | grep Load_Cycle
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       90540
smartctl -a /dev/sda | grep Load_Cycle
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       90541

  
Actual results:


Expected results:


Additional info:

Comment 1 Dilyan Arsov 2013-02-01 17:53:46 UTC
This is not a bug.
Мost likely this is a shortcoming of HDD. TOSHIBA MK2546GSX.
Small changes and repackaging of tuned helped for now.
I apologize!

Comment 2 Jaroslav Škarvada 2013-02-04 08:51:43 UTC
(In reply to comment #1)
> This is not a bug.
> Мost likely this is a shortcoming of HDD. TOSHIBA MK2546GSX.
> Small changes and repackaging of tuned helped for now.
> I apologize!

NP, so is there any patch? Or could we close this?

Comment 3 Fedora Admin XMLRPC Client 2013-02-04 21:45:00 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Dilyan Arsov 2013-02-06 12:31:38 UTC
Hello!

I did a little test:

APM_level	= 128
I ran this script for about five minut: count.sh
while true ; do smartctl -a /dev/sda | grep Load_Cycle ; sleep 60 ; done
The result:
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91438
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91440
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91441
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91442
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91443
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91445
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91447


APM_level	= off
The result:
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91451
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91452
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91453
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91456
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91457
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91459
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91459
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91460
193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       91462

This is not good for my HDD TOSHIBA MK2546GSX.
Not all drives support value of 255.

I changed the following value in the file plugin_disk.py:
--- plugin_disk.py	2013-02-06 14:01:31.000000000 +0200
+++ plugin_disk_new.py	2013-02-06 14:15:12.000000000 +0200
@@ -17,7 +17,7 @@
 	def _post_init(self):
 		self.devidle = {}
 		self.stats = {}
-		self.power = ["255", "225", "195", "165", "145", "125", "105", "85", "70", "55", "30", "20"]
+		self.power = ["254", "225", "195", "165", "145", "125", "105", "85", "70", "55", "30", "20"]
 		self.spindown = ["0", "250", "230", "210", "190", "170", "150", "130", "110", "90", "70", "60"]
 		self.levels = len(self.power)

Comment 5 Jaroslav Škarvada 2013-02-12 10:25:50 UTC
(In reply to comment #4)
Thanks, I am unable to reproduce this with my disks but the change makes sense, accepting.

Comment 6 Jaroslav Škarvada 2013-02-12 11:04:59 UTC
Fix committed upstream: 
http://git.fedorahosted.org/cgit/tuned.git/diff/?id=d102eb88be6dc1a0d842a1a1299d1a1fb581461d

The fix will be included in the next tuned release and this bug will be auto-closed after the release.

Comment 7 Dilyan Arsov 2013-02-18 09:40:00 UTC
Hello!
Maybe I should change something else:

--- tuned-2.1.2/tuned/plugins/plugin_disk.py	2012-12-19 13:12:53.000000000 +0200
+++ tuned-2.1.2/tuned/plugins/plugin_disk_new.py	2013-02-13 17:56:09.220942700 +0200
@@ -17,7 +17,7 @@
 	def _post_init(self):
 		self.devidle = {}
 		self.stats = {}
-		self.power = ["255", "225", "195", "165", "145", "125", "105", "85", "70", "55", "30", "20"]
+		self.power = ["254", "225", "195", "165", "145", "125", "105", "85", "70", "55", "30", "20"]
 		self.spindown = ["0", "250", "230", "210", "190", "170", "150", "130", "110", "90", "70", "60"]
 		self.levels = len(self.power)
 
@@ -100,7 +100,7 @@
 
 			for dev in self.devidle.keys():
 				if self.devidle[dev]["LEVEL"] > 0:
-					os.system("hdparm -S0 -B255 /dev/"+dev+" > /dev/null 2>&1")
+					os.system("hdparm -S0 -B254 /dev/"+dev+" > /dev/null 2>&1")
 
 	def update_tuning(self):
 		load = self._load_monitor.get_load()

Thank you !

Comment 8 Jaroslav Škarvada 2013-02-18 10:29:58 UTC
(In reply to comment #7)
Thanks, but it is old codebase. The cleanup code is fixed usptream by commit:
http://git.fedorahosted.org/cgit/tuned.git/diff/?id=fe3d97a8fae3e13b03987e75d0893bd4b5c6bebe

Comment 9 Fedora Update System 2013-03-01 13:35:37 UTC
tuned-2.2.1-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/tuned-2.2.1-1.fc18

Comment 10 Fedora Update System 2013-03-02 19:52:14 UTC
Package tuned-2.2.1-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing tuned-2.2.1-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3205/tuned-2.2.1-1.fc18
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2013-03-08 08:56:21 UTC
tuned-2.2.1-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/tuned-2.2.1-2.fc18

Comment 12 Fedora Update System 2013-03-19 20:12:14 UTC
tuned-2.2.1-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Dilyan Arsov 2013-03-23 23:11:38 UTC
It works.
Thank you!


Note You need to log in before you can comment on or make changes to this bug.