Linux Container Development
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
To: Christoph Lameter <clameter-sJ/iWh9BUns@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH 1/4] Add notification about some major slab events
Date: Wed, 19 Sep 2007 14:08:32 +0400	[thread overview]
Message-ID: <46F0F520.1010804@openvz.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0709171122150.27057-RYO/mD75kfhx2SFC9UQUAuF7EQX82lMiAL8bYrjMMd8@public.gmane.org>

[snip]

>> @@ -1555,6 +1650,11 @@ static void __always_inline *slab_alloc(
>>  	}
>>  	local_irq_restore(flags);
>>  
>> +	if (object && slub_alloc_notify(s, object, gfpflags) < 0) {
>> +		kmem_cache_free(s, object);
>> +		return NULL;
>> +	}
>> +
>>  	if (unlikely((gfpflags & __GFP_ZERO) && object))
>>  		memset(object, 0, c->objsize);
>>  
> 
> Please stay completely out of the fast path. No modifications to 
> slab_alloc or slab_free please. It is possible to force all allocations of 
> a particular slab of interest to use the slow path in __slab_alloc (maybe 
> as a result of the slab page allocation hook returning a certain result 
> code). See how the SLAB_DEBUG handling does it. You can adapt that and then do the 
> object checks in __slab_alloc.

I have run the kernbench test on the kernels with a) containers support
and b) containers and kmem accounting support but (!) turned off. The
results are:
                 a)             b)
Elapsed Time     768.500000     767.050000
User Time        679.360000     679.240000
System Time      87.020000      86.950000
Percent CPU      99.000000      99.000000
Context Switches 376891.000000  375407.000000
Sleeps           385377.000000  385426.000000

The test run was kernbench -n 1 -o 4 -M, the node is i386
DualCore Xeon 3.2GHz with 2Gb of RAM.

so the fast path is still fast, and we have two ways:
1. we keep the checks on the fastpath and have 0 overhead for
   unaccounted caches and some overhead for accounted;
2. we move the checks into the slow one and have 0 overhead for
   unaccounted caches and huge overhead for accounted.

I admit that I messed something, so shall I measure some 
other activity or use another HW?

Thanks,
Pavel

  parent reply	other threads:[~2007-09-19 10:08 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-17 12:19 [PATCH 0/4] Kernel memory accounting container (v3) Pavel Emelyanov
     [not found] ` <46EE70B4.6060902-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-17 12:26   ` [PATCH 1/4] Add notification about some major slab events Pavel Emelyanov
     [not found]     ` <46EE726F.1010707-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-17 18:25       ` Christoph Lameter
     [not found]         ` <Pine.LNX.4.64.0709171122150.27057-RYO/mD75kfhx2SFC9UQUAuF7EQX82lMiAL8bYrjMMd8@public.gmane.org>
2007-09-18  8:03           ` Pavel Emelyanov
     [not found]             ` <46EF865F.4050409-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-18 19:35               ` Christoph Lameter
2007-09-19 10:08           ` Pavel Emelyanov [this message]
     [not found]             ` <46F0F520.1010804-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-19 17:45               ` Christoph Lameter
2007-09-17 12:30   ` [PATCH 2/4] Switch caches notification dynamically Pavel Emelyanov
     [not found]     ` <46EE7375.3040902-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-17 18:29       ` Christoph Lameter
     [not found]         ` <Pine.LNX.4.64.0709171128380.27057-RYO/mD75kfhx2SFC9UQUAuF7EQX82lMiAL8bYrjMMd8@public.gmane.org>
2007-09-18  6:51           ` Pavel Emelyanov
2007-09-17 18:32       ` Christoph Lameter
     [not found]         ` <Pine.LNX.4.64.0709171130470.27057-RYO/mD75kfhx2SFC9UQUAuF7EQX82lMiAL8bYrjMMd8@public.gmane.org>
2007-09-18  6:54           ` Pavel Emelyanov
     [not found]             ` <46EF7610.1060302-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-18 19:36               ` Christoph Lameter
2007-09-17 12:33   ` [PATCH 3/4] Setup the container Pavel Emelyanov
2007-09-17 12:35   ` [PATCH 4/4] Account for the slub objects Pavel Emelyanov
     [not found]     ` <46EE74AF.70105-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-17 16:08       ` Dave Hansen
2007-09-18  6:27         ` Pavel Emelyanov
2007-09-17 16:09       ` Dave Hansen
2007-09-18  6:28         ` Pavel Emelyanov
2007-09-17 18:27   ` [PATCH 0/4] Kernel memory accounting container (v3) Christoph Lameter
     [not found]     ` <Pine.LNX.4.64.0709171126330.27057-RYO/mD75kfhx2SFC9UQUAuF7EQX82lMiAL8bYrjMMd8@public.gmane.org>
2007-09-17 20:51       ` Balbir Singh
     [not found]         ` <46EEE8B7.2070805-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2007-09-17 21:19           ` Christoph Lameter
     [not found]             ` <Pine.LNX.4.64.0709171417330.28926-RYO/mD75kfhx2SFC9UQUAuF7EQX82lMiAL8bYrjMMd8@public.gmane.org>
2007-09-18  6:56               ` Pavel Emelyanov
2007-09-18  6:25       ` Pavel Emelyanov
     [not found]         ` <46EF6F6C.60702-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-18 19:37           ` Christoph Lameter
  -- strict thread matches above, loose matches on Subject: below --
2007-09-21  9:14 [PATCH 0/5] Kernel memory accounting container (v4) Pavel Emelyanov
     [not found] ` <46F38B67.3020609-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-21  9:17   ` [PATCH 1/4] Add notification about some major slab events Pavel Emelyanov
     [not found]     ` <46F38C1D.2080902-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-24 21:05       ` Christoph Lameter

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=46F0F520.1010804@openvz.org \
    --to=xemul-gefaqzzx7r8dnm+yrofe0a@public.gmane.org \
    --cc=clameter-sJ/iWh9BUns@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    /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