From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Joonsoo Kim <js1304@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [RFC][PATCH v2 2/3] zram: use zs_get_huge_class_size_watermark()
Date: Sun, 21 Feb 2016 22:27:53 +0900 [thread overview]
Message-ID: <1456061274-20059-3-git-send-email-sergey.senozhatsky@gmail.com> (raw)
In-Reply-To: <1456061274-20059-1-git-send-email-sergey.senozhatsky@gmail.com>
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
zram should stop enforcing its own 'bad' object size watermark,
and start using zs_get_huge_class_size_watermark(). zsmalloc
really knows better.
Drop `max_zpage_size' and use zs_get_huge_class_size_watermark()
instead.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
drivers/block/zram/zram_drv.c | 2 +-
drivers/block/zram/zram_drv.h | 6 ------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 46055db..2621564 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -714,7 +714,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
goto out;
}
src = zstrm->buffer;
- if (unlikely(clen > max_zpage_size)) {
+ if (unlikely(clen > zs_get_huge_class_size_watermark())) {
clen = PAGE_SIZE;
if (is_partial_io(bvec))
src = uncmem;
diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index 8e92339..8879161 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -23,12 +23,6 @@
/*-- Configurable parameters */
/*
- * Pages that compress to size greater than this are stored
- * uncompressed in memory.
- */
-static const size_t max_zpage_size = PAGE_SIZE / 4 * 3;
-
-/*
* NOTE: max_zpage_size must be less than or equal to:
* ZS_MAX_ALLOC_SIZE. Otherwise, zs_malloc() would
* always return failure.
--
2.7.1
--
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 prev parent reply other threads:[~2016-02-21 13:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-21 13:27 [RFC][PATCH v2 0/3] mm/zsmalloc: increase objects density and reduce memory wastage Sergey Senozhatsky
2016-02-21 13:27 ` [RFC][PATCH v2 1/3] mm/zsmalloc: introduce zs_get_huge_class_size_watermark() Sergey Senozhatsky
2016-02-21 13:27 ` Sergey Senozhatsky [this message]
2016-02-22 0:04 ` [RFC][PATCH v2 2/3] zram: use zs_get_huge_class_size_watermark() Minchan Kim
2016-02-22 0:40 ` Sergey Senozhatsky
2016-02-22 1:27 ` Minchan Kim
2016-02-22 1:59 ` Sergey Senozhatsky
2016-02-22 2:05 ` Sergey Senozhatsky
2016-02-22 2:57 ` Minchan Kim
2016-02-22 3:54 ` Sergey Senozhatsky
2016-02-22 4:54 ` Minchan Kim
2016-02-22 5:05 ` Sergey Senozhatsky
2016-02-21 13:27 ` [RFC][PATCH v2 3/3] mm/zsmalloc: increase ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky
2016-02-22 0:25 ` Minchan Kim
2016-02-22 0:47 ` Sergey Senozhatsky
2016-02-22 1:34 ` Minchan Kim
2016-02-22 2:01 ` Sergey Senozhatsky
2016-02-22 2:34 ` Minchan Kim
2016-02-22 3:59 ` Sergey Senozhatsky
2016-02-22 4:41 ` Minchan Kim
2016-02-22 10:43 ` Sergey Senozhatsky
2016-02-23 8:25 ` Minchan Kim
2016-02-23 10:35 ` Sergey Senozhatsky
2016-02-23 16:05 ` Minchan Kim
2016-02-27 6:31 ` Sergey Senozhatsky
2016-02-22 2:24 ` Sergey Senozhatsky
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=1456061274-20059-3-git-send-email-sergey.senozhatsky@gmail.com \
--to=sergey.senozhatsky@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=js1304@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=sergey.senozhatsky.work@gmail.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