[Devel] [PATCH RHEL7 COMMIT] pfcache: pick page from peer mapping after readahead

Konstantin Khorenko khorenko at virtuozzo.com
Thu May 26 07:38:35 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.18.2.vz7.14.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.18.2.vz7.14.8
------>
commit 703ec96aa535fb1c9f15b5c9a2df3765e16e8711
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Thu May 26 18:38:28 2016 +0400

    pfcache: pick page from peer mapping after readahead
    
    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.
    
    Found in the scope of https://jira.sw.ru/browse/PSBM-47541
    
    Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index 7ba5f6f..c3a3655 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;
 	}


More information about the Devel mailing list