← Documents Documentation/ABI/stable/sysfs-module GitHub 원문 ↗

Linux 6.18.37 · ABI / stable

Kernel module stable sysfs ABI

/sys/module/<MODULENAME> tree의 생성 조건과 runtime parameter, unload reference count, source checksum 및 module version file을 설명합니다.

Source pathDocumentation/ABI/stable/sysfs-module
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Module directory 생성 조건

sysfs-module:1-12

동적 module은 load되면 항상 directory가 나타나지만 built-in module은 version 또는 parameter가 있을 때만 나타납니다.

Runtime module parameters

sysfs-module:14-26

Runtime에 변경 가능한 module parameter file의 배치 위치와 parameter별 ABI 안정성 범위를 구분합니다.

Reference count와 source identity

sysfs-module:28-47

Unload 가능한 module의 현재 reference count와 MODULE_VERSION이 제공하는 source checksum·version을 노출합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 The /sys/module tree consists of the following structure:
2
3 What: /sys/module/<MODULENAME>
4 Description:
5 The name of the module that is in the kernel. This
6 module name will always show up if the module is loaded as a
7 dynamic module. If it is built directly into the kernel, it
8 will only show up if it has a version or at least one
9 parameter.
10
11 Note: The conditions of creation in the built-in case are not
12 by design and may be removed in the future.
13
14 What: /sys/module/<MODULENAME>/parameters
15 Description:
16 This directory contains individual files that are each
17 individual parameters of the module that are able to be
18 changed at runtime. See the individual module
19 documentation as to the contents of these parameters and
20 what they accomplish.
21
22 Note: The individual parameter names and values are not
23 considered stable, only the fact that they will be
24 placed in this location within sysfs. See the
25 individual driver documentation for details as to the
26 stability of the different parameters.
27
28 What: /sys/module/<MODULENAME>/refcnt
29 Description:
30 If the module is able to be unloaded from the kernel, this file
31 will contain the current reference count of the module.
32
33 Note: If the module is built into the kernel, or if the
34 CONFIG_MODULE_UNLOAD kernel configuration value is not enabled,
35 this file will not be present.
36
37 What: /sys/module/<MODULENAME>/srcversion
38 Date: Jun 2005
39 Description:
40 If the module source has MODULE_VERSION, this file will contain
41 the checksum of the source code.
42
43 What: /sys/module/<MODULENAME>/version
44 Date: Jun 2005
45 Description:
46 If the module source has MODULE_VERSION, this file will contain
47 the version of the source code.
48

3. 한국어 전문 번역

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

/sys/module tree와 module directory

1-12

/sys/module tree는 다음 구조로 이루어진다.

항목내용
What/sys/module/<MODULENAME>
DescriptionKernel 안에 존재하는 module의 이름이다. 동적 module로 load된 경우 이 module 이름은 항상 나타난다. Kernel에 직접 built-in된 경우에는 version이 있거나 parameter가 하나 이상 있을 때만 나타난다.

Built-in module에 관한 이 생성 조건은 의도적으로 설계된 규약이 아니며, 향후 제거될 수 있다.

Runtime에 변경 가능한 module parameter

14-26
항목내용
What/sys/module/<MODULENAME>/parameters
Description이 directory에는 runtime에 변경할 수 있는 module의 개별 parameter를 각각의 file로 담는다. 각 parameter의 내용과 기능은 해당 module의 개별 문서를 참조한다.

개별 parameter의 이름과 값 자체는 stable ABI로 간주하지 않는다. Stable한 것은 이들이 sysfs의 해당 위치에 배치된다는 사실뿐이다. 서로 다른 parameter의 안정성에 관한 세부 사항은 개별 driver 문서를 참조한다.

Unload 가능 module의 reference count

28-35
항목내용
What/sys/module/<MODULENAME>/refcnt
Description해당 module을 kernel에서 unload할 수 있다면 이 file은 module의 현재 reference count를 담는다.

Module이 kernel에 built-in되어 있거나 `CONFIG_MODULE_UNLOAD` kernel configuration 값이 활성화되지 않았다면 이 file은 존재하지 않는다.

Source checksum과 version

37-47
경로날짜내용
/sys/module/<MODULENAME>/srcversion2005년 6월Module source에 `MODULE_VERSION`이 있으면 source code의 checksum을 담는다.
/sys/module/<MODULENAME>/version2005년 6월Module source에 `MODULE_VERSION`이 있으면 source code의 version을 담는다.
/sys/module/<MODULENAME> 구성
동적 module load 또는 조건을 충족한 built-in module/sys/module/<MODULENAME> directory 생성변경 가능한 항목은 parameters/ 아래에 개별 file로 배치Unload 지원 시 refcnt로 현재 reference count 노출MODULE_VERSION이 있으면 srcversion과 version 노출

Module의 build 방식과 configuration에 따라 나타나는 directory와 file이 달라진다.