Thread (4 messages) 4 messages, 3 authors, 2017-09-27

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

From: Michal Hocko <mhocko@kernel.org>
Date: 2017-09-27 07:16:14
Also in: linux-mm

[ups this got stuck in the outgoing queue]

On Tue 26-09-17 15:07:05, Michal Hocko wrote:
On Fri 22-09-17 11:46:30, Shaohua Li wrote:
quoted
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. If the page is added to swap
cache, marking the page lazyfree will confuse page fault if the page is
reclaimed and refault.
Could you be more specific how exactly what kind of the confusion is the
result? I suspect you are talking about VM_BUG_ON_PAGE in
__add_to_swap_cache right?
I completely mixed reclaim and the #PF path here
I am also not sure how that would actually happen to be honest. If we
raced with the reclaim then the page should have been isolated and so
PageLRU is no longer true. Or am I missing something?
And here I've completely missed that the swapcache page will go back to
the LRU. Stupid me. Your new changelog [1] explained it all. Thanks and
sorry for these stupid questions.

[1] http://lkml.kernel.org/r/6537ef3814398c0073630b03f176263bc81f0902.1506446061.git.shli@fb.com
-- 
Michal Hocko
SUSE Labs

--
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