percpu: Consistent per cpu operations V4
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest48 patches 32 repliesIn review
V3->V4 from the cover letter
- Rediff patches
- Put the patches first that define the new API.
- Add patches to convert the __get_cpu_var stuff added in 3.14
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/48 | percpu: Add raw_cpu_opsarch/ arch/ include/ +1 more | +264 | 0 replies | |
| 2/48 | mm: Use raw_cpu ops for determining current NUMA nodeinclude/ | +2 | 0 replies | |
| 3/48 | modules: Use raw_cpu_write for initialization of per cpu refcount.kernel/ | +1 | 0 replies | |
| 4/48 | net: Replace __this_cpu_inc in route.c with raw_cpu_incnet/ | +1 | 0 replies | |
| 5/48 | percpu: Add preemption checks to __this_cpu opsinclude/ lib/ | +45 | 4 replies | |
| 6/48 | mm: Replace __get_cpu_var uses with this_cpu_ptrlib/ mm/ mm/ +6 more | +15 | 0 replies | |
| 7/48 | tracing: Replace __get_cpu_var uses with this_cpu_ptrinclude/ kernel/ kernel/ | +4 | 0 replies | |
| 8/48 | percpu: Replace __get_cpu_var with this_cpu_ptrinclude/ | +1 | 0 replies | |
| 9/48 | kernel misc: Replace __get_cpu_var useskernel/ kernel/ | +7 | 0 replies | |
| 10/48 | drivers/char/random: Replace __get_cpu_var usesdrivers/ | +1 | 0 replies | |
| 11/48 | drivers/cpuidle: Replace __get_cpu_var uses for address calculationdrivers/ drivers/ | +5 | 0 replies | |
| 12/48 | drivers/oprofile: Replace __get_cpu_var uses for address calculationdrivers/ drivers/ | +6 | 0 replies | |
| 13/48 | drivers/leds: Replace __get_cpu_var use through this_cpu_ptrdrivers/ | +1 | 0 replies | |
| 14/48 | drivers/clocksource: Replace __get_cpu_var used for address calculationdrivers/ | +1 | 0 replies | |
| 15/48 | parisc: Replace __get_cpu_var uses for address calculationarch/ arch/ | +2 | 0 replies | |
| 16/48 | metag: Replace __get_cpu_var uses for address calculationarch/ | +7 | 0 replies | |
| 17/48 | drivers/net/ethernet/tile: Replace __get_cpu_var uses for address calculationdrivers/ drivers/ | +13 | 0 replies | |
| 18/48 | drivers/net/ethernet/tile: __get_cpu_var call introduced in 3.14drivers/ | +1 | 0 replies | |
| 19/48 | tilegx: Another case of get_cpu_vardrivers/ | +1 | 0 replies | |
| 20/48 | time: Replace __get_cpu_var usesdrivers/ kernel/ kernel/ +6 more | +34 | 1 reply | |
| 21/48 | scheduler: Replace __get_cpu_var with this_cpu_ptrinclude/ kernel/ kernel/ +5 more | +22 | 0 replies | |
| 22/48 | tick-sched: Fix two new uses of __get_cpu_ptrkernel/ | +2 | 1 reply | |
| 23/48 | block: Replace __this_cpu_ptr with raw_cpu_ptrfs/ | +1 | 0 replies | |
| 24/48 | rcu: Replace __this_cpu_ptr uses with raw_cpu_ptrkernel/ kernel/ | +5 | 1 reply | |
| 25/48 | watchdog: Replace __raw_get_cpu_var useskernel/ | +5 | 0 replies | |
| 26/48 | net: Replace get_cpu_var through this_cpu_ptrinclude/ include/ net/ +8 more | +19 | 0 replies | |
| 27/48 | md: Replace __this_cpu_ptr with raw_cpu_ptrdrivers/ | +1 | 0 replies | |
| 28/48 | irqchips: Replace __this_cpu_ptr usesdrivers/ kernel/ | +6 | 0 replies | |
| 29/48 | x86: Replace __get_cpu_var usesarch/ arch/ arch/ +29 more | +142 | 0 replies | |
| 30/48 | x86: Change __get_cpu_var calls introduced in 3.14arch/ kernel/ kernel/ | +8 | 0 replies | |
| 31/48 | uv: Replace __get_cpu_vararch/ | +1 | 10 replies | |
| 32/48 | arm: Replace __this_cpu_ptr with raw_cpu_ptrarch/ arch/ | +7 | 0 replies | |
| 33/48 | MIPS: Replace __get_cpu_var uses in FPU emulator.arch/ arch/ | +10 | 0 replies | |
| 34/48 | mips: Replace __get_cpu_var usesarch/ arch/ arch/ +1 more | +26 | 0 replies | |
| 35/48 | s390: rename __this_cpu_ptr to raw_cpu_ptrarch/ | +8 | 0 replies | |
| 36/48 | s390: Replace __get_cpu_var usesarch/ arch/ arch/ +7 more | +28 | 0 replies | |
| 37/48 | s390: Handle new __get_cpu_var calls added in 3.14arch/ | +8 | 0 replies | |
| 38/48 | ia64: Replace __get_cpu_var usesarch/ arch/ arch/ +10 more | +39 | 0 replies | |
| 39/48 | powerpc: Replace __get_cpu_var usesarch/ arch/ arch/ +28 more | +89 | 13 replies | |
| 40/48 | powerpc: Handle new __get_cpu_var calls in 3.14arch/ arch/ arch/ +2 more | +17 | 0 replies | |
| 41/48 | sparc: Replace __get_cpu_var usesarch/ arch/ arch/ +7 more | +35 | 0 replies | |
| 42/48 | tile: Replace __get_cpu_var usesarch/ arch/ arch/ +9 more | +31 | 0 replies | |
| 43/48 | blackfin: Replace __get_cpu_var usesarch/ arch/ arch/ +1 more | +11 | 0 replies | |
| 44/48 | avr32: Replace __get_cpu_var with __this_cpu_writearch/ | +1 | 0 replies | |
| 45/48 | alpha: Replace __get_cpu_vararch/ arch/ | +10 | 0 replies | |
| 46/48 | sh: Replace __get_cpu_var usesarch/ arch/ arch/ +2 more | +23 | 0 replies | |
| 47/48 | Remove __get_cpu_var and __raw_get_cpu_var macros [only in 3.16]include/ | +0 | 0 replies | |
| 48/48 | percpu: Remove __this_cpu_ptrinclude/ | +0 | 0 replies |
Reviews trailers per patch
22 of 48 patches have a Reviewed-by or Acked-by.
| Patch | David S. Miller | Ingo Molnar | Rafael J. Wysocki | James Hogan | Chris Metcalf | Hans-Christian Egtvedt | Richard Henderson | Heiko Carstens | H. Peter Anvin | Bryan Wu | Masami Hiramatsu | Thomas Gleixner | Paul E. McKenney |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1/48 | A-b | ||||||||||||
| 2/48 | A-b | ||||||||||||
| 3/48 | A-b | ||||||||||||
| 4/48 | A-b | A-b | |||||||||||
| 5/48 | A-b | ||||||||||||
| 6/48 | |||||||||||||
| 7/48 | A-b | ||||||||||||
| 8/48 | |||||||||||||
| 9/48 | |||||||||||||
| 10/48 | |||||||||||||
| 11/48 | A-b | ||||||||||||
| 12/48 | |||||||||||||
| 13/48 | A-b | ||||||||||||
| 14/48 | A-b | ||||||||||||
| 15/48 | |||||||||||||
| 16/48 | A-b | ||||||||||||
| 17/48 | A-b | ||||||||||||
| 18/48 | |||||||||||||
| 19/48 | |||||||||||||
| 20/48 | R-b | ||||||||||||
| 21/48 | A-b | ||||||||||||
| 22/48 | R-b | ||||||||||||
| 23/48 | |||||||||||||
| 24/48 | A-b | ||||||||||||
| 25/48 | |||||||||||||
| 26/48 | A-b | ||||||||||||
| 27/48 | |||||||||||||
| 28/48 | |||||||||||||
| 29/48 | A-b | A-b | |||||||||||
| 30/48 | |||||||||||||
| 31/48 | |||||||||||||
| 32/48 | |||||||||||||
| 33/48 | |||||||||||||
| 34/48 | |||||||||||||
| 35/48 | |||||||||||||
| 36/48 | A-b | ||||||||||||
| 37/48 | |||||||||||||
| 38/48 | |||||||||||||
| 39/48 | |||||||||||||
| 40/48 | |||||||||||||
| 41/48 | A-b | ||||||||||||
| 42/48 | A-b | ||||||||||||
| 43/48 | |||||||||||||
| 44/48 | A-b | ||||||||||||
| 45/48 | A-b | ||||||||||||
| 46/48 | |||||||||||||
| 47/48 | |||||||||||||
| 48/48 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 13 reviewers.
Cover letter [PATCH 00/48] percpu: Consistent per cpu operations V4
Can we please get this merged? The first patch alone would at least define the functions required to enable the merging of the rest in any order and through any tree.
There is a git tree that can be pulled at
https://git.kernel.org/cgit/linux/kernel/git/christoph/percpu.git/
It has the following branches:
minimal Just the first 5 patches to get the preemption checks going
most All the conversion but not the removal of functionality in 47/48
all All these patches
V3->V4:
- Rediff patches
- Put the patches first that define the new API.
- Add patches to convert the __get_cpu_var stuff added in 3.14
V2->V3:
- Rediff patches
- Fix breakage caused by mips patches. Add a mips patch to convert from local_t.
- Update some descriptions.
V1->V2:
- Move legacy definition for __this_cpu_ptr into include/asm-generic/percpu.h so that users bypassing include/linux/percpu.h do not break (affects tile and s390)
- Merge raw_cpu_ops core and the patch to rename x86 __this_cpu primitives into one. Otherwise breakage will occur since x86 __this_cpu ops will fall back to generic ops which is not tolerated well by the preempt hackery in x86.
- Add notes to each patch that depends on another to avoid mismerges. Add acks etc.
- Use quilt-0.61 with the bug fix that ensures all mailing lists receive the postings intended for them.
The kernel has never been audited to ensure that this_cpu operations are consistently used throughout the kernel. The code generated in many places can be improved through the use of this_cpu operations (which uses a segment register for relocation of per cpu offsets instead of performing address calculations).
The patch set also addresses various consistency issues in general with the per cpu macros.
A. The semantics of __this_cpu_ptr() differs from this_cpu_ptr only
because checks are skipped. This is typically shown through a raw_ prefix. So this patch set changes the places where __this_cpu_ptr() is used to raw_cpu_ptr().
B. There has been the long term wish by some that __this_cpu operations
would check for preemption. However, there are cases where preemption checks need to be skipped. This patch set adds raw_cpu operations that do not check for preemption and then adds preemption checks to the __this_cpu operations.
C. The use of __get_cpu_var is always a reference to a percpu variable
that can also be handled via a this_cpu operation. This patch set replaces all uses of __get_cpu_var with this_cpu operations.
D. We can then use this_cpu RMW operations in various places replacing
sequences of instructions by a single one.
E. The use of this_cpu operations throughout will allow other arches than
x86 to implement optimized references and RMV operations to work with per cpu local data.
F. The use of this_cpu operations opens up the possibility to
further optimize code that relies on synchronization through per cpu data.
The patch set works in a couple of stages:
I. Patch 1 adds the additional raw_cpu operations and raw_cpu_ptr().
Also converts the existing __this_cpu_xx_# primitive in the x86 code to raw_cpu_xx_#.
II. Patch 2-4 use the raw_cpu operations in places that would give
us false positives once they are enabled.
III. Patch 5 adds preemption checks to __this_cpu operations to allow
checking if preemption is properly disabled when these functions are used.
IV. Patches 6-20 are patches that simply replace uses of __get_cpu_var
with this_cpu_ptr. They do not depend on any changes to the percpu code. No preemption tests are skipped if they are applied.
V. Patches 21-46 are conversion patches that use this_cpu operations
in various kernel subsystems/drivers or arch code.
VI. Patches 47/48 remove no longer used functions (__this_cpu_ptr
and __get_cpu_var). These should only be applied after all the conversion patches have made it and after we have done additional passes through the kernel to ensure that none of the uses of these functions remain.