Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

per-task-delay-accounting: update taskstats for memory reclaim delay

Add members for memory reclaim delay to taskstats, and accumulate them in
__delayacct_add_tsk() .

Signed-off-by: Keika Kobayashi <kobayashi.kk@ncos.nec.co.jp>
Cc: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Keika Kobayashi and committed by
Linus Torvalds
016ae219 873b4771

+15 -1
+7
Documentation/accounting/taskstats-struct.txt
··· 26 26 27 27 5) Time accounting for SMT machines 28 28 29 + 6) Extended delay accounting fields for memory reclaim 30 + 29 31 Future extension should add fields to the end of the taskstats struct, and 30 32 should not change the relative position of each field within the struct. 31 33 ··· 172 170 __u64 ac_utimescaled; /* utime scaled on frequency etc */ 173 171 __u64 ac_stimescaled; /* stime scaled on frequency etc */ 174 172 __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ 173 + 174 + 6) Extended delay accounting fields for memory reclaim 175 + /* Delay waiting for memory reclaim */ 176 + __u64 freepages_count; 177 + __u64 freepages_delay_total; 175 178 }
+5 -1
include/linux/taskstats.h
··· 31 31 */ 32 32 33 33 34 - #define TASKSTATS_VERSION 6 34 + #define TASKSTATS_VERSION 7 35 35 #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN 36 36 * in linux/sched.h */ 37 37 ··· 157 157 __u64 ac_utimescaled; /* utime scaled on frequency etc */ 158 158 __u64 ac_stimescaled; /* stime scaled on frequency etc */ 159 159 __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ 160 + 161 + /* Delay waiting for memory reclaim */ 162 + __u64 freepages_count; 163 + __u64 freepages_delay_total; 160 164 }; 161 165 162 166
+3
kernel/delayacct.c
··· 145 145 d->blkio_delay_total = (tmp < d->blkio_delay_total) ? 0 : tmp; 146 146 tmp = d->swapin_delay_total + tsk->delays->swapin_delay; 147 147 d->swapin_delay_total = (tmp < d->swapin_delay_total) ? 0 : tmp; 148 + tmp = d->freepages_delay_total + tsk->delays->freepages_delay; 149 + d->freepages_delay_total = (tmp < d->freepages_delay_total) ? 0 : tmp; 148 150 d->blkio_count += tsk->delays->blkio_count; 149 151 d->swapin_count += tsk->delays->swapin_count; 152 + d->freepages_count += tsk->delays->freepages_count; 150 153 spin_unlock_irqrestore(&tsk->delays->lock, flags); 151 154 152 155 done: