From: Bob Liu <lliubbo@gmail.com>
To: akpm@linux-foundation.org
Cc: sjenning@linux.vnet.ibm.com, linux-mm@kvack.org,
konrad.wilk@oracle.com, Bob Liu <bob.liu@oracle.com>
Subject: [PATCH 2/2] zswap: update/document boot parameters
Date: Thu, 20 Jun 2013 16:29:09 +0800 [thread overview]
Message-ID: <1371716949-9918-1-git-send-email-bob.liu@oracle.com> (raw)
The current parameters of zswap are not straightforward.
Changed them to start with zswap* and documented them.
Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
Documentation/kernel-parameters.txt | 8 ++++++++
mm/zswap.c | 27 +++++++++++++++++++++++----
2 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 2fe6e76..07642fd 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -3367,6 +3367,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Format:
<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
+ zswap Enable compressed cache for swap pages support which
+ is disabled by default.
+ zswapcompressor=
+ Select which compressor to be used by zswap.
+ The default compressor is lzo.
+ zswap_maxpool_percent=
+ Select how may percent of total memory can be used to
+ store comprssed pages. The default percent is 20%.
______________________________________________________________________
TODO:
diff --git a/mm/zswap.c b/mm/zswap.c
index 7fe2b1b..8ec1360 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -77,17 +77,13 @@ static u64 zswap_duplicate_entry;
**********************************/
/* Enable/disable zswap (disabled by default, fixed at boot for now) */
static bool zswap_enabled __read_mostly;
-module_param_named(enabled, zswap_enabled, bool, 0);
/* Compressor to be used by zswap (fixed at boot for now) */
#define ZSWAP_COMPRESSOR_DEFAULT "lzo"
static char *zswap_compressor = ZSWAP_COMPRESSOR_DEFAULT;
-module_param_named(compressor, zswap_compressor, charp, 0);
/* The maximum percentage of memory that the compressed pool can occupy */
static unsigned int zswap_max_pool_percent = 20;
-module_param_named(max_pool_percent,
- zswap_max_pool_percent, uint, 0644);
/*********************************
* compression functions
@@ -914,6 +910,29 @@ static int __init zswap_debugfs_init(void)
static void __exit zswap_debugfs_exit(void) { }
#endif
+static int __init enable_zswap(char *s)
+{
+ zswap_enabled = true;
+ return 1;
+}
+__setup("zswap", enable_zswap);
+
+static int __init setup_zswap_compressor(char *s)
+{
+ strlcpy(zswap_compressor, s, sizeof(zswap_compressor));
+ zswap_enabled = true;
+ return 1;
+}
+__setup("zswapcompressor=", setup_zswap_compressor);
+
+static int __init setup_zswap_max_pool_percent(char *s)
+{
+ get_option(&s, &zswap_max_pool_percent);
+ zswap_enabled = true;
+ return 1;
+}
+__setup("zswap_maxpool_percent=", setup_zswap_max_pool_percent);
+
/*********************************
* module init and exit
**********************************/
--
1.7.10.4
--
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>
next reply other threads:[~2013-06-20 8:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 8:29 Bob Liu [this message]
2013-06-20 14:48 ` [PATCH 2/2] zswap: update/document boot parameters Seth Jennings
2013-06-20 23:20 ` Bob Liu
2013-06-20 23:51 ` Wanpeng Li
2013-06-21 14:47 ` Seth Jennings
2013-06-20 23:51 ` Wanpeng Li
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=1371716949-9918-1-git-send-email-bob.liu@oracle.com \
--to=lliubbo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bob.liu@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-mm@kvack.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).