• Mark Salyzyn's avatar
    arm64: readahead: fault retry breaks mmap file read random detection · 339cb27f
    Mark Salyzyn authored
    commit 569ba74a upstream.
    
    This is the arm64 portion of commit 45cac65b ("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 <shli@kernel.org>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Wu Fengguang <fengguang.wu@intel.com>
    Signed-off-by: default avatarMark Salyzyn <salyzyn@android.com>
    Signed-off-by: default avatarRiley Andrews <riandrews@android.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    339cb27f
fault.c 15.3 KB