Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Insane disk latency on laptop
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Thu Aug 04, 2011 12:50 pm    Post subject: [SOLVED] Insane disk latency on laptop Reply with quote

Hi.

I've been having this problem since I bought the Acer 3820TG. Thanks to some stupid power saving feature, my hard drive stops when not used (it spins down). Then when it's used by some app it takes 1-3 seconds to start running! During this time the entire laptop freezes!

The funny thing is that when I use smplayer, the video stops every couple of minutes (for disk access), but when I play music via moc the disk is spinning constantly and everything runs smoothly.

I'm not sure whether it's a hardware issue, or some kernel/software config. Could you give me some hints ? (that tools can I use to get more info on the disk and it's performance or just how to fix it)


Last edited by Gabriel_Blake on Sat Aug 06, 2011 11:05 am; edited 1 time in total
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Thu Aug 04, 2011 2:37 pm    Post subject: Reply with quote

Look at your disk settings:

Code:
# hdparm -i /dev/<your disk>


Look at your disk health:

Code:
# smartctl -a /dev/<your disk>


'smartctl' is in the package 'smartmontools' .
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Thu Aug 04, 2011 8:00 pm    Post subject: Reply with quote

Or increase the timeout value with something like `/sbin/hdparm -q -S120 /dev/sda` and you're all set.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Thu Aug 04, 2011 8:04 pm    Post subject: Reply with quote

Oops, forgot that "hdparm -i" doesn't give current settings ...
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Thu Aug 04, 2011 11:59 pm    Post subject: Reply with quote

I sense a disturbance in the force. Something is wrong here:

Code:
/dev/sda:

 Model=WDC WD5000BEVT-22A0RT0, FwRev=01.01A01, SerialNo=WD-WX31A50S2338
 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=50
 BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=976773168
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
 AdvancedPM=yes: unknown setting WriteCache=enabled
 Drive conforms to: Unspecified:  ATA/ATAPI-1,2,3,4,5,6,7

 * signifies the current active mode


Code:
=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Scorpio Blue Serial ATA family
Device Model:     WDC WD5000BEVT-22A0RT0
Serial Number:    WD-WX31A50S2338
Firmware Version: 01.01A01
User Capacity:    500,107,862,016 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Fri Aug  5 01:52:58 2011 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)   Offline data collection activity
               was never started.
               Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)   The previous self-test routine completed
               without error or no self-test has ever
               been run.
Total time to complete Offline
data collection:        (12780) seconds.
Offline data collection
capabilities:           (0x7b) SMART execute Offline immediate.
               Auto Offline data collection on/off support.
               Suspend Offline collection upon new
               command.
               Offline surface scan supported.
               Self-test supported.
               Conveyance Self-test supported.
               Selective Self-test supported.
SMART capabilities:            (0x0003)   Saves SMART data before entering
               power-saving mode.
               Supports SMART auto save timer.
Error logging capability:        (0x01)   Error logging supported.
               General Purpose Logging supported.
Short self-test routine
recommended polling time:     (   2) minutes.
Extended self-test routine
recommended polling time:     ( 149) minutes.
Conveyance self-test routine
recommended polling time:     (   5) minutes.
SCT capabilities:           (0x7037)   SCT Status supported.
               SCT Feature Control supported.
               SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   188   153   021    Pre-fail  Always       -       1600
  4 Start_Stop_Count        0x0032   016   016   000    Old_age   Always       -       84209
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   095   095   000    Old_age   Always       -       3721
 10 Spin_Retry_Count        0x0032   100   100   051    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       895
191 G-Sense_Error_Rate      0x0032   001   001   000    Old_age   Always       -       243
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       93
193 Load_Cycle_Count        0x0032   054   054   000    Old_age   Always       -       440974
194 Temperature_Celsius     0x0022   111   101   000    Old_age   Always       -       36
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   100   253   051    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Fri Aug 05, 2011 1:38 am    Post subject: Reply with quote

Looks normal enough. You can do what tclover says and see if the situation improves.

Also, if you like, run a disk diagnostic, as described in the smarctl man page. Probably it will be normal as well.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
redagadir
n00b
n00b


Joined: 06 Aug 2011
Posts: 29

PostPosted: Sat Aug 06, 2011 2:37 am    Post subject: Reply with quote

tclover's advice looks wise, disable poweroff on inactivity.
just make sure it stays persistent across reboots.

and just to be sure, check these:
$ hdparm -tT /dev/sda #if sda is your disk

$ smartctl -t short /dev/sda
then after a while (few minutes)
$ smartctl -a /dev/sda
and read the short test result

if you have time:
$ smartctl -t long /dev/sda
and read again results after some time


Last edited by redagadir on Wed Dec 21, 2011 9:19 am; edited 1 time in total
Back to top
View user's profile Send private message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Sat Aug 06, 2011 11:04 am    Post subject: Reply with quote

tclover wrote:
Or increase the timeout value with something like `/sbin/hdparm -q -S120 /dev/sda` and you're all set.


Absolutely fixed everything :) Sets the spin-down to 10min so it's fine, but I've used it with -S0 so it's off.

I'm not sue if these settings are permanent, so to be sure I've added the command to /etc/local.d/driveNoStandby.start
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sat Aug 06, 2011 11:39 am    Post subject: Reply with quote

You can also put the setting in /etc/conf.d/hdparm , then add the hdparm service to the default runlevel.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23093

PostPosted: Sat Aug 06, 2011 5:08 pm    Post subject: Reply with quote

Gabriel_Blake wrote:
I'm not sue if these settings are permanent, so to be sure I've added the command to /etc/local.d/driveNoStandby.start
If the settings are not permanent, you may find that they are forgotten after you hibernate and resume the system. If so, you would need to add an equivalent hdparm setting to your resume scripts to reapply the setting after the system wakes up.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum