aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2018-08-17 18:49:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-17 19:20:32 -0400
commit14fef28414c365a979311821bbf1018a8290cc0f (patch)
treeacf988e3dce9ab19c6285a56d8266cf7698b3209
parent2a3cb8baef71e4dad4a6ec17f5f0db9e05f46a01 (diff)
mm, swap: make CONFIG_THP_SWAP depend on CONFIG_SWAP
CONFIG_THP_SWAP should depend on CONFIG_SWAP, because it's unreasonable to optimize swapping for THP (Transparent Huge Page) without basic swapping support. In original code, when CONFIG_SWAP=n and CONFIG_THP_SWAP=y, split_swap_cluster() will not be built because it is in swapfile.c, but it will be called in huge_memory.c. This doesn't trigger a build error in practice because the call site is enclosed by PageSwapCache(), which is defined to be constant 0 when CONFIG_SWAP=n. But this is fragile and should be fixed. The comments are fixed too to reflect the latest progress. Link: http://lkml.kernel.org/r/20180713021228.439-1-ying.huang@intel.com Fixes: 38d8b4e6bdc8 ("mm, THP, swap: delay splitting THP during swap out") Signed-off-by: "Huang, Ying" <ying.huang@intel.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Shaohua Li <shli@kernel.org> Cc: Hugh Dickins <hughd@google.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Rik van Riel <riel@redhat.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Zi Yan <zi.yan@cs.rutgers.edu> Cc: Daniel Jordan <daniel.m.jordan@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/Kconfig5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/Kconfig b/mm/Kconfig
index adfeae4decb4..a550635ea5c3 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -419,10 +419,11 @@ config ARCH_WANTS_THP_SWAP
419 419
420config THP_SWAP 420config THP_SWAP
421 def_bool y 421 def_bool y
422 depends on TRANSPARENT_HUGEPAGE && ARCH_WANTS_THP_SWAP 422 depends on TRANSPARENT_HUGEPAGE && ARCH_WANTS_THP_SWAP && SWAP
423 help 423 help
424 Swap transparent huge pages in one piece, without splitting. 424 Swap transparent huge pages in one piece, without splitting.
425 XXX: For now this only does clustered swap space allocation. 425 XXX: For now, swap cluster backing transparent huge page
426 will be split after swapout.
426 427
427 For selection by architectures with reasonable THP sizes. 428 For selection by architectures with reasonable THP sizes.
428 429