Skip to content

mm: Reimplementation of dynamic per-cpu allocator

Ravikiran G Thirumalai linux-arch lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11mm: Reimplementation of dynamic per-cpu allocator -- vmalloc_fixuparch/arm/kernel/module.c arch/sh/kernel/cpu/sh4/sq.c arch/sparc64/kernel/module.c +3 more+15 -81 reply
2/11mm: Reimplementation of dynamic per-cpu allocator -- alloc_percpuinclude/linux/kernel.h include/linux/percpu.h mm/Makefile +2 more+703 -780 replies
3/11mm: Reimplementation of dynamic per-cpu allocator -- alloc_percpu_atomicinclude/linux/percpu.h mm/percpu.c+26 -170 replies
4/11mm: Reimplementation of dynamic per-cpu allocator -- change_alloc_percpu_usersinclude/linux/genhd.h include/linux/percpu_counter.h net/core/neighbour.c +5 more+20 -200 replies
5/11mm: Bigrefs -- add_getcpuptrinclude/linux/percpu.h+1 -00 replies
6/11mm: Bigrefs -- distributed refcountersinclude/linux/bigref.h kernel/Makefile kernel/bigref.c+197 -12 replies
7/11net: Use bigrefs for net_device.refcountdrivers/net/loopback.c include/linux/netdevice.h net/core/dev.c +1 more+22 -87 replies
8/11net: dst_abstraction macrosinclude/net/dst.h net/core/dst.c net/decnet/dn_route.c +11 more+115 -1180 replies
9/11net: dst_entry.refcount, use, lastuse to use alloc_percpuinclude/net/dst.h net/bridge/br_netfilter.c net/core/dst.c +4 more+342 -96 replies
10/11mm: Reimplementation of dynamic per-cpu allocator -- allow_early_mapvmareainclude/linux/slab.h include/linux/vmalloc.h mm/vmalloc.c+31 -70 replies
11/11mm: Reimplementation of dynamic per-cpu allocator -- hotplug_alloc_percpu_blocksinclude/linux/percpu.h init/main.c mm/percpu.c+95 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/11] mm: Reimplementation of dynamic per-cpu allocator

I have been maintaining a set of patches based on the reimplemented dynamic per-cpu allocator. I would like to have them included in -mm for testing and maybe merged when the mainline merge window opens :)...

The reimplementation of the dynamic per-cpu allocator has been published earlier and discussed, But the re-implementation with the applications and supporting numbers weren't published earlier. Here is an attempt towards the same.

This patchset contains
a) Reimplementation of alloc_percpu.
b) Rusty's implementation of distributed reference counters (bigrefs)
c) Code to change struct netdevice.refcnt to bigrefs -- this patch improves tbench performance by 6% on a 8 way 3.00 GHZ x86 Intel xeon (x445).
d) Code to change struct dst_entry.__refcnt per-cpu. This patch was originally submitted sometime back by Christoph. The reworked patch uses alloc_percpu, and struct dst_entry does not bloat up now. This patch along with the netdevice ref-counter patch above gives a whopping 55 % improvement on tbench on a 8way x86 xeon (x445). The same patchset resulted in 30% better tbench throughput on a x460 (8 way 3.3 Ghz x86_64 xeon).

All tbench numbers were on loopback with 8 clients.

The patches consist of

1. vmalloc_fixup
(Fix up __get_vm_area to take gfp flags as extra arg -- preparatory for 3.)

2. alloc_percpu
(Main allocator)

3. alloc_percpu_atomic
(Add GFP_FLAGS args to alloc_percpu -- for dst_entry.refcount)

4.change_alloc_percpu_users
(Change alloc_percpu users to use modified interface (with gfp_flags))

5. add_getcpuptr
(This is needed for bigrefs)

6. bigrefs
(Fixed up bigref from rusty)

7. netdev_refcnt_bigref.patch
(Bigref based netdev refcount)

8. dst_abstraction
9. dst_alloc_percpu
(dst_entry.refcount patches)

10. allow_early_mapvmarea
11. hotplug_alloc_percpu_blocks
(If alloc_percpu needs to be used real early then these patches will be needed. This patch allows us to use bigrefs/alloc_percpu for refcounters like struct vfsmount.mnt_count)