Skip to content

Commit

Permalink
Record mapped netmap memory as RssShmem rather than RssFile
Browse files Browse the repository at this point in the history
 VmRSS     size of memory portions. It contains the three
           following parts (VmRSS = RssAnon + RssFile + RssShmem)
 RssAnon   size of resident anonymous memory
 RssFile   size of resident file mappings
 RssShmem  size of resident shmem memory (includes SysV shm,
           mapping of tmpfs and shared anonymous mappings)

The kernel differentiates between RssFile and RssShmem by
checking the PG_swapbacked flag on the page. By setting this
flag the netmp memory will be recorded as RssShmem.
  • Loading branch information
carlgsmith committed Nov 3, 2019
1 parent ebf2090 commit 7466016
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions LINUX/netmap_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ linux_netmap_fault(struct vm_fault *vmf)
if (!pfn_valid(pfn))
return VM_FAULT_SIGBUS;
page = pfn_to_page(pfn);
SetPageSwapBacked(page);
get_page(page);
vmf->page = page;
return 0;
Expand Down

0 comments on commit 7466016

Please sign in to comment.