Skip to content

SLUB with Queueing beats SLAB in hackbench

Christoph Lameter linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 of 16 patches 45 repliesIn review

14 of 16 patches are in this archive. The cover letter announces 16.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16ipc/sem.c: Bugfix for semop() not reporting successful operationipc/sem.c+30 -68 replies
4/16slub: Use a constant for a unspecified node.mm/slub.c+5 -52 replies
5/16SLUB: Constants need ULmm/slub.c+2 -22 replies
6/16slub: Use kmem_cache flags to detect if slab is in debugging mode.include/linux/page-flags.h mm/slub.c+12 -221 reply
7/16slub: discard_slab_unlockmm/slub.c+10 -62 replies
8/16slub: remove dynamic dma slab allocationmm/slub.c+41 -1125 replies
9/16make allocpercpu usable during early bootmm/percpu.c+3 -212 replies
10/16slub: Remove static kmem_cache_cpu array for bootmm/slub.c+6 -152 replies
11/16slub: Dynamically size kmalloc cache allocationsinclude/linux/slub_def.h mm/slub.c+139 -500 replies
12/16SLUB: Add SLAB style per cpu queueinginclude/linux/slub_def.h mm/slub.c+416 -5142 replies
13/16SLUB: Resize the new cpu queuesinclude/linux/slub_def.h mm/slub.c+178 -300 replies
14/16SLUB: Get rid of useless function count_free()mm/slub.c+3 -80 replies
15/16SLUB: Remove MAX_OBJS limitationinclude/linux/mm_types.h mm/slub.c+1 -110 replies
16/16slub: Drop allocator announcementmm/slub.c+0 -70 replies

Reviews trailers per patch

3 of 14 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchTejun HeoDavid RientjesKAMEZAWA HiroyukiLuca Tettamanti
SeriesA-b
1/16T-b
4/16Reviewd-by
5/16A-b R-b
6/16A-b
7/16
8/16
9/16A-b
10/16
11/16
12/16
13/16
14/16
15/16
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [S+Q 00/16] SLUB with Queueing beats SLAB in hackbench

The following patchset cleans some pieces up and then equips SLUB with per cpu queues that work similar to SLABs queues. With that approach SLUB wins in hackbench:

#!/bin/bash
uname -a
echo "./hackbench 100 process 200000"
./hackbench 100 process 200000
echo "./hackbench 100 process 20000"
./hackbench 100 process 20000
echo "./hackbench 100 process 20000"
./hackbench 100 process 20000
echo "./hackbench 100 process 20000"
./hackbench 100 process 20000
echo "./hackbench 10 process 20000"
./hackbench 10 process 20000
echo "./hackbench 10 process 20000"
./hackbench 10 process 20000
echo "./hackbench 10 process 20000"
./hackbench 10 process 20000
echo "./hackbench 1 process 20000"
./hackbench 1 process 20000
echo "./hackbench 1 process 20000"
./hackbench 1 process 20000
echo "./hackbench 1 process 20000"
./hackbench 1 process 20000

Procs NR SLAB SLUB SLUB+Queuing
----------------------------------------------------
100 200000 2741.3 2764.7 2231.9
100 20000 279.3 270.3 219.0
100 20000 278.0 273.1 219.2
100 20000 279.0 271.7 218.8
10 20000 34.0 35.6 28.8
10 20000 30.3 35.2 28.4
10 20000 32.9 34.6 28.4
1 20000 6.4 6.7 6.5
1 20000 6.3 6.8 6.5
1 20000 6.4 6.9 6.4

SLUB+Q is a merging of SLUB with some queuing concepts from SLAB and a new way of managing objects in the slabs using bitmaps. It uses a percpu queue so that free operations can be properly buffered and a bitmap for managing the free/allocated state in the slabs. It is slightly more inefficient than SLUB (due to the need to place large bitmaps --sized a few words--in some slab pages if there are more than BITS_PER_LONG objects in a slab) but in general does not increase space use too much.

The SLAB scheme of not touching the object during management is adopted. SLUB+Q can efficiently free and allocate cache cold objects without causing cache misses.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>