Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1595170

Re: [PATCH -mm -v6 1/9] mm, swap: Make swap cluster size same of THP size on x86_64

From Matthew Wilcox <willy@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH -mm -v6 1/9] mm, swap: Make swap cluster size same of THP size on x86_64
Date 2017-03-08 14:30 +0100
Message-ID <tiJPc-77d-25@gated-at.bofh.it> (permalink)
References <tiEmt-3cd-5@gated-at.bofh.it> <tiHNo-5Nf-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Mar 08, 2017 at 03:26:05PM +0800, Huang, Ying wrote:
> In this patch, the size of the swap cluster is changed to that of the
> THP (Transparent Huge Page) on x86_64 architecture (512).  This is for
> the THP swap support on x86_64.  Where one swap cluster will be used to
> hold the contents of each THP swapped out.  And some information of the
> swapped out THP (such as compound map count) will be recorded in the
> swap_cluster_info data structure.
> 
> For other architectures which want THP swap support,
> ARCH_USES_THP_SWAP_CLUSTER need to be selected in the Kconfig file for
> the architecture.
> 
> In effect, this will enlarge swap cluster size by 2 times on x86_64.
> Which may make it harder to find a free cluster when the swap space
> becomes fragmented.  So that, this may reduce the continuous swap space
> allocation and sequential write in theory.  The performance test in 0day
> shows no regressions caused by this.

Well ... if there are no regressions found, why not change it
unconditionally?  The value '256' seems relatively arbitrary (I bet it
was tuned by some doofus with a 486, 8MB RAM and ST506 hard drive ...
it certainly hasn't changed since git started in 2005)

Might be worth checking with the PowerPC people to see if their larger
pages causes this smaller patch to perform badly:

diff --git a/mm/swapfile.c b/mm/swapfile.c
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -199,7 +199,7 @@ static void discard_swap_cluster(struct swap_info_struct *si,
 	}
 }
 
-#define SWAPFILE_CLUSTER	256
+#define SWAPFILE_CLUSTER	HPAGE_PMD_NR
 #define LATENCY_LIMIT		256
 
 static inline void cluster_set_flag(struct swap_cluster_info *info,

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH -v6 0/9] THP swap: Delay splitting THP during swapping out "Huang, Ying" <ying.huang@intel.com> - 2017-03-08 08:40 +0100
  [PATCH -mm -v6 5/9] mm, THP, swap: Support to clear SWAP_HAS_CACHE for huge page "Huang, Ying" <ying.huang@intel.com> - 2017-03-08 08:40 +0100
  [PATCH -mm -v6 2/9] mm, memcg: Support to charge/uncharge multiple swap entries "Huang, Ying" <ying.huang@intel.com> - 2017-03-08 08:40 +0100
    Re: [PATCH -mm -v6 2/9] mm, memcg: Support to charge/uncharge  multiple swap entries Balbir Singh <bsingharora@gmail.com> - 2017-03-08 12:50 +0100
      Re: [PATCH -mm -v6 2/9] mm, memcg: Support to charge/uncharge multiple swap entries "Huang\, Ying" <ying.huang@intel.com> - 2017-03-09 02:40 +0100
        Re: [PATCH -mm -v6 2/9] mm, memcg: Support to charge/uncharge  multiple swap entries Balbir Singh <bsingharora@gmail.com> - 2017-03-09 22:30 +0100
  [PATCH -mm -v6 7/9] mm, THP: Add can_split_huge_page() "Huang, Ying" <ying.huang@intel.com> - 2017-03-08 08:40 +0100
  [PATCH -mm -v6 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 "Huang, Ying" <ying.huang@intel.com> - 2017-03-08 12:20 +0100
    Re: [PATCH -mm -v6 1/9] mm, swap: Make swap cluster size same of THP  size on x86_64 Matthew Wilcox <willy@infradead.org> - 2017-03-08 14:30 +0100
      Re: [PATCH -mm -v6 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 "Huang\, Ying" <ying.huang@intel.com> - 2017-03-09 02:50 +0100

csiph-web