Allow inlined spinlocks again V2
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | spinlock: move spinlock function bodies to header fileinclude/ include/ kernel/ | +300 | 0 replies | |
| 2/4 | spinlock: add macro to generate out-of-line variantskernel/ | +68 | 3 replies | |
| 3/4 | spinlock: allow inlined spinlocksinclude/ kernel/ lib/ | +53 | 0 replies | |
| 4/4 | spinlock: allow inline spinlocks on s390arch/ | +1 | 0 replies |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Peter Zijlstra |
|---|---|
| Series | A-b |
| 1/4 | |
| 2/4 | |
| 3/4 | |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [patch 0/4] Allow inlined spinlocks again V2
This patch set allows to have inlined spinlocks again.
V2: rewritten from scratch - now with readable code
The rationale behind this is that function calls on at least s390 are expensive.
If one considers that server kernels are usually compiled with !CONFIG_PREEMPT a simple spin_lock is just a compare and swap loop. The extra overhead for a function call is significant.
With inlined spinlocks overall cpu usage gets reduced by 1%-5% on s390. These numbers were taken with some network benchmarks. However I expect any workload that calls frequently into the kernel and which grabs a few locks to perform better.
The implementation is straight forward: move the function bodies of the locking functions to static inline functions and place them in a header file.
Dependent on CONFIG_SPINLOCK_INLINE generate out-of-line or inlined locking functions.
The patches should be self explaining.