Skip to content

Commit a0ef97e

Browse files
Update translated documentation (#1289)
1 parent ef296a3 commit a0ef97e

File tree

3 files changed

+79
-6
lines changed

3 files changed

+79
-6
lines changed

docs/.translation_cache.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"hash": "72efe542c7854926ac0f33287345b856"
127127
},
128128
"en:kernel/ipc/index.rst": {
129-
"hash": "bbc40e0a41a1467dbdd42196c443f1ef"
129+
"hash": "e75d2ff6a7b8a4e6f32b2adee7756298"
130130
},
131131
"en:kernel/boot/index.rst": {
132132
"hash": "8fe854f9c48d4e2e3fee0cf7f3526dfe"
@@ -289,5 +289,8 @@
289289
},
290290
"en:kernel/net/unix.md": {
291291
"hash": "73ec9615b972824183480217036a89a7"
292+
},
293+
"en:kernel/ipc/ipc_namespace.md": {
294+
"hash": "52df04d6a276b42617f7b79bbbffa61e"
292295
}
293296
}
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
.. note:: AI Translation Notice
22

3-
This document was automatically translated by `Qwen/Qwen3-8B` model, for reference only.
3+
This document was automatically translated by `hunyuan-turbos-latest` model, for reference only.
44

55
- Source document: kernel/ipc/index.rst
66

7-
- Translation time: 2025-05-19 01:41:19
7+
- Translation time: 2025-09-24 08:15:51
88

9-
- Translation model: `Qwen/Qwen3-8B`
9+
- Translation model: `hunyuan-turbos-latest`
1010

1111

1212
Please report issues via `Community Channel <https://github.com/DragonOS-Community/DragonOS/issues>`_
1313

1414
====================================
15-
Inter-Process Communication
15+
Interprocess Communication
1616
====================================
1717

18-
This is the documentation for DragonOS Inter-Process Communication (IPC).
18+
This is the documentation for interprocess communication (IPC) in DragonOS.
1919

2020
.. toctree::
2121
:maxdepth: 1
2222

2323
signal
24+
ipc_namespace
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
:::{note}
2+
**AI Translation Notice**
3+
4+
This document was automatically translated by `hunyuan-turbos-latest` model, for reference only.
5+
6+
- Source document: kernel/ipc/ipc_namespace.md
7+
8+
- Translation time: 2025-09-24 08:16:12
9+
10+
- Translation model: `hunyuan-turbos-latest`
11+
12+
Please report issues via [Community Channel](https://github.com/DragonOS-Community/DragonOS/issues)
13+
14+
:::
15+
16+
# IPC Namespace
17+
18+
:::{note}
19+
20+
Author: longjin <[email protected]>
21+
22+
:::
23+
24+
This page describes the current support status and future plans for IPC namespaces in DragonOS. The goal is to expose semantics consistent with Linux to users while gradually improving upon DragonOS's existing framework.
25+
26+
## Supported Features
27+
- Integration of IpcNamespace object with NsProxy:
28+
- Added `IpcNamespace` and connected to `NsProxy`, allowing each task to access its associated IPC namespace via `nsproxy.ipc_ns`.
29+
- Namespace creation/inheritance follows `clone/unshare` semantics:
30+
- Inherits the parent namespace when `CLONE_NEWIPC` is not included;
31+
- Creates an independent IPC namespace when `CLONE_NEWIPC` is included;
32+
- Mutually exclusive with `CLONE_SYSVSEM`, with behavior consistent with Linux.
33+
34+
- SysV SHM (Shared Memory) isolated by namespace:
35+
- Refactored the original global `SHM_MANAGER` into per-ns `ShmManager`, with all `shmget/shmat/shmdt/shmctl` taking effect under `current.nsproxy.ipc_ns`.
36+
- `shmat`/`shmdt`: VMA records `ShmId`, precisely maintaining `map_count` during unmapping; after `IPC_RMID`, physical reclamation is completed when `SHM_DEST && map_count==0`.
37+
- Basic semantics and error codes aligned: `IPC_CREAT|IPC_EXCL`, `ENOENT`, rejection of `SHM_HUGETLB`, etc.
38+
39+
- Basic test cases: (in `test_ipc_ns_shm.rs`)
40+
41+
- After `unshare(CLONE_NEWIPC)`, keys in parent/child namespaces are not visible;
42+
- Same keys across namespaces do not conflict;
43+
- After `IPC_RMID`, the same key can be recreated;
44+
- Outputs PASS/FAIL and summary results.
45+
46+
## Not Yet Implemented / Planned
47+
- `/proc/[pid]/ns/ipc` and `setns`:
48+
- Temporarily postponed, with only planning for read-only placeholders and the simplest `setns` path; permission validation and switching sequencing will be added in subsequent versions.
49+
50+
- Other SysV IPC subsystems:
51+
- `msg/sem` framework not yet incorporated; UNDO lists for `sem` and coordination with `unshare/setns` need to be implemented simultaneously when introduced.
52+
53+
- POSIX mqueue:
54+
- Per-ns mqueuefs kernel mounting, quotas, and sysctl not yet provided.
55+
56+
- Permissions and quotas:
57+
- `ipcperms()`, `ns_capable(user_ns, CAP_IPC_OWNER)`;
58+
- ucounts/RLIMIT and per-ns sysctl such as `/proc/sys/kernel/shm*`.
59+
60+
## Compatibility and Notes
61+
- At this stage, only SysV SHM provides namespace isolation; other IPC types still operate under global semantics.
62+
- Code evolves in a modular manner: when adding `msg/sem/mqueue` later, stability and consistency of user-side semantics will be maintained.
63+
64+
## References
65+
- Code locations:
66+
- `kernel/src/process/namespace/ipc_namespace.rs`
67+
- `kernel/src/process/namespace/nsproxy.rs`
68+
- `kernel/src/ipc/syscall/` within `sys_shm*`
69+
- `kernel/src/mm/ucontext.rs` (VMA and SHM count maintenance)

0 commit comments

Comments
 (0)