[Bug 223831] [patch] swap_pager.c to release multiple swap blocks at a time
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Dec 3 04:59:39 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223831
--- Comment #3 from ota at j.email.ne.jp ---
(In reply to Konstantin Belousov from comment #2)
Indeed, 1st patch chunk failed and I overlooked it.
Also, I missed offset initialization.
To answer your question, I started with 2 reasons.
#1 - I started looking at optimizing page-in cases and process exit cases where
they had released 1 block at a time although swp_pager_freeswapspace() takes
npages to free. This was the 3rd one.
#2 - swp_pager_force_pagein() comment says "it doesn't work" and I wondered
why. The reason I found is we need to call vm_page_grab for the number of
pages we want to page in.
Summing up, after I figured vm_page part, the code started working okay and
based on my observation of "top", multi-block page-in was considerably faster -
reading 1 block 32 times compare to 32 blocks a time. It looksvm_object_t is
locked during swapoff operation (while paging-in), too.
During research, I found swap_pager_getpages() calls swap_pager_haspage()
anyway and swap_pager_haspage() checks how many continuous blocks are behind.
So, I started researching from swap_pager_haspage() side instead of swblk side.
I had few questions like when to lock and how and when to increment
vm_object_pip. I posted here for some feed backs.
While checking patch failure against HEAD, I realized swp_pager_force_pagein()
in HEAD had a change for (m->valid == VM_PAGE_BITS_ALL) case. This change
cleared some of my questions. I will update my changes and post a new one for
11-STABLE and HEAD.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list