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.
--- arch/arm64/mm/fault.c | 1 + 1 file changed, 1 insertion(+)
arch/arm64/mm/fault.c +1 -0
@@ -287,6 +287,7 @@ retry:* starvation. */ mm_flags &= ~FAULT_FLAG_ALLOW_RETRY ; + mm_flags |=FAULT_FLAG_TRIED ; goto retry; } }
Signature · 1 line
2.6.0.rc0.131.gf624c3d
Quoted 11 lines · Mark Salyzyn
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_missis increased. In the second try, since the page is in page cache now,ra->mmap_missis 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_missdecreasing. Thefilemap_faultstate machine is ok with it.
Quoted 8 lines
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.
Thanks for this. This must've gone in whilst we were developing the initial version of the arm64 port and has since gone unnoticed.
I'll queue it on the arm64 fixes branch and send a pull request after some testing.
Will
Quoted 7 lines · Will Deacon
Quoted 6 lines · Mark Salyzyn
Description from commit
45cac65b0fcd
("readahead: fault retry breaks mmap file read random detection")
. . .
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.
Quoted 7 lines
Thanks for this. This must've gone in whilst we were developing the initial version of the arm64 port and has since gone unnoticed.
I'll queue it on the arm64 fixes branch and send a pull request after some testing.
Will
As noted, this fix may need to be propagated to all the arch-specific code, I was not in a position to check this out on arm (32 bit) and the benchmarking code I used did not immediately port to 32-bit.
Sincerely -- Mark Salyzyn
Quoted 11 lines · Mark Salyzyn
Quoted 10 lines · Will Deacon
Quoted 6 lines · Mark Salyzyn
Description from commit
45cac65b0fcd
("readahead: fault retry breaks mmap file read random detection")
. . .
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.Thanks for this. This must've gone in whilst we were developing the initial version of the arm64 port and has since gone unnoticed.
Quoted 6 lines
Quoted 3 lines
I'll queue it on the arm64 fixes branch and send a pull request after some testing.
As noted, this fix may need to be propagated to all the arch-specific code, I was not in a position to check this out on arm (32 bit) and the benchmarking code I used did not immediately port to 32-bit.
You lost me; which arch-specific code are you referring to? The original patch (in mainline) touches a whole bunch of architectures.
Will
Quoted 15 lines · Will Deacon
Quoted 14 lines · Mark Salyzyn
Quoted 13 lines · Will Deacon
Quoted 6 lines · Mark Salyzyn
Description from commit
45cac65b0fcd
("readahead: fault retry breaks mmap file read random detection")
. . .
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.Thanks for this. This must've gone in whilst we were developing the initial version of the arm64 port and has since gone unnoticed.
I'll queue it on the arm64 fixes branch and send a pull request after some testing.
Quoted 7 lines
Quoted 3 lines
As noted, this fix may need to be propagated to all the arch-specific code, I was not in a position to check this out on arm (32 bit) and the benchmarking code I used did not immediately port to 32-bit.
You lost me; which arch-specific code are you referring to? The original patch (in mainline) touches a whole bunch of architectures.
Will
I see I am mistaken, arm64 was the _only_ one I see that is missing ... <grin>
Sincerely -- Mark Salyzyn