linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "MinChan Kim" <minchan.kim@gmail.com>
To: Nick Piggin <npiggin@suse.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [rfc][patch] SLQB slab allocator
Date: Tue, 16 Dec 2008 08:42:12 +0900	[thread overview]
Message-ID: <28c262360812151542g2ac032fay6c5b03d846d05a77@mail.gmail.com> (raw)
In-Reply-To: <20081212002518.GH8294@wotan.suse.de>

Hi, Nick.
I am interested in SLQB.
So I tested slqb, slub, slab by kernel compile time.

make all -j 8

slqb and slub not DEBUG.
my test environment is as follows.

cpu family	: 6
model		: 15
model name	: Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz
stepping	: 11
cpu MHz		: 1600.000
cache size	: 4096 KB

Below is average for ten time test.

slab :
user : 2376.484, system : 192.616 elapsed : 12:22.0
slub :
user : 2378.439, system : 194.989 elapsed : 12:22.4
slqb :
user : 2380.556, system : 194.801 elapsed : 12:23.0

so, slqb is rather slow although it is a big difference.
Interestingly, slqb consumes less time than slub in system.

And I found some trivial bug. :)

<snip>

> +static struct slqb_page *new_slab_page(struct kmem_cache *s, gfp_t flags, int node)
> +{
> +       struct slqb_page *page;
> +       void *start;
> +       void *last;
> +       void *p;
> +
> +       BUG_ON(flags & GFP_SLAB_BUG_MASK);
> +
> +       page = allocate_slab(s,
> +               flags & (GFP_RECLAIM_MASK | GFP_CONSTRAINT_MASK), node);
> +       if (!page)
> +               goto out;
> +
> +       page->flags |= 1 << PG_slab;

PG_slab set is redundant.
It's already set in alloc_slqb_pags_node.

> +       start = page_address(&page->page);
> +
> +       if (unlikely(slab_poison(s)))
> +               memset(start, POISON_INUSE, PAGE_SIZE << s->order);

<snip>

> +void kfree(const void *object)
> +{
> +       struct kmem_cache *s;
> +       struct page *p;
> +       struct slqb_page *page;
> +       unsigned long flags;
> +
> +       if (unlikely(ZERO_OR_NULL_PTR(object)))
> +               return;
> +
> +       p = virt_to_page(object);
> +       prefetch(p);
> +       prefetchw(object);
> +
> +#ifdef CONFIG_SLQB_DEBUG
> +       page = (struct slqb_page *)compound_head(p);
> +       s = page->list->cache;
> +       debug_check_no_locks_freed(object, s->objsize);
> +       if (likely(object) && unlikely(slab_debug(s))) {
> +               if (unlikely(!free_debug_processing(s, object, __builtin_return_address(0))))
> +                       return;
> +       }
> +#endif
> +
> +       local_irq_save(flags);
> +#ifndef CONFIG_SLQB_DEBUG
> +       page = (struct slqb_page *)compound_head(p);
> +       s = page->list->cache;
> +#endif

If it is not defined CONFIG_SLQB_DEBUG, page is garbage.

> +       __slab_free(s, page, object);
> +       local_irq_restore(flags);
> +}
> +EXPORT_SYMBOL(kfree);
> +


-- 
Kinds regards,
MinChan Kim
--
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>

  parent reply	other threads:[~2008-12-15 23:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12  0:25 Nick Piggin
2008-12-12  0:31 ` [rfc][patch] mm: kfree_size Nick Piggin
2008-12-13  2:36   ` Christoph Lameter
2008-12-12  5:38 ` [rfc][patch] SLQB slab allocator Eric Dumazet
2008-12-12  5:50   ` Nick Piggin
2008-12-12  7:07     ` Eric Dumazet
2008-12-12  7:23       ` Nick Piggin
2008-12-12  8:05         ` Eric Dumazet
2008-12-12  9:43         ` Nick Piggin
2008-12-13  2:34 ` Christoph Lameter
2008-12-13  9:03   ` Pekka Enberg
2008-12-15  1:51     ` Christoph Lameter
2008-12-14 23:04   ` Nick Piggin
2008-12-15 14:02     ` Christoph Lameter
2008-12-15 14:16       ` Nick Piggin
2008-12-15 15:03         ` Christoph Lameter
2008-12-15 23:42 ` MinChan Kim [this message]
2008-12-17  6:42   ` Nick Piggin
2008-12-17  7:01     ` MinChan Kim
2008-12-17  7:09       ` Nick Piggin
2008-12-19  7:48 ` Zhang, Yanmin

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=28c262360812151542g2ac032fay6c5b03d846d05a77@mail.gmail.com \
    --to=minchan.kim@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    /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