From 793f63fa548cf47ac25f267e8266e2f52edb16f6 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 8 Oct 2012 16:32:19 -0700 Subject: ARM64 readahead: fault retry breaks mmap file read random detection Description from commit 45cac65b0fcd ("readahead: fault retry breaks mmap file read random detection") .fault now can retry. The retry can break state machine of .fault. In filemap_fault, if page is miss, ra->mmap_miss is increased. In the second try, since the page is in page cache now, ra->mmap_miss is decreased. And these are done in one fault, so we can't detect random mmap file access. Add a new flag to indicate .fault is tried once. In the second try, skip ra->mmap_miss decreasing. The filemap_fault state machine is ok with it. I only tested x86, didn't test other archs, but looks the change for other archs is obvious, but who knows :) < snip > Yup, arm64 needs this too! Random read improves by 250%, sequential read improves by 40%, and random write by 400% to an eMMC device with dm crypto wrapped around it. Signed-off-by: Mark Salyzyn Signed-off-by: Riley Andrews Cc: Shaohua Li Cc: Shaohua Li Cc: Rik van Riel Cc: Wu Fengguang Bug: 23181629 Bug: 23385923 Change-Id: Ia4de1199164d6b5d4430f5518daf2aa5a71a405a --- arch/arm64/mm/fault.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index c23751b06120..cc083b6e4ce7 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -278,6 +278,7 @@ retry: * starvation. */ mm_flags &= ~FAULT_FLAG_ALLOW_RETRY; + mm_flags |= FAULT_FLAG_TRIED; goto retry; } } -- cgit v1.2.3