History

delayacct: track delays from thrashing cache pages

Delay accounting already measures the time a task spends in direct reclaim and waiting for swapin, but in low memory situations tasks spend can spend a significant amount of their time waiting on thrashing page cache. This isn't tracked right now. To know the full impact of memory contention on an individual task, measure the delay when waiting for a recently evicted active cache page to read back into memory. Also update tools/accounting/getdelays.c: [hannes@computer accounting]$ sudo ./getdelays -d -p 1 print delayacct stats ON PID 1 CPU count real total virtual total delay total delay average 50318 745000000 847346785 400533713 0.008ms IO count delay total delay average 435 122601218 0ms SWAP count delay total delay average 0 0 0ms RECLAIM count delay total delay average 0 0 0ms THRASHING count delay total delay average 19 12621439 0ms

Johannes Weiner committed 8 years ago

Commit b1d29ba1 parent 1899ad15 files · +61 −2Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/taskstats.h+5−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 */
3535
3636
37−#define TASKSTATS_VERSION 8
37+#define TASKSTATS_VERSION 9
3838 #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
3939 * in linux/sched.h */
4040
@@ -164,6 +164,10 @@ struct taskstats { · 123 unmodified lines
164164 /* Delay waiting for memory reclaim */
165165 __u64 freepages_count;
166166 __u64 freepages_delay_total;
167+
168+ /* Delay waiting for thrashing page */
169+ __u64 thrashing_count;
170+ __u64 thrashing_delay_total;
167171 };
168172
169173