Skip to content

Introduce my_cpu_ptr/__my_cpu_ptr

[email protected] lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Introduce my_cpu_ptr()include/linux/percpu.h+11 -09 replies
2/5Straight transformationsdrivers/infiniband/hw/ehca/ehca_irq.c drivers/net/chelsio/sge.c drivers/net/loopback.c +5 more+11 -130 replies
3/5Elimninate get/put_cpudrivers/dma/dmaengine.c drivers/net/veth.c fs/nfs/iostat.h +1 more+44 -491 reply
4/5sda_icsb_modify_counters() does not need a "cpu" variablefs/xfs/xfs_mount.c+6 -61 reply
5/5Use my_cpu_ptr in crypto subsystemcrypto/cryptd.c+1 -10 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchOlaf Weber
1/5
2/5
3/5
4/5A-b
5/5

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

Read the v1 thread

Cover letter [my_cpu_ptr 0/5] Introduce my_cpu_ptr/__my_cpu_ptr

The problem with per_cpu_ptr(x, smp_processor_id) is that it requires an array lookup to find the offset for the cpu. Processors typically have the offset for the current cpu area already in some kind of (arch dependent) efficiently accessible register or memory location.

We can use the per cpu offset instead of doing the array lookup to speed up the determination of the address of the percpu variable. This is particularly significant because these lookups occur in performance critical paths of the core kernel.

This optimization is a prerequiste to the introduction of per processor atomic operations for the core code. Atomic per processor operations implicitly do the offset calculation to the current per cpu area in a single instruction. The locations touched by this patchset are potential candidates for atomic per cpu operations.

The patchset does not cover arch code nor exotic cases where the current cpu is determined before the call into a function.