Skip to content

Commit 569ba74

Browse files
salyzynwildea01
authored andcommitted
arm64: readahead: fault retry breaks mmap file read random detection
This is the arm64 portion of commit 45cac65 ("readahead: fault retry breaks mmap file read random detection"), which was absent from the initial port and has since gone unnoticed. The original commit says: > .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. With this change, Mark reports that: > 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. Cc: Shaohua Li <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Wu Fengguang <[email protected]> Cc: <[email protected]> Signed-off-by: Mark Salyzyn <[email protected]> Signed-off-by: Riley Andrews <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 95485fd commit 569ba74

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm64/mm/fault.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
287287
* starvation.
288288
*/
289289
mm_flags &= ~FAULT_FLAG_ALLOW_RETRY;
290+
mm_flags |= FAULT_FLAG_TRIED;
290291
goto retry;
291292
}
292293
}

0 commit comments

Comments
 (0)