include/linux/delayacct.h
Source file repositories/reference/linux-study-clean/include/linux/delayacct.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/delayacct.h- Extension
.h- Size
- 7536 bytes
- Lines
- 297
- 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
uapi/linux/taskstats.hlinux/sched.hlinux/slab.hlinux/jump_label.h
Detected Declarations
struct task_delay_infofunction delayacct_tsk_initfunction delayacct_tsk_freefunction delayacct_blkio_startfunction delayacct_blkio_endfunction delayacct_blkio_ticksfunction delayacct_freepages_startfunction delayacct_freepages_endfunction delayacct_thrashing_startfunction delayacct_thrashing_endfunction delayacct_swapin_startfunction delayacct_swapin_endfunction delayacct_compact_startfunction delayacct_compact_endfunction delayacct_wpcopy_startfunction delayacct_wpcopy_endfunction delayacct_irqfunction delayacct_initfunction delayacct_blkio_ticksfunction delayacct_is_task_waiting_on_iofunction delayacct_freepages_start
Annotated Snippet
struct task_delay_info {
raw_spinlock_t lock;
/* For each stat XXX, add following, aligned appropriately
*
* struct timespec XXX_start, XXX_end;
* u64 XXX_delay;
* u32 XXX_count;
*
* Atomicity of updates to XXX_delay, XXX_count protected by
* single lock above (split into XXX_lock if contention is an issue).
*/
/*
* XXX_count is incremented on every XXX operation, the delay
* associated with the operation is added to XXX_delay.
* XXX_delay contains the accumulated delay time in nanoseconds.
*/
u64 blkio_start;
u64 blkio_delay_max;
u64 blkio_delay_min;
u64 blkio_delay; /* wait for sync block io completion */
u64 swapin_start;
u64 swapin_delay_max;
u64 swapin_delay_min;
u64 swapin_delay; /* wait for swapin */
u32 blkio_count; /* total count of the number of sync block */
/* io operations performed */
u32 swapin_count; /* total count of swapin */
u64 freepages_start;
u64 freepages_delay_max;
u64 freepages_delay_min;
u64 freepages_delay; /* wait for memory reclaim */
u64 thrashing_start;
u64 thrashing_delay_max;
u64 thrashing_delay_min;
u64 thrashing_delay; /* wait for thrashing page */
u64 compact_start;
u64 compact_delay_max;
u64 compact_delay_min;
u64 compact_delay; /* wait for memory compact */
u64 wpcopy_start;
u64 wpcopy_delay_max;
u64 wpcopy_delay_min;
u64 wpcopy_delay; /* wait for write-protect copy */
u64 irq_delay_max;
u64 irq_delay_min;
u64 irq_delay; /* wait for IRQ/SOFTIRQ */
u32 freepages_count; /* total count of memory reclaim */
u32 thrashing_count; /* total count of thrash waits */
u32 compact_count; /* total count of memory compact */
u32 wpcopy_count; /* total count of write-protect copy */
u32 irq_count; /* total count of IRQ/SOFTIRQ */
struct timespec64 blkio_delay_max_ts;
struct timespec64 swapin_delay_max_ts;
struct timespec64 freepages_delay_max_ts;
struct timespec64 thrashing_delay_max_ts;
struct timespec64 compact_delay_max_ts;
struct timespec64 wpcopy_delay_max_ts;
struct timespec64 irq_delay_max_ts;
};
#endif
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/jump_label.h>
#ifdef CONFIG_TASK_DELAY_ACCT
DECLARE_STATIC_KEY_FALSE(delayacct_key);
extern int delayacct_on; /* Delay accounting turned on/off */
extern struct kmem_cache *delayacct_cache;
extern void delayacct_init(void);
extern void __delayacct_tsk_init(struct task_struct *);
extern void __delayacct_tsk_exit(struct task_struct *);
extern void __delayacct_blkio_start(void);
extern void __delayacct_blkio_end(struct task_struct *);
extern int delayacct_add_tsk(struct taskstats *, struct task_struct *);
extern __u64 __delayacct_blkio_ticks(struct task_struct *);
extern void __delayacct_freepages_start(void);
extern void __delayacct_freepages_end(void);
extern void __delayacct_thrashing_start(bool *in_thrashing);
extern void __delayacct_thrashing_end(bool *in_thrashing);
Annotation
- Immediate include surface: `uapi/linux/taskstats.h`, `linux/sched.h`, `linux/slab.h`, `linux/jump_label.h`.
- Detected declarations: `struct task_delay_info`, `function delayacct_tsk_init`, `function delayacct_tsk_free`, `function delayacct_blkio_start`, `function delayacct_blkio_end`, `function delayacct_blkio_ticks`, `function delayacct_freepages_start`, `function delayacct_freepages_end`, `function delayacct_thrashing_start`, `function delayacct_thrashing_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.