There's a mistake in pick_peer_page. This function is called before
issuing read from pagefault and file read paths, in order to retrieve
the page from peer's mapping and thus save us io and page cache. In this
function we first lookup the page in the peer's mapping. If it fails, we
start readahead for the peer's mapping. Then we should retry lookup from
peer's mapping to get page allocated by the readahead, but instead we do
lookup from the original mapping, which obviously fails as we only call
pick_peer_page if there's no page in original mapping's cache. So we
fall back on reading a page for the original mapping instead of using
pages from pfcache.

Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com>
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index 7ba5f6f8eaac..c3a36558ac40 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4697,7 +4697,7 @@ struct page *pick_peer_page(struct address_space 
*mapping, pgoff_t index,
        page = find_get_page(peer, index);
        if (!page) {
                page_cache_sync_readahead(peer, ra, file, index, ra_size);
-               page = find_get_page(mapping, index);
+               page = find_get_page(peer, index);
                if (!page)
                        goto out;
        }
-- 
2.1.4

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to