/* 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 */
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 */
}; #endif
staticinlinevoid delayacct_tsk_init(struct task_struct *tsk)
{ /* reinitialize in case parent's non-null pointer was dup'ed*/
tsk->delays = NULL; if (delayacct_on)
__delayacct_tsk_init(tsk);
}
/* Free tsk->delays. Called from bad fork and __put_task_struct * where there's no risk of tsk->delays being accessed elsewhere
*/ staticinlinevoid delayacct_tsk_free(struct task_struct *tsk)
{ if (tsk->delays)
kmem_cache_free(delayacct_cache, tsk->delays);
tsk->delays = NULL;
}
staticinlinevoid delayacct_blkio_start(void)
{ if (!static_branch_unlikely(&delayacct_key)) return;
if (current->delays)
__delayacct_blkio_start();
}
staticinlinevoid delayacct_blkio_end(struct task_struct *p)
{ if (!static_branch_unlikely(&delayacct_key)) return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.