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 v3 0/5] mm/zsmalloc: rework compaction and increase density
Date: Thu, 3 Mar 2016 23:45:58 +0900 [thread overview]
Message-ID: <1457016363-11339-1-git-send-email-sergey.senozhatsky@gmail.com> (raw)
Hello,
RFC
Posting as an early preview of zsmalloc compaction and density
improvements.
The patch set will be rebased once Minchan posts his zsmalloc
rework.
zsmalloc knows the watermark after which classes are considered to be
huge - every object stored consumes the entire zspage (which consist
of a single order-0 page). zram, however, has its own statically defined
watermark for `bad' compression and stores every object larger than this
watermark as a PAGE_SIZE, object, IOW, to a ->huge class, this results in
increased memory consumption and memory wastage. And zram's 'bad' watermark
is much lower than zsmalloc's one. Apart from that, 'bad' compressions
are not so rare and expecting that pages passed to zram mostly will be
compressed to 3/4 of page_size is a bit strange. There is no a
compression algorithm with such ratio guarantees. This patch set inverts
this 'huge class watermark' enforcement, it's zsmalloc that knows better,
not zram.
The patch set reduces the number of huge classes, which permits to save
some memory.
zsmalloc classes are known to have fragmentation problems, that's why
compaction has been aidded in the first place. The patch set change
the existing shrinker callback based compaction and introduces a watermark
based one. So now zsmalloc controls class's fragmentation level and
schedules a compaction work on a per-class basis once class fragmentation
jumps above the watermark. Instead of compacting the entire pool
class-by-class we know touch only classes that are known to be heavily
fragmented.
All important patches contain test results and test descriptions.
And it seems that previously weak tests (truncate) are no longer
problematic.
v3:
-- user watermark based per-class compaction (workqueue)
-- remove shrinker compaction callbacks
-- increase order only for huge classes via special #defines
-- renamed zs_get_huge_class_size_watermark() function
-- patches re-ordered
v2:
-- keep ZS_MAX_PAGES_PER_ZSPAGE order of two (Joonsoo)
-- suffice ZS_MIN_ALLOC_SIZE alignment requirement
-- do not change ZS_MAX_PAGES_PER_ZSPAGE on PAE/LPAE and
on PAGE_SHIFT 16 systems (Joonsoo)
Sergey Senozhatsky (5):
mm/zsmalloc: introduce class auto-compaction
mm/zsmalloc: remove shrinker compaction callbacks
mm/zsmalloc: introduce zs_huge_object()
zram: use zs_huge_object()
mm/zsmalloc: reduce the number of huge classes
drivers/block/zram/zram_drv.c | 2 +-
drivers/block/zram/zram_drv.h | 6 --
include/linux/zsmalloc.h | 2 +
mm/zsmalloc.c | 157 ++++++++++++++++++++----------------------
4 files changed, 78 insertions(+), 89 deletions(-)
--
2.8.0.rc0
--
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:[~2016-03-03 14:48 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 14:45 Sergey Senozhatsky [this message]
2016-03-03 14:45 ` [RFC][PATCH v3 1/5] mm/zsmalloc: introduce class auto-compaction Sergey Senozhatsky
2016-03-14 6:17 ` Minchan Kim
2016-03-14 7:41 ` Sergey Senozhatsky
2016-03-14 8:20 ` Sergey Senozhatsky
2016-03-15 0:46 ` Minchan Kim
2016-03-15 1:33 ` Sergey Senozhatsky
2016-03-15 6:17 ` Minchan Kim
2016-03-17 1:29 ` Sergey Senozhatsky
2016-03-18 1:17 ` Minchan Kim
2016-03-18 2:00 ` Sergey Senozhatsky
2016-03-18 4:03 ` Minchan Kim
2016-03-18 4:10 ` Sergey Senozhatsky
2016-03-03 14:46 ` [RFC][PATCH v3 2/5] mm/zsmalloc: remove shrinker compaction callbacks Sergey Senozhatsky
2016-03-14 6:32 ` Minchan Kim
2016-03-14 7:45 ` Sergey Senozhatsky
2016-03-15 0:52 ` Minchan Kim
2016-03-15 1:05 ` Sergey Senozhatsky
2016-03-15 2:19 ` Minchan Kim
2016-03-03 14:46 ` [RFC][PATCH v3 3/5] mm/zsmalloc: introduce zs_huge_object() Sergey Senozhatsky
2016-03-14 6:53 ` Minchan Kim
2016-03-14 8:08 ` Sergey Senozhatsky
2016-03-15 0:54 ` Minchan Kim
2016-03-03 14:46 ` [RFC][PATCH v3 4/5] zram: use zs_huge_object() Sergey Senozhatsky
2016-03-03 14:46 ` [RFC][PATCH v3 5/5] mm/zsmalloc: reduce the number of huge classes 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=1457016363-11339-1-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;
as well as URLs for NNTP newsgroup(s).