diff --git a/docs/.translation_cache.json b/docs/.translation_cache.json index 01f1cfdd2..e889fbccf 100644 --- a/docs/.translation_cache.json +++ b/docs/.translation_cache.json @@ -360,12 +360,15 @@ "hash": "7193f93fd9af38c8b7d2ad0ad9453ce5" }, "en:kernel/interrupt/index.rst": { - "hash": "13d79d4b53fd664cf72b95b279efcb75" + "hash": "5a42df4211e7c59aba311c9523bd529d" }, "en:kernel/interrupt/workqueue.md": { "hash": "930d4d0eefeb4c4f01ec2a93a2a1b9ad" }, "en:kernel/net/napi_and_netns_poll.md": { "hash": "04ae3378b43189a4e61226612f66f9ab" + }, + "en:kernel/interrupt/tasklet.md": { + "hash": "254da75179ebb9f39cd9b562486fb122" } } \ No newline at end of file diff --git a/docs/locales/en/kernel/interrupt/index.rst b/docs/locales/en/kernel/interrupt/index.rst index 5e10449e9..d2bbef40b 100644 --- a/docs/locales/en/kernel/interrupt/index.rst +++ b/docs/locales/en/kernel/interrupt/index.rst @@ -4,7 +4,7 @@ - Source document: kernel/interrupt/index.rst - - Translation time: 2026-01-05 16:07:55 + - Translation time: 2026-01-09 06:34:03 - Translation model: `hunyuan-turbos-latest` @@ -20,4 +20,5 @@ This is the design document related to interrupt handling and bottom half mechan .. toctree:: :maxdepth: 1 + tasklet workqueue diff --git a/docs/locales/en/kernel/interrupt/tasklet.md b/docs/locales/en/kernel/interrupt/tasklet.md new file mode 100644 index 000000000..b68965906 --- /dev/null +++ b/docs/locales/en/kernel/interrupt/tasklet.md @@ -0,0 +1,38 @@ +:::{note} +**AI Translation Notice** + +This document was automatically translated by `hunyuan-turbos-latest` model, for reference only. + +- Source document: kernel/interrupt/tasklet.md + +- Translation time: 2026-01-09 06:34:08 + +- Translation model: `hunyuan-turbos-latest` + +Please report issues via [Community Channel](https://github.com/DragonOS-Community/DragonOS/issues) + +::: + +## Tasklet + +A tasklet is a bottom-half mechanism based on softirq, used to execute lightweight, non-sleepable callback logic within a softirq context. + +### Semantic Highlights + +- Can be scheduled in hardirq/softirq/task context. +- Only one instance of the same tasklet can execute at a time (self-serializing). +- Repeated scheduling is deduplicated and will not enqueue indefinitely. +- Callbacks run in a softirq context, where sleeping is not allowed. + +### Data Passing + +The tasklet callback is abstracted through the `TaskletFunc` trait, with an equivalent function signature: + +```rust +fn(usize, Option>) +``` + +- `usize` is suitable for simple values or indices. +- `Option>` is suitable for complex data that requires safe sharing. + +`TaskletData` is constrained to `Send + Sync`, and is safely shared via `Arc` to avoid passing raw pointers.