Skip to content

swap: THP optimizing refactoring

Huang Ying linux-mm lkml 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest8 patches 0 repliesNew
  2. v38 patches 5 repliesSuperseded
  3. v2 posting 2/27 patches 11 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/20 of 7 patches0 repliesSuperseded
v16 patches8 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8swap: Add comments to lock_cluster_or_swap_info()mm/swapfile.c+7 -20 replies
2/8mm/swapfile.c: Replace some #ifdef with IS_ENABLED()mm/swapfile.c+20 -400 replies
3/8swap: Use swap_count() in swap_page_trans_huge_swapped()mm/swapfile.c+2 -20 replies
4/8swap: Unify normal/huge code path in swap_page_trans_huge_swapped()mm/swapfile.c+3 -40 replies
5/8swap: Unify normal/huge code path in put_swap_page()mm/swapfile.c+37 -460 replies
6/8swap, get_swap_pages: Use entry_size instead of cluster in parameterinclude/linux/swap.h mm/swap_slots.c mm/swapfile.c+13 -130 replies
7/8swap: Add __swap_entry_free_locked()mm/swapfile.c+14 -60 replies
8/8swap, put_swap_page: Share more between huge/normal code pathmm/swapfile.c+10 -100 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchDave HansenDaniel Jordan
1/8Suggested-and-acked-by R-b
2/8Suggested-and-acked-by R-b
3/8A-b Suggested-and-reviewed-by
4/8Suggested-and-acked-by R-b
5/8Suggested-and-acked-by R-b
6/8A-b
7/8A-b R-b
8/8A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/8] swap: THP optimizing refactoring

This patchset is based on 2018-07-13 head of mmotm tree.

Now the THP (Transparent Huge Page) swap optimizing is implemented in the way like below,

#ifdef CONFIG_THP_SWAP
huge_function(...)
{
}
#else
normal_function(...)
{
}
#endif

general_function(...)

{
	if (huge)
		return thp_function(...);
	else
		return normal_function(...);
}

As pointed out by Dave Hansen, this will,

1. Created a new, wholly untested code path for huge page
2. Created two places to patch bugs
3. Are not reusing code when possible

This patchset is to address these problems via merging huge/normal code path/functions if possible.

One concern is that this may cause code size to dilate when !CONFIG_TRANSPARENT_HUGEPAGE. The data shows that most refactoring will only cause quite slight code size increase.

Best Regards,
Huang, Ying