收起左侧

[bug]外置硬盘不休眠疑似与trim相关

4
回复
81
查看
[ 复制链接 ]

0

主题

14

回帖

0

牛值

江湖小虾

2025-6-20 21:26:47 显示全部楼层 阅读模式

根据"社区热点问题处理进展 20250620",使用blktrace查找硬盘不休眠原因,发现每60秒硬盘收到一次trim指令。问题是外置的硬盘是HDD,不应该进行trim操作。在0.9.8之前均能够正常休眠,请核实是否能够复现相关问题。相关日志如下:

CSSAA@fnOS:~$ sudo blktrace -d /dev/sdb -o - | sudo blkparse -i -
8,16 5 1 0.000000000 2163 D N 0 [trim]
8,16 0 1 0.001465113 0 C N [0]
8,16 5 2 60.002510855 2163 D N 0 [trim]
8,16 0 2 60.003977908 0 C N [0]
8,16 2 1 120.004968856 2163 D N 0 [trim]
8,16 0 3 120.006416717 0 C N [0]
8,16 2 2 180.007319007 2163 D N 0 [trim]
8,16 0 4 180.008762086 0 C N [0]
8,16 0 5 240.011140656 0 C N [0]
8,16 2 3 240.009687340 2163 D N 0 [trim]
^CCPU0 (8,16):
Reads Queued: 0, 0KiB Writes Queued: 0, 0KiB
Read Dispatches: 0, 0KiB Write Dispatches: 0, 0KiB
Reads Requeued: 0 Writes Requeued: 0
Reads Completed: 0, 0KiB Writes Completed: 0, 0KiB
Read Merges: 0, 0KiB Write Merges: 0, 0KiB
Read depth: 1 Write depth: 0
PC Reads Queued: 0, 0KiB PC Writes Queued: 0, 0KiB
PC Read Disp.: 0, 0KiB PC Write Disp.: 0, 0KiB
PC Reads Req.: 0 PC Writes Req.: 0
PC Reads Compl.: 5 PC Writes Compl.: 0
IO unplugs: 0 Timer unplugs: 0
CPU2 (8,16):
Reads Queued: 0, 0KiB Writes Queued: 0, 0KiB
Read Dispatches: 0, 0KiB Write Dispatches: 0, 0KiB
Reads Requeued: 0 Writes Requeued: 0
Reads Completed: 0, 0KiB Writes Completed: 0, 0KiB
Read Merges: 0, 0KiB Write Merges: 0, 0KiB
Read depth: 1 Write depth: 0
PC Reads Queued: 0, 0KiB PC Writes Queued: 0, 0KiB
PC Read Disp.: 3, 0KiB PC Write Disp.: 0, 0KiB
PC Reads Req.: 0 PC Writes Req.: 0
PC Reads Compl.: 0 PC Writes Compl.: 0
IO unplugs: 0 Timer unplugs: 0
CPU5 (8,16):
Reads Queued: 0, 0KiB Writes Queued: 0, 0KiB
Read Dispatches: 0, 0KiB Write Dispatches: 0, 0KiB
Reads Requeued: 0 Writes Requeued: 0
Reads Completed: 0, 0KiB Writes Completed: 0, 0KiB
Read Merges: 0, 0KiB Write Merges: 0, 0KiB
Read depth: 1 Write depth: 0
PC Reads Queued: 0, 0KiB PC Writes Queued: 0, 0KiB
PC Read Disp.: 2, 0KiB PC Write Disp.: 0, 0KiB
PC Reads Req.: 0 PC Writes Req.: 0
PC Reads Compl.: 0 PC Writes Compl.: 0
IO unplugs: 0 Timer unplugs: 0

Total (8,16):
Reads Queued: 0, 0KiB Writes Queued: 0, 0KiB
Read Dispatches: 0, 0KiB Write Dispatches: 0, 0KiB
Reads Requeued: 0 Writes Requeued: 0
Reads Completed: 0, 0KiB Writes Completed: 0, 0KiB
Read Merges: 0, 0KiB Write Merges: 0, 0KiB
PC Reads Queued: 0, 0KiB PC Writes Queued: 0, 0KiB
PC Read Disp.: 5, 0KiB PC Write Disp.: 0, 0KiB
PC Reads Req.: 0 PC Writes Req.: 0
PC Reads Compl.: 5 PC Writes Compl.: 0
IO unplugs: 0 Timer unplugs: 0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (8,16): 10 entries
Skips: 0 forward (0 - 0.0%)

CSSAA@fnOS:~$ ps aux | grep 2163
CSSAA 2236426 0.0 0.0 6332 2192 pts/0 S+ 21:06 0:00 grep --color=auto 2163

CSSAA@fnOS:~$ sudo smartctl -a /dev/sdb
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.12.18-trim] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda Pro Com**
Device Model: ST1000LM049-2GH172
Serial Number: WxxxxxxX
LU WWN Device Id: 5 xxxx 0exxxxx7
Firmware Version: RPM4
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 2.5 inches
TRIM Command: Available
Device is: In smartctl database 7.3/5706
ATA Version is: ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Jun 20 21:07:19 2025 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART Status not supported: Incomplete response, ATA output registers missing
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.

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: ( 0) seconds.
Offline data collection
capabilities: (0x51) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
No 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: ( 125) minutes.
SCT capabilities: (0x303d) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
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 082 064 006 Pre-fail Always - 163500377
3 Spin_Up_Time 0x0027 099 099 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 098 098 000 Old_age Always - 2696
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x002f 067 060 045 Pre-fail Always - 5326461
9 Power_On_Hours 0x0032 097 097 000 Old_age Always - 2775
10 Spin_Retry_Count 0x0033 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 98
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x003b 100 100 097 Pre-fail Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 060 049 040 Old_age Always - 40 (Min/Max 34/44)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 1
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 27
193 Load_Cycle_Count 0x0032 087 087 000 Old_age Always - 27499
194 Temperature_Celsius 0x0022 040 051 000 Old_age Always - 40 (0 14 0 0 0)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 100 100 000 Old_age Always - 0
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
1 Short offline Completed without error 00% 1 -

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.

收藏
送赞
分享

39

主题

8000

回帖

0

牛值

管理员

sdb这块盘有设置什么定时任务吗 比如快照、备份有设置定时备份的情况?
5月30日那一版更新后出现的无法休眠。  详情 回复
3 天前
从佳翼的JMS578易驱换成了自制的ASM235后能休眠了。但是0.9.8之前一直用的是这根JMS578,都是能正常休眠的。  详情 回复
3 天前

0

主题

14

回帖

0

牛值

江湖小虾

3 天前 楼主 显示全部楼层
飞牛技术同学 发表于 2025-6-25 17:20
sdb这块盘有设置什么定时任务吗 比如快照、备份有设置定时备份的情况?

从佳翼的JMS578易驱换成了自制的ASM235后能休眠了。但是0.9.8之前一直用的是这根JMS578,都是能正常休眠的。

0

主题

14

回帖

0

牛值

江湖小虾

3 天前 楼主 显示全部楼层
飞牛技术同学 发表于 2025-6-25 17:20
sdb这块盘有设置什么定时任务吗 比如快照、备份有设置定时备份的情况?

5月30日那一版更新后出现的无法休眠。

0

主题

14

回帖

0

牛值

江湖小虾

3 天前 楼主 显示全部楼层

另外,对比了两种芯片读取的smartctrl,差在578多了如下两条

SMART Status not supported: Incomplete response, ATA output registers missing
Warning: This result is based on an Attribute check.

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则