Skip to content

locking: Backport upstream v5.18 locking/rcu commits for kernel-rt

Waiman Long requested to merge llong1/centos-stream-9:bz2076713_rt_locking into main

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2076713
MR: !747 (merged)
Omitted-fix: a4812d47deff ("mm/page_alloc: mark pagesets as __maybe_unused")
Commit had been merged as part of proactive mm backport MR #620.

This merge request backports upstream locking/rcu commit up to v5.18 to support the rebasing of kernel-rt to v5.18.

The first 56 patches are RCU commits and the remaining 33 patches are locking commits.

[v3: Remove 4 patches & update 2 patches]

Signed-off-by: Waiman Long longman@redhat.com

Waiman Long (89):
  rcu: Kill rnp->ofl_seq and use only rcu_state.ofl_lock for exclusion
  scftorture: Allow zero weight to exclude an smp_call_function*()
    category
  scftorture: Shut down if nonsensical arguments given
  scftorture: Count reschedule IPIs
  tools/rcu: Add an extract-stall script
  torture: Allot 1G of memory for scftorture runs
  torture: Make kvm-remote.sh print size of downloaded tarball
  refscale: Warn on individual ref_scale_init() error conditions
  scftorture: Warn on individual scf_torture_init() error conditions
  rcu: Fix description of kvfree_rcu()
  MAINTAINERS:  Add Frederic and Neeraj to their RCU files
  torture: Drop trailing ^M from console output
  torture: Allow four-digit repetition numbers for --configs parameter
  torture: Output per-failed-run summary lines from torture.sh
  torture: Make kvm.sh summaries note runs having only KCSAN reports
  torture: Indicate which torture.sh runs' bugs are all KCSAN reports
  rcutorture: Print message before invoking ->cb_barrier()
  rcu: Add mutex for rcu boost kthread spawning and affinity setting
  rcu: Create and use an rcu_rdp_cpu_online()
  rcu: Refactor rcu_barrier() empty-list handling
  rcu/nocb: Handle concurrent nocb kthreads creation
  rcu/exp: Fix check for idle context in rcu_exp_handler
  rcu: Remove unused rcu_state.boost
  rcu: Mark accesses to boost_starttime
  rcu: Mark ->expmask access in synchronize_rcu_expedited_wait()
  rcu: Rework rcu_barrier() and callback-migration logic
  rcu: Make rcu_barrier() no longer block CPU-hotplug operations
  torture: Distinguish kthread stopping and being asked to stop
  rcutorture: Increase visibility of forward-progress hangs
  rcutorture: Make rcu_fwd_cb_nodelay be a counter
  rcutorture: Add end-of-test check to rcu_torture_fwd_prog() loop
  torture: Compress KCSAN as well as KASAN vmlinux files
  rcu: Inline __call_rcu() into call_rcu()
  torture: Make kvm-remote.sh try multiple times to download tarball
  kasan: Record work creation stack trace with interrupts enabled
  torture: Print only one summary line per run
  rcu: Create per-cpu rcuc kthreads only when rcutree.use_softirq=0
  rcutorture: Fix rcu_fwd_mutex deadlock
  torture: Wake up kthreads after storing task_struct pointer
  rcu: Mark writes to the rcu_segcblist structure's ->flags field
  rcu: Move kthread_prio bounds-check to a separate function
  rcu: Make priority of grace-period thread consistent
  rcu: Elevate priority of offloaded callback threads
  rcu: Update documentation regarding kthread_prio cmdline parameter
  kthread: add the helper function kthread_run_on_cpu()
  rcutorture: make use of the helper function kthread_run_on_cpu()
  rcu: Uninline multi-use function: finish_rcuwait()
  rcu: Remove __read_mostly annotations from rcu_scheduler_active
    externs
  torture: Make kvm-find-errors.sh notice missing vmlinux file
  rcu: Don't deboost before reporting expedited quiescent state
  rcu: Replace cpumask_weight with cpumask_empty where appropriate
  rcu: Add per-CPU rcuc task dumps to RCU CPU stall warnings
  torture: Change KVM environment variable to RCUTORTURE
  rcutorture: Enable limited callback-flooding tests of SRCU
  rcu-tasks: Use order_base_2() instead of ilog2()
  rcu-tasks: Set ->percpu_enqueue_shift to zero upon contention
  locking/lockdep: Avoid RCU-induced noinstr fail
  lockdep: Improve comments in wait-type checks
  locking/lockdep: Cleanup the repeated declaration
  lockdep: Let lock_is_held_type() detect recursive read as read
  locking/rwbase: Optimize rwbase_read_trylock
  rtmutex: Check explicit for TASK_RTLOCK_WAIT.
  rtmutex: Wake up the waiters lockless while dropping the read lock.
  locking: Remove rcu_read_{,un}lock() for preempt_{dis,en}able()
  locking/rwsem: Disable preemption for spinning region
  locking/rwsem: Fix comments about reader optimistic lock stealing
    conditions
  locking: Remove spin_lock_flags() etc
  mm: make generic arch_is_kernel_initmem_freed() do what it says
  kallsyms: remove arch specific text and data check
  locking/rtmutex: Squash self-deadlock check for ww_rt_mutex.
  locking/rtmutex: Add rt_mutex_lock_nest_lock() and
    rt_mutex_lock_killable().
  lockdep: Remove softirq accounting on PREEMPT_RT.
  lockdep/selftests: Avoid using local_lock_{acquire|release}().
  lockdep/selftests: Unbalanced migrate_disable() & rcu_read_lock().
  lockdep/selftests: Skip the softirq related tests on PREEMPT_RT
  lockdep/selftests: Adapt ww-tests for PREEMPT_RT
  x86/mm: Include spinlock_t definition in pgtable.
  locking: Allow to include asm/spinlock_types.h from
    linux/spinlock_types_raw.h
  locking: Make owner_on_cpu() into <linux/sched.h>
  locking: Mark racy reads of owner->on_cpu
  locking/rtmutex: Fix incorrect condition in rtmutex_spin_on_owner()
  locking/lockdep: Avoid potential access of invalid memory in
    lock_class
  locking: Add missing __sched attributes
  locking/rwlocks: introduce write_lock_nested
  atomics: Fix atomic64_{read_acquire,set_release} fallbacks
  locking/local_lock: Make the empty local_lock_*() function a macro.
  locking: Enable RT_MUTEXES by default on PREEMPT_RT.
  lockdep: Correct lock_classes index mapping
  locking/lockdep: Iterate lock_classes directly when reading lockdep
    files

 .../admin-guide/kernel-parameters.txt         |   2 +
 MAINTAINERS                                   |   2 +
 arch/alpha/include/asm/spinlock_types.h       |   2 +-
 arch/arm/include/asm/spinlock_types.h         |   2 +-
 arch/arm64/include/asm/spinlock_types.h       |   2 +-
 arch/csky/include/asm/spinlock_types.h        |   2 +-
 arch/hexagon/include/asm/spinlock_types.h     |   2 +-
 arch/ia64/include/asm/spinlock.h              |  23 +-
 arch/ia64/include/asm/spinlock_types.h        |   2 +-
 arch/openrisc/include/asm/spinlock.h          |   3 -
 arch/parisc/include/asm/spinlock.h            |  15 -
 arch/powerpc/include/asm/simple_spinlock.h    |  21 --
 .../include/asm/simple_spinlock_types.h       |   2 +-
 arch/powerpc/include/asm/spinlock_types.h     |   2 +-
 arch/riscv/include/asm/spinlock_types.h       |   2 +-
 arch/s390/include/asm/spinlock.h              |   8 -
 arch/s390/include/asm/spinlock_types.h        |   2 +-
 arch/sh/include/asm/spinlock_types.h          |   2 +-
 arch/x86/include/asm/pgtable.h                |   1 +
 arch/xtensa/include/asm/spinlock_types.h      |   2 +-
 include/asm-generic/sections.h                |  30 --
 include/linux/atomic/atomic-arch-fallback.h   |  38 +-
 include/linux/debug_locks.h                   |   2 -
 include/linux/irqflags.h                      |  23 +-
 include/linux/kallsyms.h                      |   3 +-
 include/linux/kthread.h                       |  25 ++
 include/linux/local_lock_internal.h           |   6 +-
 include/linux/lockdep.h                       |  17 -
 include/linux/lockdep_types.h                 |   2 +-
 include/linux/ratelimit_types.h               |   2 +-
 include/linux/rcupdate.h                      |   4 +-
 include/linux/rcutree.h                       |   2 +-
 include/linux/rcuwait.h                       |   6 +-
 include/linux/rtmutex.h                       |   9 +
 include/linux/rwlock.h                        |  21 +-
 include/linux/rwlock_api_smp.h                |  14 +-
 include/linux/rwlock_rt.h                     |  10 +
 include/linux/sched.h                         |   9 +
 include/linux/spinlock.h                      |  13 -
 include/linux/spinlock_api_smp.h              |   9 -
 include/linux/spinlock_api_up.h               |   1 +
 include/linux/spinlock_types_up.h             |   2 +-
 include/linux/spinlock_up.h                   |   1 -
 include/trace/events/rcu.h                    |   9 +-
 init/Kconfig                                  |   1 +
 kernel/kthread.c                              |   1 +
 kernel/locking/lockdep.c                      |  68 ++--
 kernel/locking/lockdep_internals.h            |   6 +-
 kernel/locking/lockdep_proc.c                 |  51 ++-
 kernel/locking/mutex.c                        |  29 +-
 kernel/locking/percpu-rwsem.c                 |   5 +-
 kernel/locking/rtmutex.c                      |  29 +-
 kernel/locking/rtmutex_api.c                  |  30 +-
 kernel/locking/rwbase_rt.c                    |  11 +-
 kernel/locking/rwsem.c                        |  81 ++---
 kernel/locking/spinlock.c                     |  13 +-
 kernel/locking/spinlock_rt.c                  |  12 +
 kernel/rcu/rcu_segcblist.h                    |   4 +-
 kernel/rcu/rcutorture.c                       |  48 +--
 kernel/rcu/refscale.c                         |   6 +-
 kernel/rcu/tasks.h                            |   6 +-
 kernel/rcu/tree.c                             | 328 ++++++++++--------
 kernel/rcu/tree.h                             |  18 +-
 kernel/rcu/tree_exp.h                         |   5 +-
 kernel/rcu/tree_nocb.h                        |  18 +-
 kernel/rcu/tree_plugin.h                      |  31 +-
 kernel/rcu/tree_stall.h                       |  35 ++
 kernel/rcu/update.c                           |  11 +-
 kernel/scftorture.c                           |  39 ++-
 kernel/torture.c                              |   6 +-
 lib/locking-selftest.c                        | 172 ++++++---
 scripts/atomic/fallbacks/read_acquire         |  11 +-
 scripts/atomic/fallbacks/set_release          |   7 +-
 tools/rcu/extract-stall.sh                    |  34 ++
 .../rcutorture/bin/console-badness.sh         |   2 +-
 .../selftests/rcutorture/bin/kvm-again.sh     |   4 +-
 .../rcutorture/bin/kvm-check-branches.sh      |   4 +-
 .../rcutorture/bin/kvm-end-run-stats.sh       |   4 +-
 .../rcutorture/bin/kvm-find-errors.sh         |   6 +
 .../rcutorture/bin/kvm-recheck-rcu.sh         |   2 +-
 .../selftests/rcutorture/bin/kvm-remote.sh    |  26 +-
 tools/testing/selftests/rcutorture/bin/kvm.sh |  16 +-
 .../selftests/rcutorture/bin/parse-console.sh |  10 +
 .../selftests/rcutorture/bin/torture.sh       |  36 +-
 84 files changed, 965 insertions(+), 618 deletions(-)
 create mode 100644 tools/rcu/extract-stall.sh
Edited by Waiman Long

Merge request reports