[PATCH v7 clocksource 5/5] clocksource: Do pairwise clock-desynchronization checking

2021-04-02 Thread paulmck
From: "Paul E. McKenney" Although smp_call_function() has the advantage of simplicity, using it to check for cross-CPU clock desynchronization means that any CPU being slow reduces the sensitivity of the checking across all CPUs. And it is not uncommon for smp_call_function() latencies to be in

[PATCH v7 clocksource 4/5] clocksource: Provide a module parameter to fuzz per-CPU clock checking

2021-04-02 Thread paulmck
determine whether to add or to subtract. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Apply Randy Dunlap feedback. ] Signed-off-by: Paul E. McKenney --- Documentation/admin-gu

[PATCH v7 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-02 Thread paulmck
et Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Add "static" to clocksource_verify_one_cpu() per kernel test robot feedback. ] Signed-off-by: Paul E. McKenney --- arch/x86/kernel/kvmclock.c | 2 +- arch/x86/kernel/tsc.c | 3 +- in

[PATCH v7 clocksource 2/5] clocksource: Retry clock read if long delays detected

2021-04-02 Thread paulmck
le marking will be apparent. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Per-clocksource retries per Neeraj Upadhyay feedback. ] [ paulmck: Don't reset injectfail per Neera

[PATCH v7 clocksource 1/5] clocksource: Provide module parameters to inject delays in watchdog

2021-04-02 Thread paulmck
_delay_run is the value one, that is single-call runs. This facility is intended for diagnostic use only, and should be avoided on production systems. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen [ paulmck: Apply Ri

[PATCH v6 clocksource] Do not mark clocks unstable dueclocksource: Do pairwise clock-desynchronization checking

2021-04-02 Thread paulmck
From: "Paul E. McKenney" Although smp_call_function() has the advantage of simplicity, using it to check for cross-CPU clock desynchronization means that any CPU being slow reduces the sensitivity of the checking across all CPUs. And it is not uncommon for smp_call_function() latencies to be in

[PATCH v6 clocksource] Do not mark clocks unstable dueclocksource: Provide a module parameter to fuzz per-CPU clock checking

2021-04-02 Thread paulmck
determine whether to add or to subtract. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Apply Randy Dunlap feedback. ] Signed-off-by: Paul E. McKenney --- Documentation/admin-gu

[PATCH v6 clocksource] Do not mark clocks unstable dueclocksource: Check per-CPU clock synchronization when marked unstable

2021-04-02 Thread paulmck
et Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Add "static" to clocksource_verify_one_cpu() per kernel test robot feedback. ] Signed-off-by: Paul E. McKenney --- arch/x86/kernel/kvmclock.c | 2 +- arch/x86/kernel/tsc.c | 3 +- in

[PATCH v6 clocksource] Do not mark clocks unstable dueclocksource: Provide module parameters to inject delays in watchdog

2021-04-02 Thread paulmck
_delay_run is the value one, that is single-call runs. This facility is intended for diagnostic use only, and should be avoided on production systems. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen [ paulmck: Apply Ri

[PATCH v6 clocksource] Do not mark clocks unstable dueclocksource: Retry clock read if long delays detected

2021-04-02 Thread paulmck
le marking will be apparent. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Per-clocksource retries per Neeraj Upadhyay feedback. ] [ paulmck: Don't reset injectfail per Neera

[PATCH kernel/time 5/5] clocksource: Do pairwise clock-desynchronization checking

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Although smp_call_function() has the advantage of simplicity, using it to check for cross-CPU clock desynchronization means that any CPU being slow reduces the sensitivity of the checking across all CPUs. And it is not uncommon for smp_call_function() latencies to be in

[PATCH kernel/time 1/5] clocksource: Provide module parameters to inject delays in watchdog

2021-03-03 Thread paulmck
_delay_run is the value one, that is single-call runs. This facility is intended for diagnostic use only, and should be avoided on production systems. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen [ paulmck: Apply Ri

[PATCH kernel/time 4/5] clocksource: Provide a module parameter to fuzz per-CPU clock checking

2021-03-03 Thread paulmck
determine whether to add or to subtract. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Apply Randy Dunlap feedback. ] Signed-off-by: Paul E. McKenney --- Documentation/admin-gu

[PATCH kernel/time 2/5] clocksource: Retry clock read if long delays detected

2021-03-03 Thread paulmck
le marking will be apparent. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Per-clocksource retries per Neeraj Upadhyay feedback. ] [ paulmck: Don't reset injectfail per Neera

[PATCH kernel/time 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-03-03 Thread paulmck
et Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Add "static" to clocksource_verify_one_cpu() per kernel test robot feedback. ] Signed-off-by: Paul E. McKenney --- arch/x86/kernel/kvmclock.c | 2 +- arch/x86/kernel/tsc.c | 3 +- in

[PATCH memory-model 3/3] tools/memory-model: Add access-marking documentation

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit adapts the "Concurrency bugs should fear the big bad data-race detector (part 2)" LWN article (https://lwn.net/Articles/816854/) to kernel-documentation form. This allows more easily updating the material as needed. Suggested-by: Thomas

[PATCH memory-model 2/3] tools/memory-model: Remove reference to atomic_ops.rst

2021-03-03 Thread paulmck
From: Akira Yokosawa atomic_ops.rst was removed by commit f0400a77ebdc ("atomic: Delete obsolete documentation"). Remove the broken link in tools/memory-model/Documentation/simple.txt. Cc: Peter Zijlstra Signed-off-by: Akira Yokosawa Signed-off-by: Paul E. McKenney ---

[PATCH memory-model 1/3] doc: Update rcu_dereference.rst reference

2021-03-03 Thread paulmck
From: Mauro Carvalho Chehab Changeset b00aedf978aa ("doc: Convert to rcu_dereference.txt to rcu_dereference.rst") renamed: Documentation/RCU/rcu_dereference.txt to: Documentation/RCU/rcu_dereference.rst. Update its cross-reference accordingly. Signed-off-by: Mauro Carvalho Chehab

[PATCH kcsan 4/4] kcsan: Add missing license and copyright headers

2021-03-03 Thread paulmck
From: Marco Elver Adds missing license and/or copyright headers for KCSAN source files. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney --- Documentation/dev-tools/kcsan.rst | 3 +++ include/linux/kcsan-checks.h | 6 ++ include/linux/kcsan.h | 7 +++

[PATCH kcsan 3/4] kcsan: Switch to KUNIT_CASE_PARAM for parameterized tests

2021-03-03 Thread paulmck
From: Marco Elver Since KUnit now support parameterized tests via KUNIT_CASE_PARAM, update KCSAN's test to switch to it for parameterized tests. This simplifies parameterized tests and gets rid of the "parameters in case name" workaround (hack). At the same time, we can increase the maximum

[PATCH kcsan 1/4] kcsan, debugfs: Move debugfs file creation out of early init

2021-03-03 Thread paulmck
From: Marco Elver Commit 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized") forbids creating new debugfs files until debugfs is fully initialized. This means that KCSAN's debugfs file creation, which happened at the end of __init(), no longer

[PATCH kcsan 2/4] kcsan: Make test follow KUnit style recommendations

2021-03-03 Thread paulmck
From: Marco Elver Per recently added KUnit style recommendations at Documentation/dev-tools/kunit/style.rst, make the following changes to the KCSAN test: 1. Rename 'kcsan-test.c' to 'kcsan_test.c'. 2. Rename suite name 'kcsan-test' to 'kcsan'. 3. Rename

[PATCH tip/core/rcu 23/28] torture: Add --duration argument to kvm-again.sh

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit adds a --duration argument to kvm-again.sh to allow the user to override the --duration specified for the original kvm.sh run. Signed-off-by: Paul E. McKenney --- .../testing/selftests/rcutorture/bin/kvm-again.sh | 25 ++-

[PATCH tip/core/rcu 28/28] torture: Fix kvm.sh --datestamp regex check

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Some versions of grep are happy to interpret a nonsensically placed "-" within a "[]" pattern as a dash, while others give an error message. This commit therefore places the "-" at the end of the expression where it was supposed to be in the first place. Signed-off-by:

[PATCH tip/core/rcu 25/28] torture: Make TORTURE_TRUST_MAKE available in kvm-again.sh environment

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Because the TORTURE_TRUST_MAKE environment variable is not recorded, kvm-again.sh runs can result in the parse-build.sh script emitting false-positive "BUG: TREE03 no build" messages. These messages are intended to complain about any lack of compiler invocations when

[PATCH tip/core/rcu 21/28] torture: Create a "batches" file for build reuse

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit creates a "batches" file in the res/$ds directory, where $ds is the datestamp. This file contains the batches and the number of CPUs, for example: 1 TREE03 16 1 SRCU-P 8 2 TREE07 16 2 TREE01 8 3 TREE02 8 3 TREE04 8 3 TREE05 8 4 SRCU-N 4 4 TRACE01 4 4

[PATCH tip/core/rcu 19/28] torture: Make upper-case-only no-dot no-slash scenario names official

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit enforces the defacto restriction on scenario names, which is that they contain neither "/", ".", nor lowercase alphabetic characters. This restriction avoids collisions between scenario names and the torture scripting's files and directories. Signed-off-by:

[PATCH tip/core/rcu 17/28] torture: Remove no-mpstat error message

2021-03-03 Thread paulmck
From: "Paul E. McKenney" The cpus2use.sh script complains if the mpstat command is not available, and instead uses all available CPUs. Unfortunately, this complaint goes to stdout, where it confuses invokers who expect a single number. This commit removes this error message in order to avoid

[PATCH tip/core/rcu 15/28] torture: Record jitter start/stop commands

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Distributed runs of rcutorture will need to start and stop jittering on the remote hosts, which means that the commands must be communicated to those hosts. The commit therefore causes kvm.sh to place these commands in new TORTURE_JITTER_START and TORTURE_JITTER_STOP

[PATCH tip/core/rcu 26/28] torture: Print proper vmlinux path for kvm-again.sh runs

2021-03-03 Thread paulmck
From: "Paul E. McKenney" The kvm-again.sh script does not copy over the vmlinux files due to their large size. This means that a gdb run must use the vmlinux file from the original "res" directory. This commit therefore finds that directory and prints it out so that the user can copy and

[PATCH tip/core/rcu 24/28] torture: Make kvm-transform.sh update jitter commands

2021-03-03 Thread paulmck
From: "Paul E. McKenney" When rerunning an old run using kvm-again.sh, the jitter commands will re-use the original "res" directory. This works, but is clearly an accident waiting to happen. And this accident will happen with remote runs, where the original directory lives on some other

[PATCH tip/core/rcu 27/28] torture: Consolidate qemu-cmd duration editing into kvm-transform.sh

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Currently, kvm-again.sh updates the duration in the "seconds=" comment in the qemu-cmd file, but kvm-transform.sh updates the duration in the actual qemu command arguments. This is an accident waiting to happen. This commit therefore consolidates these updates into

[PATCH tip/core/rcu 22/28] torture: Add kvm-again.sh to rerun a previous torture-test

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit adds a kvm-again.sh script that, given the results directory of a torture-test run, re-runs that test. This means that the kernels need not be rebuilt, but it also is a step towards running torture tests on remote systems. This commit also adds a

[PATCH tip/core/rcu 18/28] torture: Rename SRCU-t and SRCU-u to avoid lowercase characters

2021-03-03 Thread paulmck
From: "Paul E. McKenney" The convention that scenario names are all uppercase has two exceptions, SRCU-t and SRCU-u. This commit therefore renames them to SRCU-T and SRCU-U, respectively, to bring them in line with this convention. This in turn permits tighter argument checking in the

[PATCH tip/core/rcu 20/28] torture: De-capitalize TORTURE_SUITE

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Although it might be unlikely that someone would name a scenario "TORTURE_SUITE", they are within their rights to do so. This script therefore renames the "TORTURE_SUITE" file in the top-level date-stamped directory within "res" to "torture_suite" to avoid this name

[PATCH tip/core/rcu 12/28] torture: Abstract jitter.sh start/stop into scripts

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit creates jitterstart.sh and jitterstop.sh scripts that handle the starting and stopping of the jitter.sh scripts. These must be sourced using the bash "." command to allow the generated script to wait on the backgrounded jitter.sh scripts. Signed-off-by:

[PATCH tip/core/rcu 10/28] torture: Eliminate jitter_pids file

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Now that there is a reliable way to convince the jitter.sh scripts to stop, the jitter_pids file is not needed, nor is the code that kills all the PIDs contained in this file. This commit therefore eliminates this file and the code using it. Signed-off-by: Paul E.

[PATCH tip/core/rcu 08/28] torture: Use file-based protocol to mark batch's runs complete

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Currently, the script generated by kvm.sh does a "wait" to wait on both the current batch's guest OSes and any jitter.sh scripts. This works, but makes it hard to abstract the jittering so that common code can be used for both local and distributed runs. This commit

[PATCH tip/core/rcu 13/28] torture: Record TORTURE_KCONFIG_GDB_ARG in qemu-cmd

2021-03-03 Thread paulmck
From: "Paul E. McKenney" When re-running old rcutorture builds, if the original run involved gdb, the re-run also needs to do so. This commit therefore records the TORTURE_KCONFIG_GDB_ARG environment variable into the qemu-cmd file so that the re-run can access it. Signed-off-by: Paul E.

[PATCH tip/core/rcu 09/28] torture: Use "jittering" file to control jitter.sh execution

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Currently, jitter.sh execution is controlled by a time limit and by the "kill" command. The former allowed jitter.sh to run uselessly past the end of a set of runs that panicked during boot, and the latter is vulnerable to PID reuse. This commit therefore introduces a

[PATCH tip/core/rcu 11/28] torture: Reverse jittering and duration parameters for jitter.sh

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Remote rcutorture testing requires that jitter.sh continue to be invoked from the generated script for local runs, but that it instead be invoked on the remote system for distributed runs. This argues for common jitterstart and jitterstop scripts. But it would be good

[PATCH tip/core/rcu 06/28] refscale: Disable verbose torture-test output

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Given large numbers of threads, the quantity of torture-test output is sufficient to sometimes result in RCU CPU stall warnings. The probability of these stall warnings was greatly reduced by batching the output, but the warnings were not eliminated. However, the

[PATCH tip/core/rcu 07/28] torture: Move build/run synchronization files into scenario directories

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Currently the bN.ready and bN.wait files are placed in the rcutorture directory, which really is not at all a good place for run-specific files. This commit therefore renames these files to build.ready and build.wait and then moves them into the scenario directories

[PATCH tip/core/rcu 04/28] torture: Improve readability of the testid.txt file

2021-03-03 Thread paulmck
From: "Paul E. McKenney" The testid.txt file was intended for occasional in extremis use, but now that the new "bare-metal" file references it, it might see more use. This commit therefore labels sections of output and adds spacing to make it easier to see what needs to be done to make a

[PATCH tip/core/rcu 16/28] torture: Record kvm-test-1-run.sh and kvm-test-1-run-qemu.sh PIDs

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit records the process IDs of the kvm-test-1-run.sh and kvm-test-1-run-qemu.sh scripts to ease monitoring of remotely running instances of these scripts. Signed-off-by: Paul E. McKenney --- tools/testing/selftests/rcutorture/bin/kvm-test-1-run-qemu.sh | 2 ++

[PATCH tip/core/rcu 14/28] torture: Extract kvm-test-1-run-qemu.sh from kvm-test-1-run.sh

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Currently, kvm-test-1-run.sh both builds and runs an rcutorture kernel, which is inconvenient when it is necessary to re-run an old run or to carry out a run on a remote system. This commit therefore extracts the portion of kvm-test-1-run.sh that invoke qemu to actually

[PATCH tip/core/rcu 05/28] rcuscale: Disable verbose torture-test output

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Given large numbers of threads, the quantity of torture-test output is sufficient to sometimes result in RCU CPU stall warnings. The probability of these stall warnings was greatly reduced by batching the output, but the warnings were not eliminated. However, the

[PATCH tip/core/rcu 02/28] torture: Allow 1G of memory for torture.sh kvfree testing

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Yes, I do recall a time when 512MB of memory was a lot of mass storage, much less main memory, but the rcuscale kvfree_rcu() testing invoked by torture.sh can sometimes exceed it on large systems, resulting in OOM. This commit therefore causes torture.sh to pase the

[PATCH tip/core/rcu 01/28] torturescript: Don't rerun failed rcutorture builds

2021-03-03 Thread paulmck
From: "Paul E. McKenney" If the build fails when running multiple instances of a given rcutorture scenario, for example, using the kvm.sh --configs "8*RUDE01" argument, the build will be rerun an additional seven times. This is in some sense correct, but it can waste significant time. This

[PATCH tip/core/rcu 03/28] torture: Provide bare-metal modprobe-based advice

2021-03-03 Thread paulmck
From: "Paul E. McKenney" In some environments, the torture-testing use of virtualization is inconvenient. In such cases, the modprobe and rmmod commands may be used to do torture testing, but significant setup is required to build, boot, and modprobe a kernel so as to match a given torture-test

[PATCH tip/core/rcu 2/2] rcutorture: Replace rcu_torture_stall string with %s

2021-03-03 Thread paulmck
From: Stephen Zhang This commit replaces a hard-coded "rcu_torture_stall" string in a pr_alert() format with "%s" and __func__. Signed-off-by: Stephen Zhang Signed-off-by: Paul E. McKenney --- kernel/rcu/rcutorture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH tip/core/rcu 1/2] torture: Replace torture_init_begin string with %s

2021-03-03 Thread paulmck
From: Stephen Zhang This commit replaces a hard-coded "torture_init_begin" string in a pr_alert() format with "%s" and __func__. Signed-off-by: Stephen Zhang Signed-off-by: Paul E. McKenney --- kernel/torture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH tip/core/rcu 1/2] rcu-tasks: Rectify kernel-doc for struct rcu_tasks

2021-03-03 Thread paulmck
From: Lukas Bulwahn The command 'find ./kernel/rcu/ | xargs ./scripts/kernel-doc -none' reported an issue with the kernel-doc of struct rcu_tasks. This commit rectifies the kernel-doc, such that no issues remain for ./kernel/rcu/. Signed-off-by: Lukas Bulwahn Signed-off-by: Paul E. McKenney

[PATCH tip/core/rcu 2/2] rcu-tasks: Add block comment laying out RCU Tasks Trace design

2021-03-03 Thread paulmck
y: Mathieu Desnoyers [ paulmck: Fix commit log per Mathieu Desnoyers feedback. ] Signed-off-by: Paul E. McKenney --- kernel/rcu/tasks.h | 36 1 file changed, 36 insertions(+) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 17c8ebe..f818

[PATCH tip/core/rcu 5/5] torture: Make jitter.sh handle large systems

2021-03-03 Thread paulmck
From: "Paul E. McKenney" The current jitter.sh script expects cpumask bits to fit into whatever the awk interpreter uses for an integer, which clearly does not hold for even medium-sized systems these days. This means that on a large system, only the first 32 or 64 CPUs (depending) are

[PATCH tip/core/rcu 2/5] rcutorture: Make TREE03 use real-time tree.use_softirq setting

2021-03-03 Thread paulmck
From: "Paul E. McKenney" TREE03 tests RCU priority boosting, which is a real-time feature. It would also be good if it tested something closer to what is actually used by the real-time folks. This commit therefore adds tree.use_softirq=0 to the TREE03 kernel boot parameters in TREE03.boot.

[PATCH tip/core/rcu 3/5] rcutorture: Fix testing of RCU priority boosting

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Currently, rcutorture refuses to test RCU priority boosting in CONFIG_HOTPLUG_CPU=y kernels, which are the only kind normally built on x86 these days. This commit therefore updates rcutorture's tests of RCU priority boosting to make them safe for CPU hotplug. However,

[PATCH tip/core/rcu 4/5] rcu: Make rcu_read_unlock_special() expedite strict grace periods

2021-03-03 Thread paulmck
From: "Paul E. McKenney" In kernels built with CONFIG_RCU_STRICT_GRACE_PERIOD=y, every grace period is an expedited grace period. However, rcu_read_unlock_special() does not treat them that way, instead allowing the deferred quiescent state to be reported whenever. This commit therefore adds a

[PATCH tip/core/rcu 1/5] rcu: Expedite deboost in case of deferred quiescent state

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Historically, a task that has been subjected to RCU priority boosting is deboosted at rcu_read_unlock() time. However, with the advent of deferred quiescent states, if the outermost rcu_read_unlock() was invoked with either bottom halves, interrupts, or preemption

[PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-03 Thread paulmck
From: "Paul E. McKenney" There is a need for a non-blocking polling interface for RCU grace periods, so this commit supplies start_poll_synchronize_rcu() and poll_state_synchronize_rcu() for this purpose. Note that the existing get_state_synchronize_rcu() may be used if future grace periods are

[PATCH tip/core/rcu 3/3] rcutorture: Test start_poll_synchronize_rcu() and poll_state_synchronize_rcu()

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit causes rcutorture to test the new start_poll_synchronize_rcu() and poll_state_synchronize_rcu() functions. Because of the difficulty of determining the nature of a synchronous RCU grace (expedited or not), the test that insisted that

[PATCH tip/core/rcu 2/3] rcu: Provide polling interfaces for Tiny RCU grace periods

2021-03-03 Thread paulmck
From: "Paul E. McKenney" There is a need for a non-blocking polling interface for RCU grace periods, so this commit supplies start_poll_synchronize_rcu() and poll_state_synchronize_rcu() for this purpose. Note that the existing get_state_synchronize_rcu() may be used if future grace periods are

[PATCH tip/core/rcu 12/12] rcu/nocb: Move trace_rcu_nocb_wake() calls outside nocb_lock when possible

2021-03-03 Thread paulmck
From: Frederic Weisbecker Those tracing calls don't need to be under ->nocb_lock. This commit therefore moves them outside of that lock. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng Signed-off-by: Paul E.

[PATCH tip/core/rcu 08/12] rcu: Make nocb_nobypass_lim_per_jiffy static

2021-03-03 Thread paulmck
From: Jiapeng Chong RCU triggerse the following sparse warning: kernel/rcu/tree_plugin.h:1497:5: warning: symbol 'nocb_nobypass_lim_per_jiffy' was not declared. Should it be static? This commit therefore makes this variable static. Reported-by: Abaci Robot Frederic Weisbecker Signed-off-by:

[PATCH tip/core/rcu 09/12] rcu/nocb: Fix missed nocb_timer requeue

2021-03-03 Thread paulmck
From: Frederic Weisbecker This sequence of events can lead to a failure to requeue a CPU's ->nocb_timer: 1. There are no callbacks queued for any CPU covered by CPU 0-2's ->nocb_gp_kthread. Note that ->nocb_gp_kthread is associated with CPU 0. 2. CPU 1 enqueues its

[PATCH tip/core/rcu 11/12] rcu/nocb: Remove stale comment above rcu_segcblist_offload()

2021-03-03 Thread paulmck
From: Frederic Weisbecker This commit removes a stale comment claiming that the cblist must be empty before changing the offloading state. This claim was correct back when the offloaded state was defined exclusively at boot. Reported-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker

[PATCH tip/core/rcu 07/12] rcu/nocb: Rename nocb_gp_update_state to nocb_gp_update_state_deoffloading

2021-03-03 Thread paulmck
From: Frederic Weisbecker The name nocb_gp_update_state() is unenlightening, so this commit changes it to nocb_gp_update_state_deoffloading(). This function now does what its name says, updates state and returns true if the CPU corresponding to the specified rcu_data structure is in the process

[PATCH tip/core/rcu 10/12] rcu/nocb: Disable bypass when CPU isn't completely offloaded

2021-03-03 Thread paulmck
From: Frederic Weisbecker Currently, the bypass is flushed at the very last moment in the deoffloading procedure. However, this approach leads to a larger state space than would be preferred. This commit therefore disables the bypass at soon as the deoffloading procedure begins, then flushes

[PATCH tip/core/rcu 06/12] rcu/nocb: Only (re-)initialize segcblist when needed on CPU up

2021-03-03 Thread paulmck
From: Frederic Weisbecker At the start of a CPU-hotplug operation, the incoming CPU's callback list can be in a number of states: 1. Disabled and empty. This is the case when the boot CPU has not invoked call_rcu(), when a non-boot CPU first comes online, and when a

[PATCH tip/core/rcu 05/12] rcu/nocb: Avoid confusing double write of rdp->nocb_cb_sleep

2021-03-03 Thread paulmck
From: Frederic Weisbecker The nocb_cb_wait() function first sets the rdp->nocb_cb_sleep flag to true by after invoking the callbacks, and then sets it back to false if it finds more callbacks that are ready to invoke. This is confusing and will become unsafe if this flag is ever read

[PATCH tip/core/rcu 04/12] rcu/nocb: Forbid NOCB toggling on offline CPUs

2021-03-03 Thread paulmck
From: Frederic Weisbecker It makes no sense to de-offload an offline CPU because that CPU will never invoke any remaining callbacks. It also makes little sense to offload an offline CPU because any pending RCU callbacks were migrated when that CPU went offline. Yes, it is in theory possible to

[PATCH tip/core/rcu 01/12] rcu/nocb: Detect unsafe checks for offloaded rdp

2021-03-03 Thread paulmck
From: Frederic Weisbecker Provide CONFIG_PROVE_RCU sanity checks to ensure we are always reading the offloaded state of an rdp in a safe and stable way and prevent from its value to be changed under us. We must either hold the barrier mutex, the cpu-hotplug lock (read or write) or the nocb lock.

[PATCH tip/core/rcu 03/12] rcu/nocb: Comment the reason behind BH disablement on batch processing

2021-03-03 Thread paulmck
From: Frederic Weisbecker This commit explains why softirqs need to be disabled while invoking callbacks, even when callback processing has been offloaded. After all, invoking callbacks concurrently is one thing, but concurrently invoking the same callback is quite another. Reported-by: Boqun

[PATCH tip/core/rcu 02/12] timer: Report ignored local enqueue in nohz mode

2021-03-03 Thread paulmck
From: Frederic Weisbecker Enqueuing a local timer after the tick has been stopped will result in the timer being ignored until the next random interrupt. Perform sanity checks to report these situations. Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Rafael J. Wysocki

[PATCH lib/bitmap 5/9] lib: bitmap: move ERANGE check from set_region to check_region

2021-03-03 Thread paulmck
From: Paul Gortmaker It makes sense to do all the checks in check_region() and not 1/2 in check_region and 1/2 in set_region. Since set_region is called immediately after check_region, the net effect on runtime is zero, but it gets rid of an if (...) return... Cc: Yury Norov Cc: Rasmus

[PATCH lib/bitmap 4/9] lib: bitmap: fold nbits into region struct

2021-03-03 Thread paulmck
From: Paul Gortmaker This will reduce parameter passing and enable using nbits as part of future dynamic region parameter parsing. Cc: Yury Norov Cc: Rasmus Villemoes Cc: Andy Shevchenko Suggested-by: Yury Norov Acked-by: Yury Norov Reviewed-by: Andy Shevchenko Signed-off-by: Paul

[PATCH lib/bitmap 2/9] lib: test_bitmap: add tests to trigger ERANGE case.

2021-03-03 Thread paulmck
From: Paul Gortmaker Add tests that specify a valid range, but one that is outside the width of the bitmap for which it is to be applied to. These should trigger an -ERANGE response from the code. Cc: Yury Norov Cc: Rasmus Villemoes Cc: Andy Shevchenko Acked-by: Yury Norov Reviewed-by:

[PATCH lib/bitmap 1/9] lib: test_bitmap: clearly separate ERANGE from EINVAL tests.

2021-03-03 Thread paulmck
From: Paul Gortmaker This block of tests was meant to find/flag incorrect use of the ":" and "/" separators (syntax errors) and invalid (zero) group len. However they were specified with an 8 bit width and 32 bit operations, so they really contained two errors (EINVAL and ERANGE). Promote them

[PATCH lib/bitmap 7/9] lib: test_bitmap: add tests for "N" alias

2021-03-03 Thread paulmck
From: Paul Gortmaker These are copies of existing tests, with just 31 --> N. This ensures the recently added "N" alias transparently works in any normally numeric fields of a region specification. Cc: Yury Norov Cc: Rasmus Villemoes Cc: Andy Shevchenko Acked-by: Yury Norov Signed-off-by:

[PATCH lib/bitmap 9/9] rcutorture: Use "all" and "N" in "nohz_full" and "rcu_nocbs"

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit uses the shiny new "all" and "N" cpumask options to decouple the "nohz_full" and "rcu_nocbs" kernel boot parameters in the TREE04.boot and TREE08.boot files from the CONFIG_NR_CPUS options in the TREE04 and TREE08 files. Reported-by: Paul Gortmaker

[PATCH lib/bitmap 8/9] rcu: deprecate "all" option to rcu_nocbs=

2021-03-03 Thread paulmck
From: Paul Gortmaker With the core bitmap support now accepting "N" as a placeholder for the end of the bitmap, "all" can be represented as "0-N" and has the advantage of not being specific to RCU (or any other subsystem). So deprecate the use of "all" by removing documentation references to

[PATCH lib/bitmap 6/9] lib: bitmap: support "N" as an alias for size of bitmap

2021-03-03 Thread paulmck
From: Paul Gortmaker While this is done for all bitmaps, the original use case in mind was for CPU masks and cpulist_parse() as described below. It seems that a common configuration is to use the 1st couple cores for housekeeping tasks. This tends to leave the remaining ones to form a pool of

[PATCH lib/bitmap 3/9] lib: test_bitmap: add more start-end:offset/len tests

2021-03-03 Thread paulmck
From: Paul Gortmaker There are inputs to bitmap_parselist() that would probably never be entered manually by a person, but might result from some kind of automated input generator. Things like ranges of length 1, or group lengths longer than nbits, overlaps, or offsets of zero. Adding these

[PATCH tip/core/rcu 1/6] kvfree_rcu: Directly allocate page for single-argument case

2021-03-03 Thread paulmck
u(), given that the double-argument variant cannot directly invoke the allocator. [ paulmck: Add add_ptr_to_bulk_krc_lock header comment per Michal Hocko. ] Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.c | 42 ++--

[PATCH tip/core/rcu 3/6] kvfree_rcu: Make krc_this_cpu_unlock() use raw_spin_unlock_irqrestore()

2021-03-03 Thread paulmck
From: "Paul E. McKenney" The krc_this_cpu_unlock() function does a raw_spin_unlock() immediately followed by a local_irq_restore(). This commit saves a line of code by merging them into a raw_spin_unlock_irqrestore(). This transformation also reduces scheduling latency because

[PATCH tip/core/rcu 5/6] kvfree_rcu: Use same set of GFP flags as does single-argument

2021-03-03 Thread paulmck
From: "Uladzislau Rezki (Sony)" Running an rcuscale stress-suite can lead to "Out of memory" of a system. This can happen under high memory pressure with a small amount of physical memory. For example, a KVM test configuration with 64 CPUs and 512 megabytes can result in OOM when running

[PATCH tip/core/rcu 4/6] kvfree_rcu: Replace __GFP_RETRY_MAYFAIL by __GFP_NORETRY

2021-03-03 Thread paulmck
From: "Uladzislau Rezki (Sony)" __GFP_RETRY_MAYFAIL can spend quite a bit of time reclaiming, and this can be wasted effort given that there is a fallback code path in case memory allocation fails. __GFP_NORETRY does perform some light-weight reclaim, but it will fail under OOM conditions,

[PATCH tip/core/rcu 6/6] rcuscale: Add kfree_rcu() single-argument scale test

2021-03-03 Thread paulmck
From: "Uladzislau Rezki (Sony)" The single-argument variant of kfree_rcu() is currently not tested by any member of the rcutoture test suite. This commit therefore adds rcuscale code to test it. This testing is controlled by two new boolean module parameters, kfree_rcu_test_single and

[PATCH tip/core/rcu 2/6] kvfree_rcu: Use __GFP_NOMEMALLOC for single-argument kvfree_rcu()

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit applies the __GFP_NOMEMALLOC gfp flag to memory allocations carried out by the single-argument variant of kvfree_rcu(), thus avoiding this can-sleep code path from dipping into the emergency reserves. Acked-by: Michal Hocko Suggested-by: Michal Hocko

[PATCH tip/core/rcu 06/10] softirq: Don't try waking ksoftirqd before it has been spawned

2021-03-03 Thread paulmck
au Rezki Cc: Peter Zijlstra Cc: Thomas Gleixner [ paulmck: Remove unneeded check per Sebastian Siewior feedback. ] Signed-off-by: Paul E. McKenney --- kernel/softirq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 9908ec4a..bad14ca 10

[PATCH tip/core/rcu 08/10] docs: Correctly spell Stephen Hemminger's name

2021-03-03 Thread paulmck
From: "Paul E. McKenney" This commit replaces "Steve" with the his real name, which is "Stephen". Reported-by: Stephen Hemminger Signed-off-by: Paul E. McKenney --- Documentation/RCU/RTFP.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RCU/RTFP.txt

[PATCH tip/core/rcu 10/10] rcu/tree: Add a trace event for RCU CPU stall warnings

2021-03-03 Thread paulmck
From: Sangmoon Kim This commit adds a trace event which allows tracing the beginnings of RCU CPU stall warnings on systems where sysctl_panic_on_rcu_stall is disabled. The first parameter is the name of RCU flavor like other trace events. The second parameter indicates whether this is a stall

[PATCH tip/core/rcu 07/10] rcu: Prevent dyntick-idle until ksoftirqd has been spawned

2021-03-03 Thread paulmck
From: "Paul E. McKenney" After interrupts have enabled at boot but before some random point in early_initcall() processing, softirq processing is unreliable. If softirq sees a need to push softirq-handler invocation to ksoftirqd during this time, then those handlers can be delayed until the

[PATCH tip/core/rcu 09/10] rcu: Add explicit barrier() to __rcu_read_unlock()

2021-03-03 Thread paulmck
From: "Paul E. McKenney" Because preemptible RCU's __rcu_read_unlock() is an external function, the rough equivalent of an implicit barrier() is inserted by the compiler. Except that there is a direct call to __rcu_read_unlock() in that same file, and compilers are getting to the point where

[PATCH tip/core/rcu 05/10] rcu: Fix kfree_rcu() docbook errors

2021-03-03 Thread paulmck
From: Mauro Carvalho Chehab After commit 5130b8fd0690 ("rcu: Introduce kfree_rcu() single-argument macro"), kernel-doc now emits two warnings: ./include/linux/rcupdate.h:884: warning: Excess function parameter 'ptr' description in 'kfree_rcu' ./include/linux/rcupdate.h:884:

[PATCH tip/core/rcu 02/10] rcu: Fix CPU-offline trace in rcutree_dying_cpu

2021-03-03 Thread paulmck
From: Neeraj Upadhyay The condition in the trace_rcu_grace_period() in rcutree_dying_cpu() is backwards, so that it uses the string "cpuofl" when the offline CPU is blocking the current grace period and "cpuofl-bgp" otherwise. Given that the "-bgp" stands for "blocking grace period", this is at

[PATCH tip/core/rcu 03/10] rcu: Remove spurious instrumentation_end() in rcu_nmi_enter()

2021-03-03 Thread paulmck
From: Zhouyi Zhou In rcu_nmi_enter(), there is an erroneous instrumentation_end() in the second branch of the "if" statement. Oddly enough, "objtool check -f vmlinux.o" fails to complain because it is unable to correctly cover all cases. Instead, objtool visits the third branch first, which

[PATCH tip/core/rcu 01/10] rcu: Remove superfluous rdp fetch

2021-03-03 Thread paulmck
From: Frederic Weisbecker Cc: Rafael J. Wysocki Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index

[PATCH tip/core/rcu 04/10] rculist: Replace reference to atomic_ops.rst

2021-03-03 Thread paulmck
From: Akira Yokosawa The hlist_nulls_for_each_entry_rcu() docbook header references the atomic_ops.rst file, which was removed in commit f0400a77ebdc ("atomic: Delete obsolete documentation"). This commit therefore substitutes a section in memory-barriers.txt discussing the use of barrier() in

[PATCH clocksource 4/5] clocksource: Provide a module parameter to fuzz per-CPU clock checking

2021-02-17 Thread paulmck
determine whether to add or to subtract. Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Cc: Jonathan Corbet Cc: Mark Rutland Cc: Marc Zyngier Cc: Andi Kleen Reported-by: Chris Mason [ paulmck: Apply Randy Dunlap feedback. ] Signed-off-by: Paul E. McKenney --- Documentation/admin-gu

  1   2   3   4   5   6   7   8   >