Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6380

Is there are a way to get virtual address of page during swaps?

$
0
0

I'm working on kernel swap module to a build patch for a visualizer and currently I've learned that the anon_pages should be access through anon_vma to get the previous virtual address.I know that after shrink_page_list() is called the memory will be moved to swap cache and if there are lack of memory it will be moved to swap file.

But is this available to get a virtual address of the page though the anon page is already moved to inactive page list and it is about to move out to swap file from swap cache?

Moreover, it seems like swapd manages to swap in the page when a page fault occurs but the one pushes the page out to swap file happens in mm/vmscan.c or mm/shmem.c/shmem_writepage().

I've opened every single questions in stack overflow and there are no supervisor or a senior developer to help me out. What I did tried is getting the virtual memory address though built-in functions but not sure if it is correct.

For example, in mm/page_io.c

static int __writepage(struct page *page, struct writeback_control *wbc, ..)address = page_address(page); __swap_writepage(struct page *page, struct writeback_control *wbc,.. )address = page_to_virt(page);

I did read the code of the macro function, but it is still not clear for me.Thanks in advance.


Viewing all articles
Browse latest Browse all 6380

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>