u64_stats: Streamline the implementation
authorThomas Gleixner <tglx@linutronix.de>
Thu, 25 Aug 2022 16:41:31 +0000 (18:41 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 19 Sep 2022 12:35:08 +0000 (14:35 +0200)
commit44b0c2957adc62b86fcd51adeaf8e993171bc319
tree43d810c6088e40acbf39e01d00e5b13758ee11bd
parent9458e0a78c45bc6537ce11eb9f03489eab92f9c2
u64_stats: Streamline the implementation

The u64 stats code handles 3 different cases:

  - 32bit UP
  - 32bit SMP
  - 64bit

with an unreadable #ifdef maze, which was recently expanded with PREEMPT_RT
conditionals.

Reduce it to two cases (32bit and 64bit) and drop the optimization for
32bit UP as suggested by Linus.

Use the new preempt_disable/enable_nested() helpers to get rid of the
CONFIG_PREEMPT_RT conditionals.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220825164131.402717-9-bigeasy@linutronix.de
include/linux/u64_stats_sync.h