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


Groups > linux.kernel > #1614084

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

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP size on x86_64
Date 2017-03-31 17:00 +0200
Message-ID <tr6bT-5VY-3@gated-at.bofh.it> (permalink)
References <tpS1j-2ZP-5@gated-at.bofh.it> <tpS1j-2ZP-3@gated-at.bofh.it> <tqp6W-1bC-25@gated-at.bofh.it> <tqwrM-6Aq-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 30, 2017 at 08:45:56AM +0800, Huang, Ying wrote:
> Johannes Weiner <hannes@cmpxchg.org> writes:
> 
> > On Tue, Mar 28, 2017 at 01:32:01PM +0800, Huang, Ying wrote:
> >> @@ -499,6 +499,19 @@ config FRONTSWAP
> >>  
> >>  	  If unsure, say Y to enable frontswap.
> >>  
> >> +config ARCH_USES_THP_SWAP_CLUSTER
> >> +	bool
> >> +	default n
> >
> > This is fine.
> >
> >> +config THP_SWAP_CLUSTER
> >> +	bool
> >> +	depends on SWAP && TRANSPARENT_HUGEPAGE && ARCH_USES_THP_SWAP_CLUSTER
> >> +	default y
> >> +	help
> >> +	  Use one swap cluster to hold the contents of the THP
> >> +	  (Transparent Huge Page) swapped out.  The size of the swap
> >> +	  cluster will be same as that of THP.
> >
> > But this is a super weird thing to ask the user. How would they know
> > what to say, if we don't know? I don't think this should be a config
> > knob at all. Merge the two config items into a simple
> 
> The user will not see this, because there is no string after "bool" to
> let user to select it.  The help here is for document only, so that
> architecture developers could know what this is for.

Oh, I missed that. My bad!

> > config THP_SWAP_CLUSTER
> >      bool
> >      default n
> >
> > and let the archs with reasonable THP sizes select it.
> 
> This will have same effect as the original solution except the document
> is removed.

Then I still don't understand why we need two config symbols. Can't
archs select the documented THP_SWAP_CLUSTER directly?

The #ifdef in swapfile.c could check THP && THP_SWAP_CLUSTER.

Am I missing something?

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


Thread

[PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 "Huang, Ying" <ying.huang@intel.com> - 2017-03-28 07:40 +0200
  Re: [PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP  size on x86_64 "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-03-29 01:40 +0200
    Re: [PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 "Huang\, Ying" <ying.huang@intel.com> - 2017-03-29 03:20 +0200
  Re: [PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP  size on x86_64 Johannes Weiner <hannes@cmpxchg.org> - 2017-03-29 19:00 +0200
    Re: [PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 "Huang\, Ying" <ying.huang@intel.com> - 2017-03-30 02:50 +0200
      Re: [PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP  size on x86_64 Johannes Weiner <hannes@cmpxchg.org> - 2017-03-31 17:00 +0200
        Re: [PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 "Huang\, Ying" <ying.huang@intel.com> - 2017-04-01 05:30 +0200

csiph-web