include/linux/sched/task_stack.h
Source file repositories/reference/linux-study-clean/include/linux/sched/task_stack.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/sched/task_stack.h- Extension
.h- Size
- 2966 bytes
- Lines
- 118
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched.hlinux/magic.hlinux/refcount.hlinux/kasan.h
Detected Declarations
function try_get_task_stackfunction setup_thread_stackfunction put_task_stackfunction object_is_on_stackfunction stack_not_usedfunction kstack_end
Annotated Snippet
static inline void put_task_stack(struct task_struct *tsk) {}
#endif
void exit_task_stack_account(struct task_struct *tsk);
#define task_stack_end_corrupted(task) \
(*(end_of_stack(task)) != STACK_END_MAGIC)
static inline int object_is_on_stack(const void *obj)
{
void *stack = task_stack_page(current);
obj = kasan_reset_tag(obj);
return (obj >= stack) && (obj < (stack + THREAD_SIZE));
}
extern void thread_stack_cache_init(void);
#ifdef CONFIG_DEBUG_STACK_USAGE
unsigned long stack_not_used(struct task_struct *p);
#else
static inline unsigned long stack_not_used(struct task_struct *p)
{
return 0;
}
#endif
extern void set_task_stack_end_magic(struct task_struct *tsk);
static inline int kstack_end(void *addr)
{
/* Reliable end of stack detection:
* Some APM bios versions misalign the stack
*/
return !(((unsigned long)addr+sizeof(void*)-1) & (THREAD_SIZE-sizeof(void*)));
}
#endif /* _LINUX_SCHED_TASK_STACK_H */
Annotation
- Immediate include surface: `linux/sched.h`, `linux/magic.h`, `linux/refcount.h`, `linux/kasan.h`.
- Detected declarations: `function try_get_task_stack`, `function setup_thread_stack`, `function put_task_stack`, `function object_is_on_stack`, `function stack_not_used`, `function kstack_end`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
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.