ihk_os_getrusage(): Add per-page-size memory usage accounting

This commit is contained in:
Masamichi Takagi
2017-08-04 12:00:31 +09:00
parent 184c2d311c
commit 74f15783d2
22 changed files with 572 additions and 130 deletions

View File

@ -34,6 +34,7 @@
#include <string.h>
#include <syscall.h>
#include <process.h>
#include <rusage.h>
//#define DEBUG_PRINT_DEVOBJ
@ -199,6 +200,7 @@ static void devobj_release(struct memobj *memobj)
}
if (obj->pfn_table) {
// Don't call memory_stat_rss_sub() because devobj related pages don't reside in main memory
ihk_mc_free_pages(obj->pfn_table, pfn_npages);
}
kfree(free_obj);
@ -268,6 +270,7 @@ static int devobj_get_page(struct memobj *memobj, off_t off, int p2align, uintpt
memobj_lock(&obj->memobj);
obj->pfn_table[ix] = pfn;
// Don't call memory_stat_rss_add() because devobj related pages don't reside in main memory
}
memobj_unlock(&obj->memobj);