← Documents Documentation/ABI/testing/sysfs-block-device GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

Block device activity, shock protection와 command priority sysfs ABI

Block device의 software-controlled activity LED, hard disk head unload, SATA·SAS NCQ priority support와 enable, ATA·SCSI command duration limits를 설명합니다.

Source pathDocumentation/ABI/testing/sysfs-block-device
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Software-controlled activity LED

sysfs-block-device:1-20

sw_activity는 software가 activity LED를 off, activity 시 on-blink 또는 idle-on/activity-off-blink 방식으로 제어하며 em_message와의 ownership 조건을 정의합니다.

Hard disk shock protection

sysfs-block-device:23-50

unload_heads는 지정한 millisecond 동안 head를 platter에서 치우고 I/O를 막으며, timeout·feature override·error code와 관련 documentation path를 규정합니다.

SATA와 SAS-attached NCQ priority enable

sysfs-block-device:53-75

ncq_prio_enable과 sas_ncq_prio_enable은 native command queueing priority를 제어하며, SAS HBA driver support에 따라 attribute 존재 여부가 달라집니다.

NCQ priority support indicators

sysfs-block-device:78-97

Read-only support attributes는 device capability와 SAS HBA implementation 조건을 구분해 보고합니다.

ATA·SCSI command duration limits

sysfs-block-device:100-119

cdl_supported와 cdl_enable은 command duration limits capability를 확인하고 read·write command에 대한 kernel과 device 기능을 함께 켜거나 끕니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /sys/block/*/device/sw_activity
2 Date: Jun, 2008
3 KernelVersion: v2.6.27
4 Contact: linux-ide@vger.kernel.org
5 Description:
6 (RW) Used by drivers which support software controlled activity
7 LEDs.
8
9 It has the following valid values:
10
11 == ========================================================
12 0 OFF - the LED is not activated on activity
13 1 BLINK_ON - the LED blinks on every 10ms when activity is
14 detected.
15 2 BLINK_OFF - the LED is on when idle, and blinks off
16 every 10ms when activity is detected.
17 == ========================================================
18
19 Note that the user must turn sw_activity OFF it they wish to
20 control the activity LED via the em_message file.
21
22
23 What: /sys/block/*/device/unload_heads
24 Date: Sep, 2008
25 KernelVersion: v2.6.28
26 Contact: linux-ide@vger.kernel.org
27 Description:
28 (RW) Hard disk shock protection
29
30 Writing an integer value to this file will take the heads of the
31 respective drive off the platter and block all I/O operations
32 for the specified number of milliseconds.
33
34 - If the device does not support the unload heads feature,
35 access is denied with -EOPNOTSUPP.
36 - The maximal value accepted for a timeout is 30000
37 milliseconds.
38 - A previously set timeout can be cancelled and disk can resume
39 normal operation immediately by specifying a timeout of 0.
40 - Some hard drives only comply with an earlier version of the
41 ATA standard, but support the unload feature nonetheless.
42 There is no safe way Linux can detect these devices, so this
43 is not enabled by default. If it is known that your device
44 does support the unload feature, then you can tell the kernel
45 to enable it by writing -1. It can be disabled again by
46 writing -2.
47 - Values below -2 are rejected with -EINVAL
48
49 For more information, see
50 Documentation/admin-guide/laptops/disk-shock-protection.rst
51
52
53 What: /sys/block/*/device/ncq_prio_enable
54 Date: Oct, 2016
55 KernelVersion: v4.10
56 Contact: linux-ide@vger.kernel.org
57 Description:
58 (RW) Write to the file to turn on or off the SATA NCQ (native
59 command queueing) priority support. By default this feature is
60 turned off. If the device does not support the SATA NCQ
61 priority feature, writing "1" to this file results in an error
62 (see ncq_prio_supported).
63
64
65 What: /sys/block/*/device/sas_ncq_prio_enable
66 Date: Oct, 2016
67 KernelVersion: v4.10
68 Contact: linux-ide@vger.kernel.org
69 Description:
70 (RW) This is the equivalent of the ncq_prio_enable attribute
71 file for SATA devices connected to a SAS host-bus-adapter
72 (HBA) implementing support for the SATA NCQ priority feature.
73 This file does not exist if the HBA driver does not implement
74 support for the SATA NCQ priority feature, regardless of the
75 device support for this feature (see sas_ncq_prio_supported).
76
77
78 What: /sys/block/*/device/ncq_prio_supported
79 Date: Aug, 2021
80 KernelVersion: v5.15
81 Contact: linux-ide@vger.kernel.org
82 Description:
83 (RO) Indicates if the device supports the SATA NCQ (native
84 command queueing) priority feature.
85
86
87 What: /sys/block/*/device/sas_ncq_prio_supported
88 Date: Aug, 2021
89 KernelVersion: v5.15
90 Contact: linux-ide@vger.kernel.org
91 Description:
92 (RO) This is the equivalent of the ncq_prio_supported attribute
93 file for SATA devices connected to a SAS host-bus-adapter
94 (HBA) implementing support for the SATA NCQ priority feature.
95 This file does not exist if the HBA driver does not implement
96 support for the SATA NCQ priority feature, regardless of the
97 device support for this feature.
98
99
100 What: /sys/block/*/device/cdl_supported
101 Date: May, 2023
102 KernelVersion: v6.5
103 Contact: linux-scsi@vger.kernel.org
104 Description:
105 (RO) Indicates if the device supports the command duration
106 limits feature found in some ATA and SCSI devices.
107
108
109 What: /sys/block/*/device/cdl_enable
110 Date: May, 2023
111 KernelVersion: v6.5
112 Contact: linux-scsi@vger.kernel.org
113 Description:
114 (RW) For a device supporting the command duration limits
115 feature, write to the file to turn on or off the feature.
116 By default this feature is turned off.
117 Writing "1" to this file enables the use of command duration
118 limits for read and write commands in the kernel and turns on
119 the feature on the device. Writing "0" disables the feature.
120

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Software-controlled activity LED

1-20
항목전문 번역
What/sys/block/*/device/sw_activity
Date2008년 6월
KernelVersionv2.6.27
Contactlinux-ide@vger.kernel.org
Description(RW) Software-controlled activity LED를 지원하는 driver가 사용합니다.
이름전문 번역
0OFFActivity가 있어도 LED를 activate하지 않습니다.
1BLINK_ONActivity를 감지하면 LED가 매 10ms마다 켜지는 방식으로 blink합니다.
2BLINK_OFFIdle일 때 LED가 켜져 있고, activity를 감지하면 매 10ms마다 꺼지는 방식으로 blink합니다.

사용자가 em_message file을 통해 activity LED를 제어하려면 sw_activity를 OFF로 설정해야 합니다.

Hard disk head unload와 I/O 차단

23-50
항목전문 번역
What/sys/block/*/device/unload_heads
Date2008년 9월
KernelVersionv2.6.28
Contactlinux-ide@vger.kernel.org
Description(RW) Hard disk shock protection입니다.

이 file에 정수 값을 쓰면 해당 drive의 head를 platter에서 치우고 지정한 millisecond 동안 모든 I/O operation을 차단합니다.

값·조건전문 번역
Feature 미지원Device가 unload heads feature를 지원하지 않으면 access가 -EOPNOTSUPP로 거부됩니다.
1..30000Timeout으로 받아들이는 maximum 값은 30000ms입니다.
0이전에 설정한 timeout을 cancel하고 disk가 즉시 normal operation을 재개하게 합니다.
-1Linux가 안전하게 감지할 수 없는 구형 ATA standard device에서 unload feature support를 알고 있을 때 kernel에 강제로 enable하도록 알립니다.
-2-1로 강제 enable한 unload feature를 다시 disable합니다.
< -2값을 -EINVAL로 거부합니다.

일부 hard drive는 이전 ATA standard version만 준수하지만 unload feature를 지원합니다. Linux가 이런 device를 안전하게 감지할 방법이 없으므로 default로 enable하지 않습니다.

자세한 내용은 Documentation/admin-guide/laptops/disk-shock-protection.rst를 참조하십시오.

Head unload timeout control
Write timeout in millisecondsUnload drive headsBlock all I/OTimeout expiresResume normal operation
Write 0Cancel previous timeoutResume immediately
Legacy ATA deviceWrite -1 to force enableWrite -2 to disable

Shock 감지 뒤 head를 안전한 위치로 옮기고 I/O를 timeout 동안 차단하거나 즉시 cancel하는 흐름이다.

NCQ priority 기능 enable

53-75
WhatDateKernelVersionContact전문 번역
/sys/block/*/device/ncq_prio_enable2016년 10월v4.10linux-ide@vger.kernel.org(RW) 이 file에 써서 SATA NCQ(native command queueing) priority support를 켜거나 끕니다. Default로 이 feature는 꺼져 있습니다. Device가 SATA NCQ priority feature를 지원하지 않으면 이 file에 "1"을 쓸 때 error가 발생합니다. ncq_prio_supported를 참조하십시오.
/sys/block/*/device/sas_ncq_prio_enable2016년 10월v4.10linux-ide@vger.kernel.org(RW) SATA NCQ priority feature support를 구현한 SAS host-bus-adapter(HBA)에 연결된 SATA device에서 ncq_prio_enable과 동등한 attribute file입니다. HBA driver가 SATA NCQ priority feature support를 구현하지 않았다면 device가 이 feature를 지원하더라도 이 file은 존재하지 않습니다. sas_ncq_prio_supported를 참조하십시오.

NCQ priority support 확인

78-97
WhatDateKernelVersionContact전문 번역
/sys/block/*/device/ncq_prio_supported2021년 8월v5.15linux-ide@vger.kernel.org(RO) Device가 SATA NCQ(native command queueing) priority feature를 지원하는지 나타냅니다.
/sys/block/*/device/sas_ncq_prio_supported2021년 8월v5.15linux-ide@vger.kernel.org(RO) SATA NCQ priority feature support를 구현한 SAS host-bus-adapter(HBA)에 연결된 SATA device에서 ncq_prio_supported와 동등한 attribute file입니다. HBA driver가 SATA NCQ priority feature support를 구현하지 않았다면 device가 이 feature를 지원하더라도 이 file은 존재하지 않습니다.
SATA와 SAS 경유 NCQ priority 조건
Direct SATA devicencq_prio_supportedncq_prio_enable
SATA device behind SAS HBAHBA driver implements NCQ prioritysas_ncq_prio_supported existssas_ncq_prio_enable exists
SAS HBA driver lacks supportSAS NCQ attributes absentDevice capability does not change absence

Direct SATA device capability와 SAS HBA driver implementation이 각각 어떤 sysfs attribute를 결정하는지 구분한다.

Command duration limits capability와 enable

100-119
WhatDateKernelVersionContact전문 번역
/sys/block/*/device/cdl_supported2023년 5월v6.5linux-scsi@vger.kernel.org(RO) 일부 ATA와 SCSI device에 있는 command duration limits feature를 device가 지원하는지 나타냅니다.
/sys/block/*/device/cdl_enable2023년 5월v6.5linux-scsi@vger.kernel.org(RW) Command duration limits feature를 지원하는 device에서 이 file에 써서 feature를 켜거나 끕니다. Default로 이 feature는 꺼져 있습니다. 이 file에 "1"을 쓰면 kernel의 read·write command에 command duration limits 사용을 enable하고 device에서도 feature를 켭니다. "0"을 쓰면 feature를 disable합니다.