All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nitin Gupta <ngupta@vflare.org>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Greg KH <greg@kroah.com>,
	gregkh@suse.de, devel@driverdev.osuosl.org,
	cascardo@holoscopio.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, brking@linux.vnet.ibm.com,
	rcj@linux.vnet.ibm.com
Subject: Re: [PATCH v2 0/3] staging: zcache: xcfmalloc support
Date: Fri, 16 Sep 2011 13:36:54 -0400	[thread overview]
Message-ID: <4E738936.5000405@vflare.org> (raw)
In-Reply-To: <1316125062.16137.80.camel@nimitz>

On 09/15/2011 06:17 PM, Dave Hansen wrote:

> On Thu, 2011-09-15 at 14:24 -0500, Seth Jennings wrote:
>> How would you suggest that I measure xcfmalloc performance on a "very
>> large set of workloads".  I guess another form of that question is: How
>> did xvmalloc do this?
> 
> Well, it didn't have a competitor, so this probably wasn't done. :)
>


A lot of testing was done for xvmalloc (and its predecessor, tlsf)
before it was integrated into zram:

http://code.google.com/p/compcache/wiki/AllocatorsComparison
http://code.google.com/p/compcache/wiki/xvMalloc
http://code.google.com/p/compcache/wiki/xvMallocPerformance

I think we can use the same set of testing tools. See:
http://code.google.com/p/compcache/source/browse/#hg%2Fsub-projects%2Ftesting

These tools do issue mix of alloc and frees each with some probability
which can be adjusted in code.

There is also a tool called "swap replay" which collects swap-out traces
and simulates the same behavior in userspace, allowing allocator testing
with "real world" traces. See:
http://code.google.com/p/compcache/wiki/SwapReplay

 
> I'd like to see a microbenchmarky sort of thing.  Do a million (or 100
> million, whatever) allocations, and time it for both allocators doing
> the same thing.  You just need to do the *same* allocations for both.
> 
> It'd be interesting to see the shape of a graph if you did:
> 
> 	for (i = 0; i < BIG_NUMBER; i++) 
> 		for (j = MIN_ALLOC; j < MAX_ALLOC; j += BLOCK_SIZE) 
> 			alloc(j);
> 			free();
> 
> ... basically for both allocators.  Let's see how the graphs look.  You
> could do it a lot of different ways: alloc all, then free all, or alloc
> one free one, etc...  Maybe it will surprise us.  Maybe the page
> allocator overhead will dominate _everything_, and we won't even see the
> x*malloc() functions show up.
> 
> The other thing that's important is to think of cases like I described
> that would cause either allocator to do extra splits/joins or be slow in
> other ways.  I expect xcfmalloc() to be slowest when it is allocating
> and has to break down a reserve page.  Let's say it does a bunch of ~3kb
> allocations and has no pages on the freelists, it will:
> 
> 	1. scan each of the 64 freelists heads (512 bytes of cache)
> 	2. split a 4k page
> 	3. reinsert the 1k remainder
> 
> Next time, it will:
> 
> 	1. scan, and find the 1k bit
> 	2. continue scanning, eventually touching each freelist...
> 	3. split a 4k page
> 	4. reinsert the 2k remainder
> 
> It'll end up doing a scan/split/reinsert in 3/4 of the cases, I think.
> The case of the freelists being quite empty will also be quite common
> during times the pool is expanding.  I think xvmalloc() will have some
> of the same problems, but let's see if it does in practice.
>



Thanks,
Nitin

WARNING: multiple messages have this Message-ID (diff)
From: Nitin Gupta <ngupta@vflare.org>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Greg KH <greg@kroah.com>,
	gregkh@suse.de, devel@driverdev.osuosl.org,
	cascardo@holoscopio.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, brking@linux.vnet.ibm.com,
	rcj@linux.vnet.ibm.com
Subject: Re: [PATCH v2 0/3] staging: zcache: xcfmalloc support
Date: Fri, 16 Sep 2011 13:36:54 -0400	[thread overview]
Message-ID: <4E738936.5000405@vflare.org> (raw)
In-Reply-To: <1316125062.16137.80.camel@nimitz>

On 09/15/2011 06:17 PM, Dave Hansen wrote:

> On Thu, 2011-09-15 at 14:24 -0500, Seth Jennings wrote:
>> How would you suggest that I measure xcfmalloc performance on a "very
>> large set of workloads".  I guess another form of that question is: How
>> did xvmalloc do this?
> 
> Well, it didn't have a competitor, so this probably wasn't done. :)
>


A lot of testing was done for xvmalloc (and its predecessor, tlsf)
before it was integrated into zram:

http://code.google.com/p/compcache/wiki/AllocatorsComparison
http://code.google.com/p/compcache/wiki/xvMalloc
http://code.google.com/p/compcache/wiki/xvMallocPerformance

I think we can use the same set of testing tools. See:
http://code.google.com/p/compcache/source/browse/#hg%2Fsub-projects%2Ftesting

These tools do issue mix of alloc and frees each with some probability
which can be adjusted in code.

There is also a tool called "swap replay" which collects swap-out traces
and simulates the same behavior in userspace, allowing allocator testing
with "real world" traces. See:
http://code.google.com/p/compcache/wiki/SwapReplay

 
> I'd like to see a microbenchmarky sort of thing.  Do a million (or 100
> million, whatever) allocations, and time it for both allocators doing
> the same thing.  You just need to do the *same* allocations for both.
> 
> It'd be interesting to see the shape of a graph if you did:
> 
> 	for (i = 0; i < BIG_NUMBER; i++) 
> 		for (j = MIN_ALLOC; j < MAX_ALLOC; j += BLOCK_SIZE) 
> 			alloc(j);
> 			free();
> 
> ... basically for both allocators.  Let's see how the graphs look.  You
> could do it a lot of different ways: alloc all, then free all, or alloc
> one free one, etc...  Maybe it will surprise us.  Maybe the page
> allocator overhead will dominate _everything_, and we won't even see the
> x*malloc() functions show up.
> 
> The other thing that's important is to think of cases like I described
> that would cause either allocator to do extra splits/joins or be slow in
> other ways.  I expect xcfmalloc() to be slowest when it is allocating
> and has to break down a reserve page.  Let's say it does a bunch of ~3kb
> allocations and has no pages on the freelists, it will:
> 
> 	1. scan each of the 64 freelists heads (512 bytes of cache)
> 	2. split a 4k page
> 	3. reinsert the 1k remainder
> 
> Next time, it will:
> 
> 	1. scan, and find the 1k bit
> 	2. continue scanning, eventually touching each freelist...
> 	3. split a 4k page
> 	4. reinsert the 2k remainder
> 
> It'll end up doing a scan/split/reinsert in 3/4 of the cases, I think.
> The case of the freelists being quite empty will also be quite common
> during times the pool is expanding.  I think xvmalloc() will have some
> of the same problems, but let's see if it does in practice.
>



Thanks,
Nitin

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2011-09-16 17:37 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07 14:09 [PATCH v2 0/3] staging: zcache: xcfmalloc support Seth Jennings
2011-09-07 14:09 ` Seth Jennings
2011-09-07 14:09 ` [PATCH v2 1/3] staging: zcache: xcfmalloc memory allocator for zcache Seth Jennings
2011-09-07 14:09   ` Seth Jennings
2011-09-07 14:09 ` [PATCH v2 2/3] staging: zcache: replace xvmalloc with xcfmalloc Seth Jennings
2011-09-07 14:09   ` Seth Jennings
2011-09-07 14:09 ` [PATCH v2 3/3] staging: zcache: add zv_page_count and zv_desc_count Seth Jennings
2011-09-07 14:09   ` Seth Jennings
2011-09-09 20:34 ` [PATCH v2 0/3] staging: zcache: xcfmalloc support Greg KH
2011-09-09 20:34   ` Greg KH
2011-09-10  2:41   ` Nitin Gupta
2011-09-10  2:41     ` Nitin Gupta
2011-09-12 14:35     ` Seth Jennings
2011-09-12 14:35       ` Seth Jennings
2011-09-13  1:55       ` Nitin Gupta
2011-09-13  1:55         ` Nitin Gupta
2011-09-13 15:58         ` Seth Jennings
2011-09-13 15:58           ` Seth Jennings
2011-09-13 21:18           ` Nitin Gupta
2011-09-13 21:18             ` Nitin Gupta
2011-09-15 16:31             ` Seth Jennings
2011-09-15 16:31               ` Seth Jennings
2011-09-15 17:29               ` Dan Magenheimer
2011-09-15 17:29                 ` Dan Magenheimer
2011-09-15 19:24                 ` Seth Jennings
2011-09-15 19:24                   ` Seth Jennings
2011-09-15 20:07                   ` Dan Magenheimer
2011-09-15 20:07                     ` Dan Magenheimer
2011-10-03 15:59                     ` Dave Hansen
2011-10-03 15:59                       ` Dave Hansen
2011-10-03 17:54                       ` Nitin Gupta
2011-10-03 17:54                         ` Nitin Gupta
2011-10-03 18:22                         ` Dave Hansen
2011-10-03 18:22                           ` Dave Hansen
2011-10-05  1:03                           ` Dan Magenheimer
2011-10-05  1:03                             ` Dan Magenheimer
2011-09-15 22:17                   ` Dave Hansen
2011-09-15 22:17                     ` Dave Hansen
2011-09-15 22:27                     ` Dan Magenheimer
2011-09-15 22:27                       ` Dan Magenheimer
2011-09-16 17:36                     ` Nitin Gupta [this message]
2011-09-16 17:36                       ` Nitin Gupta
2011-09-16 17:52                   ` Nitin Gupta
2011-09-16 17:52                     ` Nitin Gupta
2011-09-16 17:46               ` Nitin Gupta
2011-09-16 17:46                 ` Nitin Gupta
2011-09-16 18:33                 ` Seth Jennings
2011-09-16 18:33                   ` Seth Jennings
2011-11-01 17:30                 ` Dave Hansen
2011-11-01 17:30                   ` Dave Hansen
2011-11-01 18:35                   ` Dan Magenheimer
2011-11-01 18:35                     ` Dan Magenheimer
2011-11-02  2:42                     ` Nitin Gupta
2011-11-02  2:42                       ` Nitin Gupta
2011-09-29 17:47 ` Seth Jennings
2011-09-29 17:47   ` Seth Jennings

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=4E738936.5000405@vflare.org \
    --to=ngupta@vflare.org \
    --cc=brking@linux.vnet.ibm.com \
    --cc=cascardo@holoscopio.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rcj@linux.vnet.ibm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.