All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] mm/slab: optimize allocation fastpath
@ 2015-01-05  1:37 ` Joonsoo Kim
  0 siblings, 0 replies; 34+ messages in thread
From: Joonsoo Kim @ 2015-01-05  1:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	linux-mm, linux-kernel, Jesper Dangaard Brouer

SLAB always disable irq before executing any object alloc/free operation.
This is really painful in terms of performance. Benchmark result that does
alloc/free repeatedly shows that each alloc/free is rougly 2 times slower
than SLUB's one (27 ns : 14 ns). To improve performance, this patchset
try to implement allocation fastpath without disabling irq.

This is a similar way to implement allocation fastpath in SLUB.
Transaction id is introduced and updated on every operation. In allocation
fastpath, object in array cache is read speculartively. And then, pointer
pointing object position in array cache and transaction id are updated
simultaneously through this_cpu_cmpxchg_double(). If tid is unchanged
until this updating, it ensures that there is no concurrent clients
allocating/freeing object to this slab. So allocation could succeed
without disabling irq.

Above mentioned benchmark shows that alloc/free fastpath performance
is improved roughly 22%. (27 ns -> 21 ns).

Unfortunately, I cannot optimize free fastpath, because speculartively
writing freeing object pointer into array cache cannot be possible.
If anyone have a good idea to optimize free fastpath, please let me know.

Thanks.

Joonsoo Kim (6):
  mm/slab: fix gfp flags of percpu allocation at boot phase
  mm/slab: remove kmemleak_erase() call
  mm/slab: clean-up __ac_get_obj() to prepare future changes
  mm/slab: rearrange irq management
  mm/slab: cleanup ____cache_alloc()
  mm/slab: allocation fastpath without disabling irq

 include/linux/kmemleak.h |    8 --
 mm/slab.c                |  257 +++++++++++++++++++++++++++++++---------------
 2 files changed, 176 insertions(+), 89 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2015-01-08 12:02 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-05  1:37 [PATCH 0/6] mm/slab: optimize allocation fastpath Joonsoo Kim
2015-01-05  1:37 ` Joonsoo Kim
2015-01-05  1:37 ` [PATCH 1/6] mm/slab: fix gfp flags of percpu allocation at boot phase Joonsoo Kim
2015-01-05  1:37   ` Joonsoo Kim
2015-01-05  1:37 ` [PATCH 2/6] mm/slab: remove kmemleak_erase() call Joonsoo Kim
2015-01-05  1:37   ` Joonsoo Kim
2015-01-08 12:01   ` Catalin Marinas
2015-01-08 12:01     ` Catalin Marinas
2015-01-05  1:37 ` [PATCH 3/6] mm/slab: clean-up __ac_get_obj() to prepare future changes Joonsoo Kim
2015-01-05  1:37   ` Joonsoo Kim
2015-01-05  1:37 ` [PATCH 4/6] mm/slab: rearrange irq management Joonsoo Kim
2015-01-05  1:37   ` Joonsoo Kim
2015-01-05  1:37 ` [PATCH 5/6] mm/slab: cleanup ____cache_alloc() Joonsoo Kim
2015-01-05  1:37   ` Joonsoo Kim
2015-01-05  1:37 ` [PATCH 6/6] mm/slab: allocation fastpath without disabling irq Joonsoo Kim
2015-01-05  1:37   ` Joonsoo Kim
2015-01-05 15:28   ` Christoph Lameter
2015-01-05 15:28     ` Christoph Lameter
2015-01-06  1:04     ` Joonsoo Kim
2015-01-06  1:04       ` Joonsoo Kim
2015-01-05 17:21   ` Andreas Mohr
2015-01-05 17:21     ` Andreas Mohr
2015-01-05 17:52     ` Christoph Lameter
2015-01-05 17:52       ` Christoph Lameter
2015-01-06  1:31     ` Joonsoo Kim
2015-01-06  1:31       ` Joonsoo Kim
2015-01-06 10:34       ` Andreas Mohr
2015-01-06 10:34         ` Andreas Mohr
2015-01-06 15:33         ` Christoph Lameter
2015-01-06 15:33           ` Christoph Lameter
2015-01-06 16:26           ` Andreas Mohr
2015-01-06 16:26             ` Andreas Mohr
2015-01-08  7:54         ` Joonsoo Kim
2015-01-08  7:54           ` Joonsoo Kim

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.