From: Nitin Gupta <ngupta@vflare.org>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <cl@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3]: xvmalloc memory allocator
Date: Wed, 18 Mar 2009 21:37:35 +0530 [thread overview]
Message-ID: <49C11C47.8040908@vflare.org> (raw)
In-Reply-To: <84144f020903171134q2283d01aq21a2faaa77ab07c6@mail.gmail.com>
Pekka Enberg wrote:
> On Tue, 17 Mar 2009, Nitin Gupta wrote:
>>> Creating slabs for sizes in range, say, [32, 3/4*PAGE_SIZE] separated by
>>> 64bytes
>>> will require 48 slabs! Then for slab of each size class will have wastage
>>> due to
>>> unused slab objects in each class.
>>> Larger difference in slab sizes (and thus small no. of them), will surely
>>> cause too much
>>> wastage due to internal fragmentation.
>
> On Tue, Mar 17, 2009 at 10:58 AM, Christoph Lameter
> <cl@linux-foundation.org> wrote:
>> The slabs that match existing other slabs of similar sizes will be aliased
>> and not created. Create the 48 slabs and you likely will only use 10 real
>> additional ones. The rest will just be pointing to existing ones.
>
> Yup. One thing I don't quite understand is why you need all the 48
> caches in the first place. Allocation sizes tend to be clustered and I
> would have imagined you'd see that when compressing page sized chunks
> as well.
Compressed page lengths sometimes do tend to cluster within somewhat
small range. However, the range of where majority of pages will lie depends
highly of workload - sometimes range is not clear and sometime there is no
preferred range at all. Please refer this data:
http://code.google.com/p/compcache/wiki/CompressedLengthDistribution
It shows compressed page size distribution for various workloads.
> Using kmemtrace to analyze the exact reason for the bad
> fragmentation would probably be helpful.
>
That was purely internal fragmentation.
Wastage per obj = ksize(obj) - actual_size.
Code used for testing:
http://code.google.com/p/compcache/source/browse/trunk/sub-projects/testing/kmalloc_test/kmalloc_test.c
This is a "SwapReplay client". Please see:
http://code.google.com/p/compcache/wiki/SwapReplayDesign
Thanks,
Nitin
next prev parent reply other threads:[~2009-03-18 16:08 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 11:34 [PATCH 0/3]: compressed in-memory swapping Nitin Gupta
2009-03-17 11:36 ` [PATCH 1/3]: compressed RAM block device Nitin Gupta
2009-03-18 12:25 ` Nick Piggin
2009-03-18 12:38 ` Nitin Gupta
2009-03-18 12:49 ` Nick Piggin
2009-03-20 18:56 ` Pavel Machek
2009-03-20 19:53 ` Nitin Gupta
2009-03-17 11:37 ` [PATCH 2/3]: xvmalloc memory allocator Nitin Gupta
2009-03-17 16:41 ` Christoph Lameter
2009-03-17 17:55 ` Nitin Gupta
[not found] ` <d760cf2d0903171028o600dc94cn7a5238520d104455@mail.gmail.com>
2009-03-17 17:58 ` Christoph Lameter
2009-03-17 18:34 ` Pekka Enberg
2009-03-18 16:07 ` Nitin Gupta [this message]
2009-03-18 15:17 ` Nitin Gupta
2009-03-18 16:58 ` Christoph Lameter
2009-03-18 17:29 ` Nitin Gupta
2009-03-18 19:21 ` Pekka Enberg
2009-03-18 19:36 ` Nitin Gupta
2009-03-19 2:30 ` Nitin Gupta
2009-03-19 6:08 ` Pekka Enberg
2009-03-17 11:38 ` [PATCH 3/3]: documentation Nitin Gupta
2009-03-17 23:34 ` [PATCH 0/3]: compressed in-memory swapping Russ Dill
2009-03-20 14:07 [PATCH 0/3] compressed in-memory swapping take2 Nitin Gupta
2009-03-20 14:12 ` [PATCH 2/3] xvmalloc memory allocator Nitin Gupta
2009-03-20 14:57 ` Christoph Lameter
2009-03-20 16:24 ` Nitin Gupta
2009-03-20 17:40 ` Christoph Lameter
2009-03-20 19:01 ` Pekka Enberg
2009-03-20 19:43 ` Nitin Gupta
2009-03-21 10:21 ` Andrew Morton
2009-03-21 12:12 ` Nitin Gupta
2009-03-21 12:24 ` Andrew Morton
2009-03-21 13:14 ` Nitin Gupta
2009-03-21 16:21 ` Pekka Enberg
2009-03-21 17:36 ` Nitin Gupta
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=49C11C47.8040908@vflare.org \
--to=ngupta@vflare.org \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
/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
Powered by JetHome