percpu: Consistent per cpu operations V3
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest41 patches 3 repliesIn review
V2->V3 from the cover letter
- Rediff patches
- Fix breakage caused by mips patches. Add a mips patch to convert from local_t.
- Update some descriptions.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/41 | mm: Replace __get_cpu_var uses with this_cpu_ptrlib/ mm/ mm/ +5 more | +14 | 0 replies | |
| 2/41 | tracing: Replace __get_cpu_var uses with this_cpu_ptrinclude/ kernel/ kernel/ | +4 | 0 replies | |
| 3/41 | percpu: Replace __get_cpu_var with this_cpu_ptrinclude/ | +1 | 0 replies | |
| 4/41 | kernel misc: Replace __get_cpu_var useskernel/ kernel/ | +7 | 0 replies | |
| 5/41 | drivers/char/random: Replace __get_cpu_var usesdrivers/ | +1 | 0 replies | |
| 6/41 | drivers/cpuidle: Replace __get_cpu_var uses for address calculationdrivers/ drivers/ | +5 | 0 replies | |
| 7/41 | drivers/oprofile: Replace __get_cpu_var uses for address calculationdrivers/ drivers/ | +6 | 0 replies | |
| 8/41 | drivers/leds: Replace __get_cpu_var use through this_cpu_ptrdrivers/ | +1 | 0 replies | |
| 9/41 | drivers/clocksource: Replace __get_cpu_var used for address calculationdrivers/ | +1 | 0 replies | |
| 10/41 | staging/zsmalloc: Replace instances of using __get_cpu_var for address calculationdrivers/ | +2 | 0 replies | |
| 11/41 | parisc: Replace __get_cpu_var uses for address calculationarch/ arch/ | +2 | 0 replies | |
| 12/41 | metag: Replace __get_cpu_var uses for address calculationarch/ | +7 | 0 replies | |
| 13/41 | drivers/net/ethernet/tile: Replace __get_cpu_var uses for address calculationdrivers/ drivers/ | +13 | 0 replies | |
| 14/41 | percpu: Add raw_cpu_opsarch/ arch/ include/ +1 more | +264 | 0 replies | |
| 15/41 | mm: Use raw_cpu ops for determining current NUMA nodeinclude/ | +2 | 0 replies | |
| 16/41 | modules: Use raw_cpu_write for initialization of per cpu refcount.kernel/ | +1 | 0 replies | |
| 17/41 | net: Replace __this_cpu_inc in route.c with raw_cpu_incnet/ | +1 | 1 reply | |
| 18/41 | percpu: Add preemption checks to __this_cpu opsinclude/ lib/ | +45 | 0 replies | |
| 19/41 | time: Replace __get_cpu_var usesdrivers/ kernel/ kernel/ +6 more | +34 | 0 replies | |
| 20/41 | scheduler: Replace __get_cpu_var with this_cpu_ptrinclude/ kernel/ kernel/ +5 more | +22 | 0 replies | |
| 21/41 | block: Replace __this_cpu_ptr with raw_cpu_ptrfs/ fs/ | +2 | 0 replies | |
| 22/41 | rcu: Replace __this_cpu_ptr uses with raw_cpu_ptrkernel/ kernel/ | +5 | 0 replies | |
| 23/41 | watchdog: Replace __raw_get_cpu_var useskernel/ | +5 | 0 replies | |
| 24/41 | net: Replace get_cpu_var through this_cpu_ptrinclude/ include/ net/ +8 more | +20 | 1 reply | |
| 25/41 | md: Replace __this_cpu_ptr with raw_cpu_ptrdrivers/ | +1 | 0 replies | |
| 26/41 | irqchips: Replace __this_cpu_ptr usesdrivers/ kernel/ | +6 | 0 replies | |
| 27/41 | x86: Replace __get_cpu_var usesarch/ arch/ arch/ +29 more | +142 | 1 reply | |
| 28/41 | arm: Replace __this_cpu_ptr with raw_cpu_ptrarch/ arch/ | +7 | 0 replies | |
| 29/41 | MIPS: Replace __get_cpu_var uses in FPU emulator.arch/ arch/ | +10 | 0 replies | |
| 30/41 | mips: Replace __get_cpu_var usesarch/ arch/ arch/ +1 more | +26 | 0 replies | |
| 31/41 | s390: rename __this_cpu_ptr to raw_cpu_ptrarch/ | +8 | 0 replies | |
| 32/41 | ia64: Replace __get_cpu_var usesarch/ arch/ arch/ +11 more | +40 | 0 replies | |
| 33/41 | powerpc: Replace __get_cpu_var usesarch/ arch/ arch/ +28 more | +91 | 0 replies | |
| 34/41 | sparc: Replace __get_cpu_var usesarch/ arch/ arch/ +7 more | +35 | 0 replies | |
| 35/41 | tile: Replace __get_cpu_var usesarch/ arch/ arch/ +9 more | +31 | 0 replies | |
| 36/41 | blackfin: Replace __get_cpu_var usesarch/ arch/ arch/ +1 more | +11 | 0 replies | |
| 37/41 | avr32: Replace __get_cpu_var with __this_cpu_writearch/ | +1 | 0 replies | |
| 38/41 | alpha: Replace __get_cpu_vararch/ arch/ | +10 | 0 replies | |
| 39/41 | sh: Replace __get_cpu_var usesarch/ arch/ arch/ +2 more | +23 | 0 replies | |
| 40/41 | Remove __get_cpu_var and __raw_get_cpu_var macros [only in 3.15]include/ | +0 | 0 replies | |
| 41/41 | percpu: Remove __this_cpu_ptrinclude/ | +0 | 0 replies |
Reviews trailers per patch
18 of 41 patches have a Reviewed-by or Acked-by.
| Patch | Rafael J. Wysocki | Ingo Molnar | David S. Miller | Masami Hiramatsu | Bryan Wu | James Hogan | Hans-Christian Egtvedt | Chris Metcalf | Richard Henderson | H. Peter Anvin |
|---|---|---|---|---|---|---|---|---|---|---|
| 1/41 | ||||||||||
| 2/41 | A-b | |||||||||
| 3/41 | ||||||||||
| 4/41 | ||||||||||
| 5/41 | ||||||||||
| 6/41 | A-b | |||||||||
| 7/41 | ||||||||||
| 8/41 | A-b | |||||||||
| 9/41 | A-b | |||||||||
| 10/41 | ||||||||||
| 11/41 | ||||||||||
| 12/41 | A-b | |||||||||
| 13/41 | A-b | |||||||||
| 14/41 | A-b | |||||||||
| 15/41 | A-b | |||||||||
| 16/41 | A-b | |||||||||
| 17/41 | A-b | A-b | ||||||||
| 18/41 | A-b | |||||||||
| 19/41 | ||||||||||
| 20/41 | A-b | |||||||||
| 21/41 | ||||||||||
| 22/41 | ||||||||||
| 23/41 | ||||||||||
| 24/41 | A-b | |||||||||
| 25/41 | ||||||||||
| 26/41 | ||||||||||
| 27/41 | A-b | A-b | ||||||||
| 28/41 | ||||||||||
| 29/41 | ||||||||||
| 30/41 | ||||||||||
| 31/41 | ||||||||||
| 32/41 | ||||||||||
| 33/41 | ||||||||||
| 34/41 | A-b | |||||||||
| 35/41 | A-b | |||||||||
| 36/41 | ||||||||||
| 37/41 | A-b | |||||||||
| 38/41 | A-b | |||||||||
| 39/41 | ||||||||||
| 40/41 | ||||||||||
| 41/41 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 10 reviewers.
Cover letter [PATCH 00/41] percpu: Consistent per cpu operations V3
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. Patches 1-13 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.
II. Patch 14 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_#.
III. Patch 15-17 use the raw_cpu operations in places that would give
us false positives once they are enabled.
IV. Patch 18 adds preemption checks to __this_cpu operations to allow
checking if preemption is properly disabled when these functions are used.
V. Patches 19-39 are conversion patches that use this_cpu operations
in various kernel subsystems/drivers or arch code.
VI. Patches 40/41 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.