From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Nitin Gupta <ngupta@vflare.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Minchan Kim <minchan@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Dan Magenheimer <dan.magenheimer@oracle.com>,
Konrad Rzeszutek Wilk <konrad@darnok.org>
Subject: Re: [PATCH 0/7] zram/zsmalloc promotion
Date: Wed, 15 Aug 2012 05:42:32 -0400 [thread overview]
Message-ID: <20120815094232.GC2865@phenom.dumpdata.com> (raw)
In-Reply-To: <502A8D4D.3080101@linux.vnet.ibm.com>
On Tue, Aug 14, 2012 at 12:39:25PM -0500, Seth Jennings wrote:
> On 08/14/2012 12:36 AM, Nitin Gupta wrote:
> > On 08/13/2012 07:35 PM, Greg Kroah-Hartman wrote:
> >> On Wed, Aug 08, 2012 at 03:12:13PM +0900, Minchan Kim wrote:
> >>> This patchset promotes zram/zsmalloc from staging.
> >>> Both are very clean and zram is used by many embedded product
> >>> for a long time.
> >>>
> >>> [1-3] are patches not merged into linux-next yet but needed
> >>> it as base for [4-5] which promotes zsmalloc.
> >>> Greg, if you merged [1-3] already, skip them.
> >>
> >> I've applied 1-3 and now 4, but that's it, I can't apply the rest
> >> without getting acks from the -mm maintainers, sorry. Please work with
> >> them to get those acks, and then I will be glad to apply the rest (after
> >> you resend them of course...)
> >>
> >
> > On a second thought, I think zsmalloc should stay in drivers/block/zram
> > since zram is now the only user of zsmalloc since zcache and ramster are
> > moving to another allocator.
>
> The removal of zsmalloc from zcache has not been agreed upon
> yet.
<nods>
>
> Dan _suggested_ removing zsmalloc as the persistent
> allocator for zcache in favor of zbud to solve "flaws" in
> zcache. However, zbud has large deficiencies.
>
> A zero-filled 4k page will compress with LZO to 103 bytes.
> zbud can only store two compressed pages in each memory pool
> page, resulting in 95% fragmentation (i.e. 95% of the memory
> pool page goes unused). While this might not be a typical
> case, it is the worst case and absolutely does happen.
>
> zbud's design also effectively limits the useful page
> compression to 50%. If pages are compressed beyond that, the
> added space savings is lost in memory pool fragmentation.
> For example, if two pages compress to 30% of their original
> size, those two pages take up 60% of the zbud memory pool
> page, and 40% is lost to fragmentation because zbud can't
> store anything in the remaining space.
>
> To say it another way, for every two page cache pages that
> cleancache stores in zcache, zbud _must_ allocate a memory
> pool page, regardless of how well those pages compress.
> This reduces the efficiency of the page cache reclaim
> mechanism by half.
>
> I have posted some work (zsmalloc shrinker interface, user
> registered alloc/free functions for the zsmalloc memory
> pool) that begins to make zsmalloc a suitable replacement
> for zbud, but that work was put on hold until the path out
> of staging was established.
>
> I'm hoping to continue this work once the code is in
> mainline. While zbud has deficiencies, it doesn't prevent
> zcache from having value as I have already demonstrated.
> However, replacing zsmalloc with zbud would step backward
> for the reasons mentioned above.
What would be nice is having only one engine instead
of two - and I believe that is what you and Dan are aiming at.
Dan is looking at it from the perspective of re-engineering
zcache to use an LRU for keeping track of pages and pushing
those to the compression engine. And redoing the zbud engine
a bit (I think, let me double-check the git tree he pointed
out).
>
> I do not support the removal of zsmalloc from zcache. As
> such, I think the zsmalloc code should remain independent.
>
> Seth
>
> --
> 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>
--
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:[~2012-08-15 10:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 6:12 [PATCH 0/7] zram/zsmalloc promotion Minchan Kim
2012-08-08 6:12 ` [PATCH 1/7] zsmalloc: s/firstpage/page in new copy map funcs Minchan Kim
2012-08-08 6:12 ` [PATCH 2/7] zsmalloc: prevent mappping in interrupt context Minchan Kim
2012-08-08 6:12 ` [PATCH 3/7] zsmalloc: add page table mapping method Minchan Kim
2012-08-08 6:12 ` [PATCH 4/7] zsmalloc: collapse internal .h into .c Minchan Kim
2012-08-08 6:12 ` [PATCH 5/7] zsmalloc: promote to mm/ Minchan Kim
2012-08-08 6:12 ` [PATCH 6/7] zram: promote zram from staging Minchan Kim
2012-08-08 6:12 ` [PATCH 7/7] zram: select ZSMALLOC when ZRAM is configured Minchan Kim
2012-08-08 17:35 ` [PATCH 0/7] zram/zsmalloc promotion Nitin Gupta
2012-08-10 1:15 ` Konrad Rzeszutek Wilk
2012-08-14 2:35 ` Greg Kroah-Hartman
2012-08-14 5:36 ` Nitin Gupta
2012-08-14 6:20 ` Minchan Kim
2012-08-14 17:39 ` Seth Jennings
2012-08-15 9:42 ` Konrad Rzeszutek Wilk [this message]
2012-08-15 15:23 ` Dan Magenheimer
2012-08-14 6:22 ` Minchan Kim
2012-08-14 13:21 ` Konrad Rzeszutek Wilk
2012-08-17 5:47 ` Nitin Gupta
2012-08-21 0:56 ` Minchan Kim
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=20120815094232.GC2865@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dan.magenheimer@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=konrad@darnok.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.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).