Delay accounting does not track the delay of memory compact. When there is not enough free memory, tasks can spend a amount of their time waiting for compact. To get the impact of tasks in direct memory compact, measure the delay when allocating memory through memory compact. Also update tools/accounting/getdelays.c: / # ./getdelays_next -di -p 304 print delayacct stats ON printing IO accounting PID 304 CPU count real total virtual total delay total delay average 277 780000000 849039485 18877296 0.068ms IO count delay total delay average 0 0 0ms SWAP count delay total delay average 0 0 0ms RECLAIM count delay total delay average 5 11088812685 2217ms THRASHING count delay total delay average 0 0 0ms COMPACT count delay total delay average 3 72758 0ms watch: read=0, write=0, cancelled_write=0
Showing the changes to include/uapi/linux (1 of 5 files). Show all
Unified · Split
| @@ -34,7 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | 36 | |
| 37 | −#define TASKSTATS_VERSION 10 | |
| 37 | +#define TASKSTATS_VERSION 11 | |
| 38 | 38 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN |
| 39 | 39 | * in linux/sched.h */ |
| 40 | 40 | |
| @@ -172,6 +172,10 @@ struct taskstats { · 131 unmodified lines | ||
| 172 | 172 | |
| 173 | 173 | /* v10: 64-bit btime to avoid overflow */ |
| 174 | 174 | __u64 ac_btime64; /* 64-bit begin time */ |
| 175 | + | |
| 176 | + /* Delay waiting for memory compact */ | |
| 177 | + __u64 compact_count; | |
| 178 | + __u64 compact_delay_total; | |
| 175 | 179 | }; |
| 176 | 180 | |
| 177 | 181 | |