[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 2 Oct 2010 18:03:25 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Pekka Enberg <penberg@...nel.org>
cc: linux-kernel@...r.kernel.org, Christoph Lameter <cl@...ux.com>
Subject: Re: [RFC/PATCH] SLUB: Optimize slab_free() debug check
On Sat, 2 Oct 2010, Pekka Enberg wrote:
> This patch optimizes slab_free() debug check to use "c->node != NUMA_NO_NODE"
> instead of "c->node >= 0" because the former generates smaller code on x86-64:
>
> Before:
>
> 4736: 48 39 70 08 cmp %rsi,0x8(%rax)
> 473a: 75 26 jne 4762 <kfree+0xa2>
> 473c: 44 8b 48 10 mov 0x10(%rax),%r9d
> 4740: 45 85 c9 test %r9d,%r9d
> 4743: 78 1d js 4762 <kfree+0xa2>
>
> After:
>
> 4736: 48 39 70 08 cmp %rsi,0x8(%rax)
> 473a: 75 23 jne 475f <kfree+0x9f>
> 473c: 83 78 10 ff cmpl $0xffffffffffffffff,0x10(%rax)
> 4740: 74 1d je 475f <kfree+0x9f>
>
> This patch also cleans up __slab_alloc() to use NUMA_NO_NODE instead of "-1"
> for enabling debugging for a per-CPU cache.
>
> Cc: Christoph Lameter <cl@...ux.com>
> Cc: David Rientjes <rientjes@...gle.com>
> Signed-off-by: Pekka Enberg <penberg@...nel.org>
Acked-by: David Rientjes <rientjes@...gle.com>
You could compare to NUMA_NO_NODE in show_slab_objects(), as well, for the
same optimization.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists