summaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2018-04-05 16:23:42 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-05 21:36:25 -0700
commite9e9b7ecee4a139a6fbe2e15ef224ca6b6c47d57 (patch)
tree179430c7efc50a0da618934d117b152258e82353 /mm/memory.c
parenteaf649ebc3acfbb235ce31cebd06e4876d05758e (diff)
downloadlinux-stable-e9e9b7ecee4a139a6fbe2e15ef224ca6b6c47d57.tar.gz
linux-stable-e9e9b7ecee4a139a6fbe2e15ef224ca6b6c47d57.tar.bz2
linux-stable-e9e9b7ecee4a139a6fbe2e15ef224ca6b6c47d57.zip
mm: swap: unify cluster-based and vma-based swap readahead
This patch makes do_swap_page() not need to be aware of two different swap readahead algorithms. Just unify cluster-based and vma-based readahead function call. Link: http://lkml.kernel.org/r/1509520520-32367-3-git-send-email-minchan@kernel.org Link: http://lkml.kernel.org/r/20180220085249.151400-3-minchan@kernel.org Signed-off-by: Minchan Kim <minchan@kernel.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Hugh Dickins <hughd@google.com> Cc: Huang Ying <ying.huang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mm/memory.c b/mm/memory.c
index bc1ccff79538..01f5464e0fd2 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2927,7 +2927,8 @@ int do_swap_page(struct vm_fault *vmf)
if (si->flags & SWP_SYNCHRONOUS_IO &&
__swap_count(si, entry) == 1) {
/* skip swapcache */
- page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, vmf->address);
+ page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma,
+ vmf->address);
if (page) {
__SetPageLocked(page);
__SetPageSwapBacked(page);
@@ -2936,12 +2937,8 @@ int do_swap_page(struct vm_fault *vmf)
swap_readpage(page, true);
}
} else {
- if (swap_use_vma_readahead())
- page = do_swap_page_readahead(entry,
- GFP_HIGHUSER_MOVABLE, vmf);
- else
- page = swapin_readahead(entry,
- GFP_HIGHUSER_MOVABLE, vma, vmf->address);
+ page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE,
+ vmf);
swapcache = page;
}