linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nitin Gupta <ngupta@vflare.org>, Minchan Kim <minchan@kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Robert Jennings <rcj@linux.vnet.ibm.com>,
	Jenifer Hopper <jhopper@us.ibm.com>, Mel Gorman <mgorman@suse.de>,
	Johannes Weiner <jweiner@redhat.com>,
	Rik van Riel <riel@redhat.com>,
	Larry Woodman <lwoodman@redhat.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Dave Hansen <dave@sr71.net>, Joe Perches <joe@perches.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Cody P Schafer <cody@linux.vnet.ibm.com>,
	Hugh Dickens <hughd@google.com>,
	Paul Mackerras <paulus@samba.org>,
	Heesub Shin <heesub.shin@samsung.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	devel@driverdev.osuosl.org
Subject: Re: [PATCHv12 3/4] zswap: add to mm/
Date: Wed, 29 May 2013 14:16:30 -0700	[thread overview]
Message-ID: <20130529141630.8f2d1aa9b16d05e60e4a7ada@linux-foundation.org> (raw)
In-Reply-To: <20130529210820.GF428@cerebellum>

On Wed, 29 May 2013 16:08:20 -0500 Seth Jennings <sjenning@linux.vnet.ibm.com> wrote:

> On Wed, May 29, 2013 at 12:57:47PM -0700, Andrew Morton wrote:
> > On Wed, 29 May 2013 14:50:27 -0500 Seth Jennings <sjenning@linux.vnet.ibm.com> wrote:
> > 
> > > On Wed, May 29, 2013 at 11:29:29AM -0700, Andrew Morton wrote:
> > > > On Wed, 29 May 2013 09:57:20 -0500 Seth Jennings <sjenning@linux.vnet.ibm.com> wrote:
> > > > 
> > > > > > > +/*********************************
> > > > > > > +* helpers
> > > > > > > +**********************************/
> > > > > > > +static inline bool zswap_is_full(void)
> > > > > > > +{
> > > > > > > +	return (totalram_pages * zswap_max_pool_percent / 100 <
> > > > > > > +		zswap_pool_pages);
> > > > > > > +}
> > > > > > 
> > > > > > We have had issues in the past where percentage-based tunables were too
> > > > > > coarse on very large machines.  For example, a terabyte machine where 0
> > > > > > bytes is too small and 10GB is too large.
> > > > > 
> > > > > Yes, this is known limitation of the code right now and it is a high priority
> > > > > to come up with something better.  It isn't clear what dynamic sizing policy
> > > > > should be used so, until such time as that policy can be determined, this is a
> > > > > simple stop-gap that works well enough for simple setups.
> > > > 
> > > > It's a module parameter and hence is part of the userspace interface. 
> > > > It's undesirable that the interface be changed, and it would be rather
> > > > dumb to merge it as-is when we *know* that it will be changed.
> > > > 
> > > > I don't think we can remove the parameter altogether (or can we?), so I
> > > > suggest we finalise it ASAP.  Perhaps rename it to
> > > > zswap_max_pool_ratio, with a range 1..999999.  Better ideas needed :(
> > > 
> > > zswap_max_pool_ratio is fine with me.  I'm not entirely clear on the change
> > > though.  Would that just be a name change or a change in meaning?
> > 
> > It would be a change in behaviour.  The problem which I'm suggesting we
> > address is that a 1% increment is too coarse.
> 
> Sorry, but I'm not getting this.  This zswap_max_pool_ratio is a ratio of what
> to what?  Maybe if you wrote out the calculation of the max pool size using
> this ratio I'll get it.
> 

This:

	totalram_pages * zswap_max_pool_percent / 100

means that we have are able to control the pool size in 10GB increments
on a 1TB machine.  Past experience with other tunables tells us that
this can be a problem.  Hence my (lame) suggestion that we replace it
with

	totalram_pages * zswap_max_pool_ratio / 1000000


Another approach would be to stop using a ratio altogether, and make the
tunable specify an absolute number of bytes.  That's how we approached
this problem in the case of /proc/sys/vm/dirty_background_ratio.  See
https://lkml.org/lkml/2008/11/23/160.

(And it's "bytes", not "pages" because PAGE_SIZE can vary by a factor
of 16, which is a lot). 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-05-29 21:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 16:26 [PATCHv12 0/4] zswap: compressed swap caching Seth Jennings
2013-05-20 16:26 ` [PATCHv12 1/4] debugfs: add get/set for atomic types Seth Jennings
2013-05-29 17:42   ` Konrad Rzeszutek Wilk
2013-05-20 16:26 ` [PATCHv12 2/4] zbud: add to mm/ Seth Jennings
2013-05-21  3:37   ` Bob Liu
2013-05-28 21:59   ` Andrew Morton
2013-05-29 15:45     ` Seth Jennings
2013-05-29 18:34       ` Andrew Morton
2013-05-29 20:42         ` Seth Jennings
2013-05-29 20:48           ` Andrew Morton
2013-05-29 21:09             ` Dan Magenheimer
2013-05-29 21:29               ` Andrew Morton
2013-05-30 17:43                 ` Seth Jennings
2013-05-30 21:20                   ` Seth Jennings
2013-05-31  1:48                     ` Bob Liu
2013-06-03 13:48                   ` Konrad Rzeszutek Wilk
2013-05-29 20:45         ` Seth Jennings
2013-05-20 16:26 ` [PATCHv12 3/4] zswap: " Seth Jennings
2013-05-21  3:31   ` Bob Liu
2013-05-28 21:59   ` Andrew Morton
2013-05-29 14:57     ` Seth Jennings
2013-05-29 18:29       ` Andrew Morton
2013-05-29 19:50         ` Seth Jennings
2013-05-29 19:57           ` Andrew Morton
2013-05-29 21:08             ` Seth Jennings
2013-05-29 21:16               ` Andrew Morton [this message]
2013-05-20 16:26 ` [PATCHv12 4/4] zswap: add documentation Seth Jennings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130529141630.8f2d1aa9b16d05e60e4a7ada@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=cody@linux.vnet.ibm.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=dave@sr71.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heesub.shin@samsung.com \
    --cc=hughd@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jhopper@us.ibm.com \
    --cc=joe@perches.com \
    --cc=jweiner@redhat.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lwoodman@redhat.com \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=paulus@samba.org \
    --cc=rcj@linux.vnet.ibm.com \
    --cc=riel@redhat.com \
    --cc=sjenning@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).