kernel/vhost_task.c
Source file repositories/reference/linux-study-clean/kernel/vhost_task.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/vhost_task.c- Extension
.c- Size
- 3848 bytes
- Lines
- 165
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/slab.hlinux/completion.hlinux/sched/task.hlinux/sched/vhost_task.hlinux/sched/signal.h
Detected Declarations
struct vhost_taskenum vhost_task_flagsfunction vhost_task_fnfunction vhost_task_wakefunction vhost_task_stopfunction ERR_PTRfunction vhost_task_startexport vhost_task_wakeexport vhost_task_stopexport vhost_task_createexport vhost_task_start
Annotated Snippet
tsk = copy_process(NULL, 0, NUMA_NO_NODE, &args);
if (IS_ERR(tsk)) {
kfree(vtsk);
return ERR_CAST(tsk);
}
vtsk->task = get_task_struct(tsk);
return vtsk;
}
EXPORT_SYMBOL_GPL(vhost_task_create);
/**
* vhost_task_start - start a vhost_task created with vhost_task_create
* @vtsk: vhost_task to wake up
*/
void vhost_task_start(struct vhost_task *vtsk)
{
wake_up_new_task(vtsk->task);
}
EXPORT_SYMBOL_GPL(vhost_task_start);
Annotation
- Immediate include surface: `linux/slab.h`, `linux/completion.h`, `linux/sched/task.h`, `linux/sched/vhost_task.h`, `linux/sched/signal.h`.
- Detected declarations: `struct vhost_task`, `enum vhost_task_flags`, `function vhost_task_fn`, `function vhost_task_wake`, `function vhost_task_stop`, `function ERR_PTR`, `function vhost_task_start`, `export vhost_task_wake`, `export vhost_task_stop`, `export vhost_task_create`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.