You are not logged in.

#1 2014-09-11 14:19:08

scybhe
Member
Registered: 2014-09-10
Posts: 20

[SOLVED] Small periodic system freezes after resume from suspend

Hi everyone!
I am new to arch and a question get me stucked for a long time. It is that almost everytime I suspend the system to the ram, it is very fast and ok since the new kernel, but when I resume from suspend and then sometimes when I save files or other operations needing to sync to hdd, the hdd I/O reches 99%(I get this by the iotop command) and block the ui for muti-seconds,especially when I use eclipse and save an edited file. I googled for this question but there's no solution. I only find a post in this forum about this question here:https://bbs.archlinux.org/viewtopic.php?id=139087 but it doesn't give a clear answer. And I also read the wiki about the Small periodic system freezes and this wiki doesn't work because the issue appears only after resume from suspending. I have no idea So I open a new topic for the question.
Thanks in advance!
The related etc files:
this is the newest kernel, but the problem last for about half an year:

[he@Arch ~]$ uname -a
Linux Arch 3.16.2-1-ARCH #1 SMP PREEMPT Sat Sep 6 13:12:51 CEST 2014 x86_64 GNU/Linux

fstab:

[he@Arch ~]$ cat /etc/fstab
# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
# /dev/sda3
UUID=ba683ccb-1246-4c7e-9bdf-5bb7ff874806	/         	ext4      	rw,noatime,data=ordered,barrier=0,commit=60	0 1

# /dev/sda1
UUID=8b8130cc-0d01-432f-8b22-a3019882c93b	/boot     	ext4      	rw,noatime,stripe=4,data=ordered,barrier=0	0 2

# /dev/sda6
UUID=d178ef3b-fc7b-4c54-8093-521860dc15c7	/home     	ext4      	rw,noatime,data=ordered,barrier=0	0 2

# /dev/sda5
UUID=51759295-23b0-4cdd-b127-396eaeea004e	none      	swap      	defaults,barrier=0 	0 0

# /dev/sda8
/dev/sda8	/mnt/data	vfat	user,rw,umask=111,dmask=000,uid=1000,gid=1000	0	0

tmpfs	/home/he/.cache/chromium/Default/Cache	tmpfs	noatime,nodev,nosuid,size=128M	0	0
tmpfs	/home/he/.cache/mozilla/firefox		tmpfs	noatime,nodev,nosuid,size=128M	0	0

fdisk -l:

[he@Arch ~]$ sudo fdisk -l

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
磁盘标签类型:dos
磁盘标识符:0x0004fc47
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    718847    716800   350M 83 Linux
/dev/sda2          718848 126547967 125829120    60G  7 HPFS/NTFS/exFAT
/dev/sda3       126547968 210434047  83886080    40G 83 Linux
/dev/sda4       210434048 976773167 766339120 365.4G  5 Extended
/dev/sda5       210436096 214630399   4194304     2G 83 Linux
/dev/sda6       214632448 424347647 209715200   100G 83 Linux
/dev/sda7       424349696 634064895 209715200   100G 83 Linux
/dev/sda8       634066944 976773167 342706224 163.4G 83 Linux

smartctl -a /dev/sda

[he@Arch ~]$ smartctl -a /dev/sda
smartctl 6.3 2014-07-26 r3976 [x86_64-linux-3.16.2-1-ARCH] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sda failed: Permission denied
[he@Arch ~]$ sudo smartctl -a /dev/sda
smartctl 6.3 2014-07-26 r3976 [x86_64-linux-3.16.2-1-ARCH] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Scorpio Blue Serial ATA (AF)
Device Model:     WDC WD5000BPVT-22A1YT0
Serial Number:    WD-WX11CC154630
LU WWN Device Id: 5 0014ee 6021741a5
Firmware Version: 01.01A01
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 3.0, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Thu Sep 11 18:39:30 2014 CST
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: 		(10680) 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: 	 ( 118) minutes.
Conveyance self-test routine
recommended polling time: 	 (   5) minutes.
SCT capabilities: 	       (0x70b5)	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   180   168   021    Pre-fail  Always       -       1958
  4 Start_Stop_Count        0x0032   068   068   000    Old_age   Always       -       32932
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   092   092   000    Old_age   Always       -       5845
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   097   097   000    Old_age   Always       -       3602
191 G-Sense_Error_Rate      0x0032   090   090   000    Old_age   Always       -       10
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       284
193 Load_Cycle_Count        0x0032   024   024   000    Old_age   Always       -       528291
194 Temperature_Celsius     0x0022   105   101   000    Old_age   Always       -       42
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   000    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.

and hdparm

[he@Arch ~]$ sudo hdparm -iI /dev/sda

/dev/sda:

 Model=WDC WD5000BPVT-22A1YT0, FwRev=01.01A01, SerialNo=WD-WX11CC154630
 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=off
 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


ATA device, with non-removable media
	Model Number:       WDC WD5000BPVT-22A1YT0                  
	Serial Number:      WD-WX11CC154630
	Firmware Revision:  01.01A01
	Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
	Supported: 8 7 6 5 
	Likely used: 8
Configuration:
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	--
	CHS current addressable sectors:   16514064
	LBA    user addressable sectors:  268435455
	LBA48  user addressable sectors:  976773168
	Logical  Sector size:                   512 bytes
	Physical Sector size:                  4096 bytes
	Logical Sector-0 offset:                  0 bytes
	device size with M = 1024*1024:      476940 MBytes
	device size with M = 1000*1000:      500107 MBytes (500 GB)
	cache/buffer size  = 8192 KBytes
	Nominal Media Rotation Rate: 5400
Capabilities:
	LBA, IORDY(can be disabled)
	Queue depth: 32
	Standby timer values: spec'd by Standard, with device specific minimum
	R/W multiple sector transfer: Max = 16	Current = 0
	Advanced power management level: 254
	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
	Enabled	Supported:
	   *	SMART feature set
	    	Security Mode feature set
	   *	Power Management feature set
	   *	Write cache
	   *	Look-ahead
	   *	Host Protected Area feature set
	   *	WRITE_BUFFER command
	   *	READ_BUFFER command
	   *	NOP cmd
	   *	DOWNLOAD_MICROCODE
	   *	Advanced Power Management feature set
	    	SET_MAX security extension
	   *	48-bit Address feature set
	   *	Device Configuration Overlay feature set
	   *	Mandatory FLUSH_CACHE
	   *	FLUSH_CACHE_EXT
	   *	SMART error logging
	   *	SMART self-test
	   *	General Purpose Logging feature set
	   *	64-bit World wide name
	   *	IDLE_IMMEDIATE with UNLOAD
	   *	{READ,WRITE}_DMA_EXT_GPL commands
	   *	Segmented DOWNLOAD_MICROCODE
	   *	Gen1 signaling speed (1.5Gb/s)
	   *	Gen2 signaling speed (3.0Gb/s)
	   *	Native Command Queueing (NCQ)
	   *	Host-initiated interface power management
	   *	Phy event counters
	   *	Idle-Unload when NCQ is active
	   *	NCQ priority information
	   *	DMA Setup Auto-Activate optimization
	    	Device-initiated interface power management
	   *	Software settings preservation
	   *	SMART Command Transport (SCT) feature set
	   *	SCT Write Same (AC2)
	   *	SCT Features Control (AC4)
	   *	SCT Data Tables (AC5)
	    	unknown 206[7]
	    	unknown 206[12] (vendor specific)
	    	unknown 206[13] (vendor specific)
	    	unknown 206[14] (vendor specific)
Security: 
	Master password revision code = 65534
		supported
	not	enabled
	not	locked
		frozen
	not	expired: security count
		supported: enhanced erase
	108min for SECURITY ERASE UNIT. 108min for ENHANCED SECURITY ERASE UNIT. 
Logical Unit WWN Device Identifier: 50014ee6021741a5
	NAA		: 5
	IEEE OUI	: 0014ee
	Unique ID	: 6021741a5
Checksum: correct

Last edited by scybhe (2014-09-12 01:44:08)

Offline

#2 2014-09-11 16:08:07

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,481

Re: [SOLVED] Small periodic system freezes after resume from suspend

from hdparm:

 AdvancedPM=yes: unknown setting WriteCache=enabled

Maybe the disk goes to sleep too often; this is bad even for your hdd life.

Do you set hdparm at boot or maybe a Power managment script does that?
Remember that hdparm settings are lost on hibernation/suspend, so you need to rerun it when the pc wakes up.

Anyway,at wakeup,  try to run

sudo hdparm -B 255 /dev/sda

To disable power managment.

Last edited by kokoko3k (2014-09-11 16:17:16)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#3 2014-09-12 01:39:08

scybhe
Member
Registered: 2014-09-10
Posts: 20

Re: [SOLVED] Small periodic system freezes after resume from suspend

kokoko3k wrote:

from hdparm:

 AdvancedPM=yes: unknown setting WriteCache=enabled

Maybe the disk goes to sleep too often; this is bad even for your hdd life.

Do you set hdparm at boot or maybe a Power managment script does that?
Remember that hdparm settings are lost on hibernation/suspend, so you need to rerun it when the pc wakes up.

Anyway,at wakeup,  try to run

sudo hdparm -B 255 /dev/sda

To disable power managment.

It works like a charm! Thanks for your reply. This question really drove me crazy for long time. It really caused by wrong setting of APM.From your reply then I follow the instruction of hdparm wiki and make it automated.

Offline

#4 2014-09-12 06:53:49

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,481

Re: [SOLVED] Small periodic system freezes after resume from suspend

Glad you solved the issue.
Anyway,  if you are still interested in HDD power managment, try to experiment with lower hdparm values.
If it doesn't work (sometimes drives have a sort of hardcoded values that cannot be tweaked), you can still disable PM all togheter and resort to a userland tool.
Personally, i use hd-idle from AUR.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB