linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Bob Liu <bob.liu@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Bob Liu <lliubbo@gmail.com>, Minchan Kim <minchan@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: zswap: add runtime enable/disable
Date: Tue, 23 Jul 2013 13:08:06 -0700	[thread overview]
Message-ID: <51EEE2A6.60109@sr71.net> (raw)
In-Reply-To: <20130723173223.GB5820@medulla.variantweb.net>

On 07/23/2013 10:32 AM, Seth Jennings wrote:
> On Tue, Jul 23, 2013 at 05:16:07PM +0800, Bob Liu wrote:
>> On 07/23/2013 03:34 AM, Seth Jennings wrote:
>>> -To enabled zswap, the "enabled" attribute must be set to 1 at boot time.  e.g.
>>> -zswap.enabled=1
>>> +Zswap is disabled by default but can be enabled at boot time by setting
>>> +the "enabled" attribute to 1 at boot time. e.g. zswap.enabled=1.  Zswap
>>> +can also be enabled and disabled at runtime using the sysfs interface.
>>> +An exmaple command to enable zswap at runtime, assuming sysfs is mounted
>>> +at /sys, is:
>>> +
>>> +echo 1 > /sys/modules/zswap/parameters/enabled
>>> +
>>> +When zswap is disabled at runtime, it will stop storing pages that are
>>> +being swapped out.  However, it will _not_ immediately write out or
>>> +fault back into memory all of the pages stored in the compressed pool.
>>
>> I don't know what's you use case of adding this feature.
> 
> Dave expressed interest in having it, useful for testing, and I can see
> people that just wanting to try it out enabling it manually at runtime.

The distributions are going to have to make a decision about whether or
not they turn this on.  If it is 100% selected at compile-time and has
all of the potential performance implications (zswap *can* hurt with
certain workloads), I would not expect a distribution to enable it at all.

The only sane thing to do here is to compile it in, runtime-default it
to off, and let folks enable it who want to use it on their workload.

>> In my opinion I'd perfer to flush all the pages stored in zswap when
>> disabled it, so that I can run testing without rebooting the machine.
> 
> Why would you have to reboot your machine?  If you want to force all
> the pages out of the compressed pool, a swapoff should do it as now
> noted in the Documentation file (below).

It is kinda crummy that it won't be flushed, but considering the size
and simplicity of the patch as it stands, I'm not going to whinge about
it too much.

Seth, it'd be nice to have you at least see if it is worth flushing all
the pages when zswap is disabled, or whether it's too much code to go to
the trouble.

--
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-07-23 20:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 19:34 [PATCH] mm: zswap: add runtime enable/disable Seth Jennings
2013-07-22 23:25 ` Wanpeng Li
2013-07-22 23:25 ` Wanpeng Li
2013-07-23 17:22   ` Seth Jennings
2013-07-23  9:16 ` Bob Liu
2013-07-23 17:32   ` Seth Jennings
2013-07-23 20:08     ` Dave Hansen [this message]

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=51EEE2A6.60109@sr71.net \
    --to=dave@sr71.net \
    --cc=akpm@linux-foundation.org \
    --cc=bob.liu@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lliubbo@gmail.com \
    --cc=minchan@kernel.org \
    --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).