From: Seth Jennings <sjenning@linux.vnet.ibm.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: gregkh@suse.de, devel@driverdev.osuosl.org, ngupta@vflare.org,
cascardo@holoscopio.com, rdunlap@xenotime.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] staging: zcache: xcfmalloc support
Date: Thu, 01 Sep 2011 17:42:03 -0500 [thread overview]
Message-ID: <4E600A3B.2090609@linux.vnet.ibm.com> (raw)
In-Reply-To: <6e0e7950-0c91-4bb3-929b-3853fa95e63d@default>
On 08/31/2011 02:46 PM, Dan Magenheimer wrote:
>> This patchset introduces a new memory allocator for persistent
>> pages for zcache. The current allocator is xvmalloc. xvmalloc
>> has two notable limitations:
>> * High (up to 50%) external fragmentation on allocation sets > PAGE_SIZE/2
>> * No compaction support which reduces page reclaimation
>>
>> xcfmalloc seeks to fix these issues by using scatter-gather model that
>> allows for cross-page allocations and relocatable data blocks.
>>
>> In tests, with pages that only compress to 75% of their original
>> size, xvmalloc had an effective compression (pages stored / pages used by the
>> compressed memory pool) of ~95% (~20% lost to fragmentation). Almost nothing
>> was gained by the compression in this case. xcfmalloc had an effective
>> compression of ~77% (about ~2% lost to fragmentation and metadata overhead).
>
> Hi Seth --
>
> Do you have any data comparing xcfmalloc vs xvmalloc for
> compression ratio and/or performance (cycles to compress
> or decompress different pages) on a wide(r) range of data?
> Assuming xcfmalloc isn't "always better", maybe it would
> be best to allow the algorithm to be selectable? (And
> then we would also need to decide the default.)
>
Ok, so I was able to get some numbers and I said I'd send them out
today, so... here they are. 32-bit system. I create a cgroup with a
memory.limit_in_bytes of 256MB. Then I ran a program that allocates
512MB, one 4k page a time. The pages can be filled with zeros
or text depending on the command arguments. The text is english
text that has an average compression ratio, using lzo1x, of 75%
with little deviation. zv_max_mean_zsize and zv_max_zsize are
both set to 3584 (7 * PAGE_SIZE / 8).
xvmalloc
curr_pages zv_page_count effective compression
zero filled 65859 1269 1.93%
text (75%) 65925 65892 99.95%
xcfmalloc (descriptors are 24 bytes, 170 per 4k page)
curr_pages zv_page_count zv_desc_count effective compression
zero filled 65845 2068 65858 3.72% (+1.79)
text (75%) 65965 50848 114980 78.11% (-21.84)
This shows that xvmalloc is 1.79 points better on zero filled pages.
This is because xcfmalloc has higher internal fragmentation because
the block sizes aren't as granular as xvmalloc. This contributes
to 1.21 points of the delta. xcfmalloc also has block descriptors,
which contributes to the remaining 0.58 points.
It also shows that xcfmalloc is 21.84 points better on text filled
pages. This is because of xcfmalloc allocations can span different
pages which greatly reduces external fragmentation compared to xvmalloc.
I did some quick tests with "time" using the same program and the
timings are very close (3 run average, little deviation):
xvmalloc:
zero filled 0m0.852s
text (75%) 0m14.415s
xcfmalloc:
zero filled 0m0.870s
text (75%) 0m15.089s
I suspect that the small decrease in throughput is due to the
extra memcpy in xcfmalloc. However, these timing, more than
anything, demonstrate that the throughput is GREATLY effected
by the compressibility of the data.
In all cases, all swapped pages where captured by frontswap with
no put failures.
> (Hopefully Nitin will have a chance to comment, since he
> has much more expertise in compression than I do.)
>
> Thanks,
> Dan
prev parent reply other threads:[~2011-09-01 22:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 14:40 [PATCH 0/3] staging: zcache: xcfmalloc support Seth Jennings
2011-08-31 14:40 ` [PATCH 1/3] staging: zcache: xcfmalloc memory allocator for zcache Seth Jennings
2011-09-01 15:43 ` Seth Jennings
2011-09-06 23:51 ` Greg KH
2011-08-31 14:40 ` [PATCH 2/3] staging: zcache: replace xvmalloc with xcfmalloc Seth Jennings
2011-08-31 14:40 ` [PATCH 3/3] staging: zcache: add zv_page_count and zv_desc_count Seth Jennings
2011-08-31 19:46 ` [PATCH 0/3] staging: zcache: xcfmalloc support Dan Magenheimer
2011-08-31 22:06 ` Seth Jennings
2011-09-01 15:17 ` Dan Magenheimer
2011-09-01 16:33 ` Seth Jennings
2011-09-01 16:54 ` Dave Hansen
2011-09-01 22:01 ` Seth Jennings
2011-09-01 23:44 ` Dave Hansen
2011-09-01 22:42 ` Seth Jennings [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=4E600A3B.2090609@linux.vnet.ibm.com \
--to=sjenning@linux.vnet.ibm.com \
--cc=cascardo@holoscopio.com \
--cc=dan.magenheimer@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ngupta@vflare.org \
--cc=rdunlap@xenotime.net \
/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).