1. 03 May, 2022 5 commits
  2. 20 Apr, 2022 28 commits
    • Paul E. McKenney's avatar
      rcutorture: Make torture.sh allow for --kasan · fb036ad7
      Paul E. McKenney authored
      The torture.sh script provides extra memory for scftorture and rcuscale.
      However, the total memory provided is only 1G, which is less than the
      2G that is required for KASAN testing.  This commit therefore ups the
      torture.sh script's 1G to 2G.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      fb036ad7
    • Paul E. McKenney's avatar
      rcutorture: Make torture.sh refscale and rcuscale specify Tasks Trace RCU · d69e048b
      Paul E. McKenney authored
      Now that the Tasks RCU flavors are selected by their users rather than
      by the rcutorture scenarios, torture.sh fails when attempting to run
      NOPREEMPT scenarios for refscale and rcuscale.  This commit therefore
      makes torture.sh specify CONFIG_TASKS_TRACE_RCU=y to avoid such failure.
      
      Why not also CONFIG_TASKS_RCU?  Because tracing selects this one.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      d69e048b
    • Paul E. McKenney's avatar
      rcutorture: Make kvm.sh allow more memory for --kasan runs · 31015625
      Paul E. McKenney authored
      KASAN allots significant memory to track allocation state, and the amount
      of memory has increased recently, which results in frequent OOMs on a
      few of the rcutorture scenarios.  This commit therefore provides 2G of
      memory for --kasan runs, up from the 512M default.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      31015625
    • Paul E. McKenney's avatar
      torture: Save "make allmodconfig" .config file · c7756fff
      Paul E. McKenney authored
      Currently, torture.sh saves only the build output and exit code from the
      "make allmodconfig" test.  This commit also saves the .config file.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      c7756fff
    • Paul E. McKenney's avatar
      scftorture: Remove extraneous "scf" from per_version_boot_params · f877e399
      Paul E. McKenney authored
      There is an extraneous "scf" in the per_version_boot_params shell function
      used by scftorture.  No harm done in that it is just passed as an argument
      to the /init program in initrd, but this commit nevertheless removes it.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      f877e399
    • Paul E. McKenney's avatar
      rcutorture: Adjust scenarios' Kconfig options for CONFIG_PREEMPT_DYNAMIC · eec52c7f
      Paul E. McKenney authored
      Now that CONFIG_PREEMPT_DYNAMIC=y is the default, kernels that are
      ostensibly built with CONFIG_PREEMPT_NONE=y or CONFIG_PREEMPT_VOLUNTARY=y
      are now actually built with CONFIG_PREEMPT=y, but are by default booted
      so as to disable preemption.  Although this allows much more flexibility
      from a single kernel binary, it means that the current rcutorture
      scenarios won't find build errors that happen only when preemption is
      fully disabled at build time.
      
      This commit therefore adds CONFIG_PREEMPT_DYNAMIC=n to several scenarios,
      and while in the area switches one from CONFIG_PREEMPT_NONE=y to
      CONFIG_PREEMPT_VOLUNTARY=y to add coverage of this Kconfig option.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      eec52c7f
    • Paul E. McKenney's avatar
      torture: Enable CSD-lock stall reports for scftorture · 3e112a39
      Paul E. McKenney authored
      This commit passes the csdlock_debug=1 kernel parameter in order to
      enable CSD-lock stall reports for torture.sh scftorure runs.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      3e112a39
    • Paul E. McKenney's avatar
      torture: Skip vmlinux check for kvm-again.sh runs · 00f3133b
      Paul E. McKenney authored
      The kvm-again.sh script reruns an previously built set of kernels, so
      the vmlinux files are associated with that previous run, not this on.
      This results in kvm-find_errors.sh reporting spurious failed-build errors.
      This commit therefore omits the vmlinux check for kvm-again.sh runs.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      00f3133b
    • Paul E. McKenney's avatar
      scftorture: Adjust for TASKS_RCU Kconfig option being selected · bf5e7a2f
      Paul E. McKenney authored
      This commit adjusts the scftorture PREEMPT and NOPREEMPT scenarios to
      account for the TASKS_RCU Kconfig option being explicitly selected rather
      than computed in isolation.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      bf5e7a2f
    • Paul E. McKenney's avatar
      rcuscale: Allow rcuscale without RCU Tasks Rude/Trace · 5ce027f4
      Paul E. McKenney authored
      Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for
      RCU Tasks Rude and RCU Tasks Trace.  Unless that kernel builds rcuscale,
      whether built-in or as a module, in which case these RCU Tasks flavors are
      (unnecessarily) built in.  This both increases kernel size and increases
      the complexity of certain tracing operations.  This commit therefore
      decouples the presence of rcuscale from the presence of RCU Tasks Rude
      and RCU Tasks Trace.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      5ce027f4
    • Paul E. McKenney's avatar
      rcuscale: Allow rcuscale without RCU Tasks · 4df002d9
      Paul E. McKenney authored
      Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for
      RCU Tasks.  Unless that kernel builds rcuscale, whether built-in or as
      a module, in which case RCU Tasks is (unnecessarily) built.  This both
      increases kernel size and increases the complexity of certain tracing
      operations.  This commit therefore decouples the presence of rcuscale
      from the presence of RCU Tasks.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      4df002d9
    • Paul E. McKenney's avatar
      refscale: Allow refscale without RCU Tasks Rude/Trace · dec86781
      Paul E. McKenney authored
      Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for
      RCU Tasks Rude and RCU Tasks Trace.  Unless that kernel builds refscale,
      whether built-in or as a module, in which case these RCU Tasks flavors are
      (unnecessarily) built in.  This both increases kernel size and increases
      the complexity of certain tracing operations.  This commit therefore
      decouples the presence of refscale from the presence of RCU Tasks Rude
      and RCU Tasks Trace.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      dec86781
    • Paul E. McKenney's avatar
      refscale: Allow refscale without RCU Tasks · 5f654af1
      Paul E. McKenney authored
      Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for
      RCU Tasks.  Unless that kernel builds refscale, whether built-in or as a
      module, in which case RCU Tasks is (unnecessarily) built in.  This both
      increases kernel size and increases the complexity of certain tracing
      operations.  This commit therefore decouples the presence of refscale
      from the presence of RCU Tasks.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      5f654af1
    • Paul E. McKenney's avatar
      rcutorture: Allow specifying per-scenario stat_interval · 58524e0f
      Paul E. McKenney authored
      The rcutorture test suite makes double use of the rcutorture.stat_interval
      module parameter.  As its name suggests, it controls the frequency
      of statistics printing, but it also controls the rcu_torture_writer()
      stall timeout.  The current setting of 15 seconds works surprisingly well.
      However, given that the RCU tasks stall-warning timeout is ten -minutes-,
      15 seconds is too short for TASKS02, which runs a non-preemptible kernel
      on a single CPU.
      
      This commit therefore adds checks for per-scenario specification of the
      rcutorture.stat_interval module parameter.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      58524e0f
    • Paul E. McKenney's avatar
      rcutorture: Add CONFIG_PREEMPT_DYNAMIC=n to TASKS02 scenario · 3831fc02
      Paul E. McKenney authored
      Now that CONFIG_PREEMPT_DYNAMIC=y is the default, TASKS02 no longer
      builds a pure non-preemptible kernel that uses Tiny RCU.  This commit
      therefore fixes this new hole in rcutorture testing by adding
      CONFIG_PREEMPT_DYNAMIC=n to the TASKS02 rcutorture scenario.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      3831fc02
    • Paul E. McKenney's avatar
      rcutorture: Allow rcutorture without RCU Tasks Rude · 4c3f7b0e
      Paul E. McKenney authored
      Unless a kernel builds rcutorture, whether built-in or as a module, that
      kernel is also built with CONFIG_TASKS_RUDE_RCU, whether anything else
      needs Tasks Rude RCU or not.  This unnecessarily increases kernel size.
      This commit therefore decouples the presence of rcutorture from the
      presence of RCU Tasks Rude.
      
      However, there is a need to select CONFIG_TASKS_RUDE_RCU for testing
      purposes.  Except that casual users must not be bothered with
      questions -- for them, this needs to be fully automated.  There is
      thus a CONFIG_FORCE_TASKS_RUDE_RCU that selects CONFIG_TASKS_RUDE_RCU,
      is user-selectable, but which depends on CONFIG_RCU_EXPERT.
      
      [ paulmck: Apply kernel test robot feedback. ]
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      4c3f7b0e
    • Paul E. McKenney's avatar
      rcutorture: Allow rcutorture without RCU Tasks · 3b6e1dd4
      Paul E. McKenney authored
      Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for
      RCU Tasks.  Unless that kernel builds rcutorture, whether built-in or as
      a module, in which case RCU Tasks is (unnecessarily) used.  This both
      increases kernel size and increases the complexity of certain tracing
      operations.  This commit therefore decouples the presence of rcutorture
      from the presence of RCU Tasks.
      
      However, there is a need to select CONFIG_TASKS_RCU for testing purposes.
      Except that casual users must not be bothered with questions -- for them,
      this needs to be fully automated.  There is thus a CONFIG_FORCE_TASKS_RCU
      that selects CONFIG_TASKS_RCU, is user-selectable, but which depends
      on CONFIG_RCU_EXPERT.
      
      [ paulmck: Apply kernel test robot feedback. ]
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      3b6e1dd4
    • Paul E. McKenney's avatar
      rcutorture: Allow rcutorture without RCU Tasks Trace · 40c1278a
      Paul E. McKenney authored
      Unless a kernel builds rcutorture, whether built-in or as a module, that
      kernel is also built with CONFIG_TASKS_TRACE_RCU, whether anything else
      needs Tasks Trace RCU or not.  This unnecessarily increases kernel size.
      This commit therefore decouples the presence of rcutorture from the
      presence of RCU Tasks Trace.
      
      However, there is a need to select CONFIG_TASKS_TRACE_RCU for
      testing purposes.  Except that casual users must not be bothered with
      questions -- for them, this needs to be fully automated.  There is thus
      a CONFIG_FORCE_TASKS_TRACE_RCU that selects CONFIG_TASKS_TRACE_RCU,
      is user-selectable, but which depends on CONFIG_RCU_EXPERT.
      
      [ paulmck: Apply kernel test robot feedback. ]
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      40c1278a
    • Paul E. McKenney's avatar
      rcu: Make the TASKS_RCU Kconfig option be selected · 835f14ed
      Paul E. McKenney authored
      Currently, any kernel built with CONFIG_PREEMPTION=y also gets
      CONFIG_TASKS_RCU=y, which is not helpful to people trying to build
      preemptible kernels of minimal size.
      
      Because CONFIG_TASKS_RCU=y is needed only in kernels doing tracing of
      one form or another, this commit moves from TASKS_RCU deciding when it
      should be enabled to the tracing Kconfig options explicitly selecting it.
      This allows building preemptible kernels without TASKS_RCU, if desired.
      
      This commit also updates the SRCU-N and TREE09 rcutorture scenarios
      in order to avoid Kconfig errors that would otherwise result from
      CONFIG_TASKS_RCU being selected without its CONFIG_RCU_EXPERT dependency
      being met.
      
      [ paulmck: Apply BPF_SYSCALL feedback from Andrii Nakryiko. ]
      Reported-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
      Tested-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
      Tested-by: default avatarZhouyi Zhou <zhouzhouyi@gmail.com>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      835f14ed
    • Zqiang's avatar
      rcu: Use IRQ_WORK_INIT_HARD() to avoid rcu_read_unlock() hangs · f596e2ce
      Zqiang authored
      When booting kernels built with both CONFIG_RCU_STRICT_GRACE_PERIOD=y
      and CONFIG_PREEMPT_RT=y, the rcu_read_unlock_special() function's
      invocation of irq_work_queue_on() the init_irq_work() causes the
      rcu_preempt_deferred_qs_handler() function to work execute in SCHED_FIFO
      irq_work kthreads.  Because rcu_read_unlock_special() is invoked on each
      rcu_read_unlock() in such kernels, the amount of work just keeps piling
      up, resulting in a boot-time hang.
      
      This commit therefore avoids this hang by using IRQ_WORK_INIT_HARD()
      instead of init_irq_work(), but only in kernels built with both
      CONFIG_PREEMPT_RT=y and CONFIG_RCU_STRICT_GRACE_PERIOD=y.
      Signed-off-by: default avatarZqiang <qiang1.zhang@intel.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      f596e2ce
    • David Vernet's avatar
      rcu_sync: Fix comment to properly reflect rcu_sync_exit() behavior · f1efe84d
      David Vernet authored
      The rcu_sync_enter() function is used by updaters to force RCU readers
      (e.g. percpu-rwsem) to use their slow paths during an update.  This is
      accomplished by setting the ->gp_state of the rcu_sync structure to
      GP_ENTER.  In the case of percpu-rwsem, the readers' slow path waits on
      a semaphore instead of just incrementing a reader count.  Each updater
      invokes the rcu_sync_exit() function to signal to readers that they
      may again take their fastpaths.  The rcu_sync_exit() function sets the
      ->gp_state of the rcu_sync structure to GP_EXIT, and if all goes well,
      after a grace period the ->gp_state reverts back to GP_IDLE.
      
      Unfortunately, the rcu_sync_enter() function currently has a comment
      incorrectly stating that rcu_sync_exit() (by an updater) will re-enable
      reader "slowpaths".  This patch changes the comment to state that this
      function re-enables reader fastpaths.
      Signed-off-by: default avatarDavid Vernet <void@manifault.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      f1efe84d
    • Zqiang's avatar
      rcu: Check for successful spawn of ->boost_kthread_task · 88ca472f
      Zqiang authored
      For the spawning of the priority-boost kthreads can fail, improbable
      though this might seem.  This commit therefore refrains from attemoting
      to initiate RCU priority boosting when The ->boost_kthread_task pointer
      is NULL.
      Signed-off-by: default avatarZqiang <qiang1.zhang@intel.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      88ca472f
    • Frederic Weisbecker's avatar
      rcu: Fix preemption mode check on synchronize_rcu[_expedited]() · 70ae7b0c
      Frederic Weisbecker authored
      An early check on synchronize_rcu[_expedited]() tries to determine if
      the current CPU is in UP mode on an SMP no-preempt kernel, in which case
      there is no need to start a grace period since the current assumed
      quiescent state is all we need.
      
      However the preemption mode doesn't take into account the boot selected
      preemption mode under CONFIG_PREEMPT_DYNAMIC=y, missing a possible
      early return if the running flavour is "none" or "voluntary".
      
      Use the shiny new preempt mode accessors to fix this.  However,
      avoid invoking them during early boot because doing so triggers a
      WARN_ON_ONCE().
      
      [ paulmck: Update for mainlined API. ]
      Reported-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      Signed-off-by: default avatarFrederic Weisbecker <frederic@kernel.org>
      Cc: Uladzislau Rezki <uladzislau.rezki@sony.com>
      Cc: Joel Fernandes <joel@joelfernandes.org>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com>
      Cc: Valentin Schneider <valentin.schneider@arm.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      70ae7b0c
    • Paul E. McKenney's avatar
      rcu: Print number of online CPUs in RCU CPU stall-warning messages · 80d530b4
      Paul E. McKenney authored
      RCU's synchronous grace periods act quite differently when there is
      only one online CPU, especially in the no-op case in kernels built with
      CONFIG_PREEMPTION=n.  This change in behavior can be important debugging
      information, so this commit adds the number of online CPUs to the RCU
      CPU stall warning messages.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      80d530b4
    • Paul E. McKenney's avatar
      rcu: Add comments to final rcu_gp_cleanup() "if" statement · 75182a4e
      Paul E. McKenney authored
      The final "if" statement in rcu_gp_cleanup() has proven to be rather
      confusing, straightforward though it might have seemed when initially
      written.  This commit therefore adds comments to its "then" and "else"
      clauses to at least provide a more elevated form of confusion.
      Reported-by: default avatarBoqun Feng <boqun.feng@gmail.com>
      Reported-by: default avatarFrederic Weisbecker <frederic@kernel.org>
      Reported-by: default avatarNeeraj Upadhyay <quic_neeraju@quicinc.com>
      Reported-by: default avatarUladzislau Rezki <urezki@gmail.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      75182a4e
    • Paul E. McKenney's avatar
      kernel/smp: Provide boot-time timeout for CSD lock diagnostics · 3791a223
      Paul E. McKenney authored
      Debugging of problems involving insanely long-running SMI handlers
      proceeds better if the CSD-lock timeout can be adjusted.  This commit
      therefore provides a new smp.csd_lock_timeout kernel boot parameter
      that specifies the timeout in milliseconds.  The default remains at the
      previously hard-coded value of five seconds.
      
      [ paulmck: Apply feedback from Juergen Gross. ]
      
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      3791a223
    • Akira Yokosawa's avatar
      docs: Update RCU cross-references as suggested in doc-guide · 404147fa
      Akira Yokosawa authored
      The RCU documentation contains old-style cross references which
      do not follow the best practices outlined in doc-guide/sphinx.rst.
      In addition, some of the cross references use URLs that should be replaced
      by pathnames.
      
      Update all of these cross references and adjust the surrounding words.
      
      Summary of changes:
      
        - out-of-date plaintext file names (*.txt) -> *.rst
        - references by :ref: tags -> path names of *.rst
          * use relative paths to .rst files under the RCU/ subdirectory
          * use abs paths of Documentation/xxx for other .rst files
        - references by URL under https://www.kernel.org/ -> paths of *.rst
        - adjust surrounding words of some of updated references.
      
      Note:
        The automarkup.py script interprets references via "*.txt" as if they
      were via "*.rst", so the *.txt -> *.rst changes should be regarded as
      cleanups rather than bug fixes.
      
      Cc: rcu@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Tested-by: default avatarBagas Sanjaya <bagasdotme@gmail.com>
      Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      Signed-off-by: default avatarAkira Yokosawa <akiyks@gmail.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      404147fa
    • Paul E. McKenney's avatar
      docs: Add documentation for rude and trace RCU flavors · 6172de3c
      Paul E. McKenney authored
      This commit belatedly adds documentation of Tasks Rude RCU and Tasks
      Trace RCU to RCU's requirements document.
      Tested-by: default avatarBagas Sanjaya <bagasdotme@gmail.com>
      Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      6172de3c
  3. 12 Apr, 2022 7 commits