Thread (4 messages) 4 messages, 4 authors, 2017-09-26

Re: [PATCH V3 1/2] mm: avoid marking swap cached page as lazyfree

From: Minchan Kim <minchan@kernel.org>
Date: 2017-09-26 23:20:08
Also in: linux-mm

On Tue, Sep 26, 2017 at 10:26:25AM -0700, Shaohua Li wrote:
From: Shaohua Li <redacted>

MADV_FREE clears pte dirty bit and then marks the page lazyfree (clear
SwapBacked). There is no lock to prevent the page is added to swap cache
between these two steps by page reclaim. Page reclaim could add the page
to swap cache and unmap the page. After page reclaim, the page is added
back to lru. At that time, we probably start draining per-cpu pagevec
and mark the page lazyfree. So the page could be in a state with
SwapBacked cleared and PG_swapcache set. Next time there is a refault in
the virtual address, do_swap_page can find the page from swap cache but
the page has PageSwapCache false because SwapBacked isn't set, so
do_swap_page will bail out and do nothing. The task will keep running
into fault handler.
With new description, I got why you want to seperate this. Yub, it should
be separated. Sorry for the noise. What I was missing is PageSwapCache's
change which checked PG_swapbacked as well as PG_swapcache. I didn't 
notice that the change.

Acked-by: Minchan Kim <minchan@kernel.org>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help