Skip to content

percpu: Optimize percpu accesses

[email protected] linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3generic: Percpu infrastructure to rebase the per cpu area to zeroinclude/asm-alpha/topology.h include/asm-generic/percpu.h include/asm-generic/sections.h +7 more+50 -110 replies
2/3x86_64: Fold pda into per cpu areaarch/x86/kernel/head64.c arch/x86/kernel/setup64.c arch/x86/kernel/smpboot_64.c +4 more+48 -310 replies
3/3x86_64: Rebase per cpu variables to zeroarch/x86/Kconfig arch/x86/kernel/setup64.c arch/x86/kernel/vmlinux_64.lds.S +1 more+9 -40 replies

Reviews trailers per patch

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

PatchChristoph Lameter
SeriesR-b
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] percpu: Optimize percpu accesses

This patchset provides the following:

* Generic: Percpu infrastructure to rebase the per cpu area to zero

This provides for the capability of accessing the percpu variables using a local register instead of having to go through a table on node 0 to find the cpu-specific offsets. It also would allow atomic operations on percpu variables to reduce required locking.

* x86_64: Fold pda into per cpu area

Declare the pda as a per cpu variable. This will move the pda area to an address accessible by the x86_64 per cpu macros. Subtraction of __per_cpu_start will make the offset based from the beginning of the per cpu area. Since %gs is pointing to the pda, it will then also point to the per cpu variables and can be accessed thusly:

%gs:[&per_cpu_xxxx - __per_cpu_start]

* x86_64: Rebase per cpu variables to zero

Take advantage of the zero-based per cpu area provided above. Then we can directly use the x86_32 percpu operations. x86_32 offsets %fs by __per_cpu_start. x86_64 has %gs pointing directly to the pda and the per cpu area thereby allowing access to the pda with the x86_64 pda operations and access to the per cpu variables using x86_32 percpu operations.

Based on 2.6.24-rc8-mm1

---

Signature · 5 lines
--
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>