]> git.baikalelectronics.ru Git - kernel.git/commit
mm/swap_state: skip meaningless swap cache readahead when ra_info.win == 0
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 15 Dec 2020 03:06:01 +0000 (19:06 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Dec 2020 20:13:39 +0000 (12:13 -0800)
commit37ef198f7fdbc3603ed11d6172666e3ddf4b757b
treefcadc256719e63d238ec5f15713f1a373db3438c
parentc3af2ce566219ed62c752de93fad4592f94f942c
mm/swap_state: skip meaningless swap cache readahead when ra_info.win == 0

swap_ra_info() may leave ra_info untouched in non_swap_entry() case as
page table lock is not held.  In this case, we have ra_info.nr_pte == 0
and it is meaningless to continue with swap cache readahead.  Skip such
ops by init ra_info.win = 1.

[akpm@linux-foundation.org: clean up struct init]

Link: https://lkml.kernel.org/r/20201009133059.58407-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/swap_state.c