linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/41] percpu: Consistent per cpu operations V3
@ 2014-01-17 15:18 Christoph Lameter
  2014-01-17 15:18 ` [PATCH 01/41] mm: Replace __get_cpu_var uses with this_cpu_ptr Christoph Lameter
                   ` (40 more replies)
  0 siblings, 41 replies; 49+ messages in thread
From: Christoph Lameter @ 2014-01-17 15:18 UTC (permalink / raw)
  To: Tejun Heo
  Cc: akpm, rostedt, linux-kernel, Ingo Molnar, Peter Zijlstra,
	Thomas Gleixner

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.


^ permalink raw reply	[flat|nested] 49+ messages in thread
* [PATCH 00/41] percpu: Consistent per cpu operations V1
@ 2013-12-03 23:32 Christoph Lameter
  2013-12-03 23:32 ` [PATCH 21/41] block: Replace __this_cpu_ptr with raw_cpu_ptr Christoph Lameter
  0 siblings, 1 reply; 49+ messages in thread
From: Christoph Lameter @ 2013-12-03 23:32 UTC (permalink / raw)
  To: Tejun Heo
  Cc: akpm, rostedt, linux-kernel, Ingo Molnar, Peter Zijlstra,
	Thomas Gleixner

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 patchset 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 patchset 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 patchset 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 patchset
   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 patchset works in a couple of stages:

I. Patches 1-12 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.

II. Patch 13 adds the additional raw_cpu operations and raw_cpu_ptr().
    Patch 14 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 41/42 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 additonal
    passes through the kernel to ensure that none of the uses of these
    functions remain.


^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2014-01-18  3:05 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-17 15:18 [PATCH 00/41] percpu: Consistent per cpu operations V3 Christoph Lameter
2014-01-17 15:18 ` [PATCH 01/41] mm: Replace __get_cpu_var uses with this_cpu_ptr Christoph Lameter
2014-01-17 15:18 ` [PATCH 02/41] tracing: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 03/41] percpu: Replace __get_cpu_var " Christoph Lameter
2014-01-17 15:18 ` [PATCH 04/41] kernel misc: Replace __get_cpu_var uses Christoph Lameter
2014-01-17 15:18 ` [PATCH 05/41] drivers/char/random: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 06/41] drivers/cpuidle: Replace __get_cpu_var uses for address calculation Christoph Lameter
2014-01-17 15:18 ` [PATCH 07/41] drivers/oprofile: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 08/41] drivers/leds: Replace __get_cpu_var use through this_cpu_ptr Christoph Lameter
2014-01-17 15:18 ` [PATCH 09/41] drivers/clocksource: Replace __get_cpu_var used for address calculation Christoph Lameter
2014-01-17 15:18 ` [PATCH 10/41] staging/zsmalloc: Replace instances of using __get_cpu_var " Christoph Lameter
2014-01-17 15:18 ` [PATCH 11/41] parisc: Replace __get_cpu_var uses " Christoph Lameter
2014-01-17 15:18 ` [PATCH 12/41] metag: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 13/41] drivers/net/ethernet/tile: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 14/41] percpu: Add raw_cpu_ops Christoph Lameter
2014-01-17 15:18 ` [PATCH 15/41] mm: Use raw_cpu ops for determining current NUMA node Christoph Lameter
2014-01-17 15:18 ` [PATCH 16/41] modules: Use raw_cpu_write for initialization of per cpu refcount Christoph Lameter
2014-01-17 15:18 ` [PATCH 17/41] net: Replace __this_cpu_inc in route.c with raw_cpu_inc Christoph Lameter
2014-01-18  3:05   ` David Miller
2014-01-17 15:18 ` [PATCH 18/41] percpu: Add preemption checks to __this_cpu ops Christoph Lameter
2014-01-17 15:18 ` [PATCH 19/41] time: Replace __get_cpu_var uses Christoph Lameter
2014-01-17 15:18 ` [PATCH 20/41] scheduler: Replace __get_cpu_var with this_cpu_ptr Christoph Lameter
2014-01-17 15:18 ` [PATCH 21/41] block: Replace __this_cpu_ptr with raw_cpu_ptr Christoph Lameter
2014-01-17 15:18 ` [PATCH 22/41] rcu: Replace __this_cpu_ptr uses " Christoph Lameter
2014-01-17 15:18 ` [PATCH 23/41] watchdog: Replace __raw_get_cpu_var uses Christoph Lameter
2014-01-17 15:18 ` [PATCH 24/41] net: Replace get_cpu_var through this_cpu_ptr Christoph Lameter
2014-01-18  3:05   ` David Miller
2014-01-17 15:18 ` [PATCH 25/41] md: Replace __this_cpu_ptr with raw_cpu_ptr Christoph Lameter
2014-01-17 15:18 ` [PATCH 26/41] irqchips: Replace __this_cpu_ptr uses Christoph Lameter
2014-01-17 15:18 ` [PATCH 27/41] x86: Replace __get_cpu_var uses Christoph Lameter
2014-01-17 16:29   ` H. Peter Anvin
2014-01-17 15:18 ` [PATCH 28/41] arm: Replace __this_cpu_ptr with raw_cpu_ptr Christoph Lameter
2014-01-17 15:18 ` [PATCH 29/41] MIPS: Replace __get_cpu_var uses in FPU emulator Christoph Lameter
2014-01-17 15:18 ` [PATCH 30/41] mips: Replace __get_cpu_var uses Christoph Lameter
2014-01-17 15:18 ` [PATCH 31/41] s390: rename __this_cpu_ptr to raw_cpu_ptr Christoph Lameter
2014-01-17 15:18 ` [PATCH 32/41] ia64: Replace __get_cpu_var uses Christoph Lameter
2014-01-17 15:18 ` [PATCH 33/41] powerpc: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 34/41] sparc: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 35/41] tile: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 36/41] blackfin: " Christoph Lameter
2014-01-17 15:18 ` [PATCH 37/41] avr32: Replace __get_cpu_var with __this_cpu_write Christoph Lameter
2014-01-17 15:18 ` [PATCH 38/41] alpha: Replace __get_cpu_var Christoph Lameter
2014-01-17 15:18 ` [PATCH 39/41] sh: Replace __get_cpu_var uses Christoph Lameter
2014-01-17 15:18 ` [PATCH 40/41] Remove __get_cpu_var and __raw_get_cpu_var macros [only in 3.15] Christoph Lameter
2014-01-17 15:18 ` [PATCH 41/41] percpu: Remove __this_cpu_ptr Christoph Lameter
  -- strict thread matches above, loose matches on Subject: below --
2013-12-03 23:32 [PATCH 00/41] percpu: Consistent per cpu operations V1 Christoph Lameter
2013-12-03 23:32 ` [PATCH 21/41] block: Replace __this_cpu_ptr with raw_cpu_ptr Christoph Lameter
2013-12-04  2:20   ` Jens Axboe
2013-12-04 16:38     ` Christoph Lameter
2013-12-04 16:51       ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).