요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Primary compression과 memory management
sysfs-block-zram:25-58comp_algorithm, mem_used_max, mem_limit과 compact가 algorithm selection, peak counter reset, runtime memory cap과 fragmented allocator space 회수를 제어합니다.
I/O, memory와 debug statistics
sysfs-block-zram:60-84io_stat은 block layer 밖의 I/O statistics, mm_stat은 compression memory statistics, debug_stat은 안정된 format을 보장하지 않는 developer debugging information입니다.
Backing device와 idle·huge page writeback
sysfs-block-zram:86-115backing_dev, idle, writeback과 bd_stat이 incompressible page용 storage, idle slot marking, idle·huge page writeback과 backing-device counters를 제공합니다.
Runtime writeback limit
sysfs-block-zram:117-131writeback_limit_enable과 writeback_limit은 writeback cap feature와 runtime maximum amount를 제어하며 initial state는 limit가 없는 0입니다.
Secondary recompression과 algorithm parameters
sysfs-block-zram:133-152recomp_algorithm은 secondary compression algorithms를 설정·표시하고 recompress는 이를 이용한 re-compression을 시작하며 algorithm_params는 compression parameters를 설정합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/block/zram<id>/disksize
Date: August 2010
Contact: Nitin Gupta <[email protected]>
Description:
The disksize file is read-write and specifies the disk size
which represents the limit on the *uncompressed* worth of data
that can be stored in this disk.
Unit: bytes
What: /sys/block/zram<id>/initstate
Date: August 2010
Contact: Nitin Gupta <[email protected]>
Description:
The initstate file is read-only and shows the initialization
state of the device.
What: /sys/block/zram<id>/reset
Date: August 2010
Contact: Nitin Gupta <[email protected]>
Description:
The reset file is write-only and allows resetting the
device. The reset operation frees all the memory associated
with this device.
What: /sys/block/zram<id>/comp_algorithm
Date: February 2014
Contact: Sergey Senozhatsky <[email protected]>
Description:
The comp_algorithm file is read-write and lets to show
available and selected compression algorithms, change
compression algorithm selection.
What: /sys/block/zram<id>/mem_used_max
Date: August 2014
Contact: Minchan Kim <[email protected]>
Description:
The mem_used_max file is write-only and is used to reset
the counter of maximum memory zram have consumed to store
compressed data. For resetting the value, you should write
"0". Otherwise, you could see -EINVAL.
Unit: bytes
What: /sys/block/zram<id>/mem_limit
Date: August 2014
Contact: Minchan Kim <[email protected]>
Description:
The mem_limit file is write-only and specifies the maximum
amount of memory ZRAM can use to store the compressed data.
The limit could be changed in run time and "0" means disable
the limit. No limit is the initial state. Unit: bytes
What: /sys/block/zram<id>/compact
Date: August 2015
Contact: Minchan Kim <[email protected]>
Description:
The compact file is write-only and trigger compaction for
allocator zrm uses. The allocator moves some objects so that
it could free fragment space.
What: /sys/block/zram<id>/io_stat
Date: August 2015
Contact: Sergey Senozhatsky <[email protected]>
Description:
The io_stat file is read-only and accumulates device's I/O
statistics not accounted by block layer. For example,
failed_reads, failed_writes, etc. File format is similar to
block layer statistics file format.
What: /sys/block/zram<id>/mm_stat
Date: August 2015
Contact: Sergey Senozhatsky <[email protected]>
Description:
The mm_stat file is read-only and represents device's mm
statistics (orig_data_size, compr_data_size, etc.) in a format
similar to block layer statistics file format.
What: /sys/block/zram<id>/debug_stat
Date: July 2016
Contact: Sergey Senozhatsky <[email protected]>
Description:
The debug_stat file is read-only and represents various
device's debugging info useful for kernel developers. Its
format is not documented intentionally and may change
anytime without any notice.
What: /sys/block/zram<id>/backing_dev
Date: June 2017
Contact: Minchan Kim <[email protected]>
Description:
The backing_dev file is read-write and set up backing
device for zram to write incompressible pages.
For using, user should enable CONFIG_ZRAM_WRITEBACK.
What: /sys/block/zram<id>/idle
Date: November 2018
Contact: Minchan Kim <[email protected]>
Description:
idle file is write-only and mark zram slot as idle.
If system has mounted debugfs, user can see which slots
are idle via /sys/kernel/debug/zram/zram<id>/block_state
What: /sys/block/zram<id>/writeback
Date: November 2018
Contact: Minchan Kim <[email protected]>
Description:
The writeback file is write-only and trigger idle and/or
huge page writeback to backing device.
What: /sys/block/zram<id>/bd_stat
Date: November 2018
Contact: Minchan Kim <[email protected]>
Description:
The bd_stat file is read-only and represents backing device's
statistics (bd_count, bd_reads, bd_writes) in a format
similar to block layer statistics file format.
What: /sys/block/zram<id>/writeback_limit_enable
Date: November 2018
Contact: Minchan Kim <[email protected]>
Description:
The writeback_limit_enable file is read-write and specifies
eanbe of writeback_limit feature. "1" means eable the feature.
No limit "0" is the initial state.
What: /sys/block/zram<id>/writeback_limit
Date: November 2018
Contact: Minchan Kim <[email protected]>
Description:
The writeback_limit file is read-write and specifies the maximum
amount of writeback ZRAM can do. The limit could be changed
in run time.
What: /sys/block/zram<id>/recomp_algorithm
Date: November 2022
Contact: Sergey Senozhatsky <[email protected]>
Description:
The recomp_algorithm file is read-write and allows to set
or show secondary compression algorithms.
What: /sys/block/zram<id>/recompress
Date: November 2022
Contact: Sergey Senozhatsky <[email protected]>
Description:
The recompress file is write-only and triggers re-compression
with secondary compression algorithms.
What: /sys/block/zram<id>/algorithm_params
Date: August 2024
Contact: Sergey Senozhatsky <[email protected]>
Description:
The algorithm_params file is write-only and is used to setup
compression algorithm parameters.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
ZRAM disk size, initialization과 reset
1-23| What | Date | Contact | 전문 번역 |
|---|---|---|---|
| /sys/block/zram<id>/disksize | 2010년 8월 | Nitin Gupta <[email protected]> | disksize file은 read-write이며 이 disk에 저장할 수 있는 uncompressed data 상당량의 limit를 나타내는 disk size를 지정합니다. 단위는 bytes입니다. |
| /sys/block/zram<id>/initstate | 2010년 8월 | Nitin Gupta <[email protected]> | initstate file은 read-only이며 device의 initialization state를 보여 줍니다. |
| /sys/block/zram<id>/reset | 2010년 8월 | Nitin Gupta <[email protected]> | reset file은 write-only이며 device를 reset할 수 있게 합니다. Reset operation은 이 device와 연결된 모든 memory를 해제합니다. |
Uncompressed logical capacity를 정하고 device를 사용한 뒤 reset으로 모든 관련 memory를 해제하는 lifecycle이다.
Compression algorithm과 memory control
25-58| What | Date | Contact | 전문 번역 |
|---|---|---|---|
| /sys/block/zram<id>/comp_algorithm | 2014년 2월 | Sergey Senozhatsky <[email protected]> | comp_algorithm file은 read-write이며 available compression algorithm과 selected compression algorithm을 보여 주고 compression algorithm selection을 변경할 수 있게 합니다. |
| /sys/block/zram<id>/mem_used_max | 2014년 8월 | Minchan Kim <[email protected]> | mem_used_max file은 write-only이며 compressed data를 저장하기 위해 ZRAM이 소비한 maximum memory counter를 reset하는 데 사용합니다. 값을 reset하려면 "0"을 써야 합니다. 그 밖의 값을 쓰면 -EINVAL이 발생할 수 있습니다. 단위는 bytes입니다. |
| /sys/block/zram<id>/mem_limit | 2014년 8월 | Minchan Kim <[email protected]> | mem_limit file은 write-only이며 compressed data를 저장할 때 ZRAM이 사용할 수 있는 maximum memory amount를 지정합니다. Limit는 runtime에 변경할 수 있고 "0"은 limit를 disable한다는 뜻입니다. Initial state에는 limit가 없습니다. 단위는 bytes입니다. |
| /sys/block/zram<id>/compact | 2015년 8월 | Minchan Kim <[email protected]> | compact file은 write-only이며 ZRAM이 사용하는 allocator의 compaction을 trigger합니다. Allocator가 일부 object를 이동하여 fragmented space를 해제할 수 있게 합니다. |
| Attribute | 특수 입력 | 결과 |
|---|---|---|
| mem_used_max | 0 | Maximum consumed-memory counter reset |
| mem_used_max | 0 이외 | -EINVAL 가능 |
| mem_limit | 0 | Memory limit disable |
| mem_limit | byte 값 | Runtime maximum memory 변경 |
ZRAM I/O, memory와 debug statistics
60-84| What | Date | Contact | 전문 번역 |
|---|---|---|---|
| /sys/block/zram<id>/io_stat | 2015년 8월 | Sergey Senozhatsky <[email protected]> | io_stat file은 read-only이며 block layer가 account하지 않는 device I/O statistics를 누적합니다. failed_reads, failed_writes 등이 그 예입니다. File format은 block layer statistics file format과 비슷합니다. |
| /sys/block/zram<id>/mm_stat | 2015년 8월 | Sergey Senozhatsky <[email protected]> | mm_stat file은 read-only이며 orig_data_size, compr_data_size 같은 device memory-management statistics를 block layer statistics file format과 비슷한 format으로 나타냅니다. |
| /sys/block/zram<id>/debug_stat | 2016년 7월 | Sergey Senozhatsky <[email protected]> | debug_stat file은 read-only이며 kernel developer에게 유용한 다양한 device debugging information을 나타냅니다. 이 format은 의도적으로 document하지 않으며 어떤 notice도 없이 언제든 바뀔 수 있습니다. |
Backing device, idle slots와 writeback
86-115| What | Date | Contact | 전문 번역 |
|---|---|---|---|
| /sys/block/zram<id>/backing_dev | 2017년 6월 | Minchan Kim <[email protected]> | backing_dev file은 read-write이며 ZRAM이 incompressible page를 기록할 backing device를 setup합니다. 사용하려면 CONFIG_ZRAM_WRITEBACK을 enable해야 합니다. |
| /sys/block/zram<id>/idle | 2018년 11월 | Minchan Kim <[email protected]> | idle file은 write-only이며 ZRAM slot을 idle로 mark합니다. System에 debugfs가 mount되어 있다면 /sys/kernel/debug/zram/zram<id>/block_state에서 어떤 slot이 idle인지 볼 수 있습니다. |
| /sys/block/zram<id>/writeback | 2018년 11월 | Minchan Kim <[email protected]> | writeback file은 write-only이며 idle page 및/또는 huge page를 backing device로 writeback하도록 trigger합니다. |
| /sys/block/zram<id>/bd_stat | 2018년 11월 | Minchan Kim <[email protected]> | bd_stat file은 read-only이며 bd_count, bd_reads, bd_writes 같은 backing device statistics를 block layer statistics file format과 비슷한 format으로 나타냅니다. |
Compressible data는 memory에 유지하고 incompressible·idle·huge pages는 configured backing device로 이동할 수 있다.
Writeback amount 제한
117-131| What | Date | Contact | 전문 번역 |
|---|---|---|---|
| /sys/block/zram<id>/writeback_limit_enable | 2018년 11월 | Minchan Kim <[email protected]> | writeback_limit_enable file은 read-write이며 writeback_limit feature를 enable할지 지정합니다. "1"은 feature enable을 뜻합니다. Limit가 없는 "0"이 initial state입니다. |
| /sys/block/zram<id>/writeback_limit | 2018년 11월 | Minchan Kim <[email protected]> | writeback_limit file은 read-write이며 ZRAM이 수행할 수 있는 maximum writeback amount를 지정합니다. Limit는 runtime에 변경할 수 있습니다. |
| writeback_limit_enable | 의미 |
|---|---|
| 0 | Writeback limit 없음(initial state) |
| 1 | writeback_limit feature enable |
Secondary compression과 parameters
133-152| What | Date | Contact | 전문 번역 |
|---|---|---|---|
| /sys/block/zram<id>/recomp_algorithm | 2022년 11월 | Sergey Senozhatsky <[email protected]> | recomp_algorithm file은 read-write이며 secondary compression algorithm을 설정하거나 보여 줄 수 있게 합니다. |
| /sys/block/zram<id>/recompress | 2022년 11월 | Sergey Senozhatsky <[email protected]> | recompress file은 write-only이며 secondary compression algorithm을 사용한 re-compression을 trigger합니다. |
| /sys/block/zram<id>/algorithm_params | 2024년 8월 | Sergey Senozhatsky <[email protected]> | algorithm_params file은 write-only이며 compression algorithm parameters를 setup하는 데 사용합니다. |
Initial compression 이후 secondary algorithm을 선택해 existing compressed data를 다시 압축하는 control path이다.
Device size, initialization과 reset
sysfs-block-zram:1-23disksize는 저장 가능한 uncompressed data의 byte limit, initstate는 initialization state이며 reset은 device와 연결된 모든 memory를 해제합니다.