diff options
author | 2022-06-25 17:28:11 +0800 | |
---|---|---|
committer | 2022-07-03 18:08:51 -0700 | |
commit | 4d928e20fd5b9fd97e1e631500386ef12a2858d7 (patch) | |
tree | 9d01290c76ccf5a0a2742225fcbe370f597f5317 /mm/memcontrol.c | |
parent | mm/khugepaged: remove unneeded shmem_huge_enabled() check (diff) | |
download | linux-rng-4d928e20fd5b9fd97e1e631500386ef12a2858d7.tar.xz linux-rng-4d928e20fd5b9fd97e1e631500386ef12a2858d7.zip |
mm/khugepaged: stop swapping in page when VM_FAULT_RETRY occurs
When do_swap_page returns VM_FAULT_RETRY, we do not retry here and thus
swap entry will remain in pagetable. This will result in later failure.
So stop swapping in pages in this case to save cpu cycles. As A further
optimization, mmap_lock is released when __collapse_huge_page_swapin()
fails to avoid relocking mmap_lock. And "swapped_in++" is moved after
error handling to make it more accurate.
Link: https://lkml.kernel.org/r/20220625092816.4856-3-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: NeilBrown <neilb@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
0 files changed, 0 insertions, 0 deletions