Skip to contentSkip to conversation

Torture-test updates for v5.2

PATCH New Paul E. McKenney 1 participant 10 messages Mar 26, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Torture-test updates for v5.2

Hello!

This series contains torture-test updates:

1. Don't try to offline the last CPU.

2. Convert rcutorture scripting to SPDX license identifier.

3. Make rcutorture_extend_mask() comment match the code.

4. Remove ->ext_irq_conflict field.

5. Fix expected forward progress duration in OOM notifier, courtesy
of Neeraj Upadhyay.

6. Fix cleanup path for invalid torture_type strings.

7. Fix cleanup path for invalid perf_type strings.

8. NULL cxt.lwsa and cxt.lrsa to allow locktorture bad-arg detection.

9. Suppress false-positive CONFIG_INITRAMFS_SOURCE complaint.

Thanx, Paul

------------------------------------------------------------------------

 kernel/locking/locktorture.c                                         |    2 +
 kernel/rcu/rcuperf.c                                                 |    5 ++
 kernel/rcu/rcutorture.c                                              |   14 +++----
 kernel/torture.c                                                     |    2 +
 tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh              |   17 +-------
 tools/testing/selftests/rcutorture/bin/config_override.sh            |   17 +-------
 tools/testing/selftests/rcutorture/bin/configcheck.sh                |   19 ++--------
 tools/testing/selftests/rcutorture/bin/configinit.sh                 |   17 +-------
 tools/testing/selftests/rcutorture/bin/cpus2use.sh                   |   17 +-------
 tools/testing/selftests/rcutorture/bin/functions.sh                  |   17 +-------
 tools/testing/selftests/rcutorture/bin/jitter.sh                     |   17 +-------
 tools/testing/selftests/rcutorture/bin/kvm-build.sh                  |   17 +-------
 tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh            |    5 ++
 tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh           |   17 +-------
 tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh            |   17 +-------
 tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh |   17 +-------
 tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh        |   17 +-------
 tools/testing/selftests/rcutorture/bin/kvm-recheck.sh                |   17 +-------
 tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh             |   17 +-------
 tools/testing/selftests/rcutorture/bin/kvm.sh                        |   17 +-------
 tools/testing/selftests/rcutorture/bin/mkinitrd.sh                   |   15 -------
 tools/testing/selftests/rcutorture/bin/parse-build.sh                |   17 +-------
 tools/testing/selftests/rcutorture/bin/parse-console.sh              |   17 +-------
 tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh     |   17 +-------
 tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh      |   17 +-------
 tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh  |   17 +-------
 26 files changed, 64 insertions(+), 321 deletions(-)
#1 lore raw

PATCH 1/9 torture: Don't try to offline the last CPU

If there is only one online CPU, it doesn't make sense to try to offline it, as any such attempt is guaranteed to fail. This commit therefore check for this condition and refuses to attempt the nonsensical.

---
 kernel/torture.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/torture.c +2 -0
index 8faa1a9aaeb9..17b2be9bde12 100644
@@ -88,6 +88,8 @@ bool torture_offline(int cpu, long *n_offl_attempts, long *n_offl_successes,
 
 	if (!cpu_online(cpu) || !cpu_is_hotpluggable(cpu))
 		return false;
+	if (num_online_cpus() <= 1)
+		return false;  /* Can't offline the last CPU. */
 
 	if (verbose > 1)
 		pr_alert("%s" TORTURE_FLAG
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/9 tools/.../rcutorture: Convert to SPDX license identifier

In reply to Paul E. McKenney

Replace the license boiler plate with a SPDX license identifier. While in the area, update an email address and add copyright notices.

---
 .../selftests/rcutorture/bin/configNR_CPUS.sh  | 17 ++---------------
 .../rcutorture/bin/config_override.sh          | 17 ++---------------
 .../selftests/rcutorture/bin/configcheck.sh    | 18 +++---------------
 .../selftests/rcutorture/bin/configinit.sh     | 17 ++---------------
 .../selftests/rcutorture/bin/cpus2use.sh       | 17 ++---------------
 .../selftests/rcutorture/bin/functions.sh      | 17 ++---------------
 .../testing/selftests/rcutorture/bin/jitter.sh | 17 ++---------------
 .../selftests/rcutorture/bin/kvm-build.sh      | 17 ++---------------
 .../rcutorture/bin/kvm-find-errors.sh          |  5 +++++
 .../rcutorture/bin/kvm-recheck-lock.sh         | 17 ++---------------
 .../rcutorture/bin/kvm-recheck-rcu.sh          | 17 ++---------------
 .../bin/kvm-recheck-rcuperf-ftrace.sh          | 17 ++---------------
 .../rcutorture/bin/kvm-recheck-rcuperf.sh      | 17 ++---------------
 .../selftests/rcutorture/bin/kvm-recheck.sh    | 17 ++---------------
 .../selftests/rcutorture/bin/kvm-test-1-run.sh | 17 ++---------------
 tools/testing/selftests/rcutorture/bin/kvm.sh  | 17 ++---------------
 .../selftests/rcutorture/bin/mkinitrd.sh       | 15 +--------------
 .../selftests/rcutorture/bin/parse-build.sh    | 17 ++---------------
 .../selftests/rcutorture/bin/parse-console.sh  | 17 ++---------------
 .../rcutorture/configs/lock/ver_functions.sh   | 17 ++---------------
 .../rcutorture/configs/rcu/ver_functions.sh    | 17 ++---------------
 .../configs/rcuperf/ver_functions.sh           | 17 ++---------------
 22 files changed, 47 insertions(+), 314 deletions(-)
tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh +2 -15
index 43540f1828cc..2deea2169fc2 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Extract the number of CPUs expected from the specified Kconfig-file
 # fragment by checking CONFIG_SMP and CONFIG_NR_CPUS.  If the specified
@@ -7,23 +8,9 @@
 #
 # Usage: configNR_CPUS.sh config-frag
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2013
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 cf=$1
 if test ! -r $cf
tools/testing/selftests/rcutorture/bin/config_override.sh +2 -15
index ef7fcbac3d42..90016c359e83 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # config_override.sh base override
 #
@@ -6,23 +7,9 @@
 # that conflict with any in override, concatenating what remains and
 # sending the result to standard output.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2017
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 base=$1
 if test -r $base
tools/testing/selftests/rcutorture/bin/configcheck.sh +3 -15
index 197deece7c7c..5b25524d0366 100755
@@ -1,23 +1,11 @@
 #!/bin/bash
-# Usage: configcheck.sh .config .config-template
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# SPDX-License-Identifier: GPL-2.0+
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
+# Usage: configcheck.sh .config .config-template
 #
 # Copyright (C) IBM Corporation, 2011
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 T=${TMPDIR-/tmp}/abat-chk-config.sh.$$
 trap 'rm -rf $T' 0
tools/testing/selftests/rcutorture/bin/configinit.sh +2 -15
index 65541c21a544..40359486b3a8 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Usage: configinit.sh config-spec-file build-output-dir results-dir
 #
@@ -14,23 +15,9 @@
 # for example, "O=/tmp/foo".  If this argument is omitted, the .config
 # file will be generated directly in the current directory.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2013
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 T=${TMPDIR-/tmp}/configinit.sh.$$
 trap 'rm -rf $T' 0
tools/testing/selftests/rcutorture/bin/cpus2use.sh +2 -15
index bb99cde3f5f9..ff7102212703 100755
@@ -1,26 +1,13 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Get an estimate of how CPU-hoggy to be.
 #
 # Usage: cpus2use.sh
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2013
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 ncpus=`grep '^processor' /proc/cpuinfo | wc -l`
 idlecpus=`mpstat | tail -1 | \
tools/testing/selftests/rcutorture/bin/functions.sh +2 -15
index 65f6655026f0..6bcb8b5b2ff2 100644
@@ -1,24 +1,11 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Shell functions for the rest of the scripts.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2013
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 # bootparam_hotplug_cpu bootparam-string
 #
tools/testing/selftests/rcutorture/bin/jitter.sh +2 -15
index 3633828375e3..435b60933985 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Alternate sleeping and spinning on randomly selected CPUs.  The purpose
 # of this script is to inflict random OS jitter on a concurrently running
@@ -11,23 +12,9 @@
 # sleepmax: Maximum microseconds to sleep, defaults to one second.
 # spinmax: Maximum microseconds to spin, defaults to one millisecond.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2016
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 me=$(($1 * 1000))
 duration=$2
tools/testing/selftests/rcutorture/bin/kvm-build.sh +2 -15
index 9115fcdb5617..c27a0bbb9c02 100755
@@ -1,26 +1,13 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Build a kvm-ready Linux kernel from the tree in the current directory.
 #
 # Usage: kvm-build.sh config-template build-dir resdir
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2011
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 config_template=${1}
 if test -z "$config_template" -o ! -f "$config_template" -o ! -r "$config_template"
tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh +5 -0
index 98f650c9bf54..8426fe1f15ee 100755
@@ -1,4 +1,5 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Invoke a text editor on all console.log files for all runs with diagnostics,
 # that is, on all such files having a console.log.diags counterpart.
@@ -10,6 +11,10 @@
 #
 # The "directory" above should end with the date/time directory, for example,
 # "tools/testing/selftests/rcutorture/res/2018.02.25-14:27:27".
+#
+# Copyright (C) IBM Corporation, 2018
+#
+# Author: Paul E. McKenney <[email protected]>
 
 rundir="${1}"
 if test -z "$rundir" -o ! -d "$rundir"
tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh +2 -15
index 2de92f43ee8c..f3a7a5e2b89d 100755
@@ -1,26 +1,13 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Analyze a given results directory for locktorture progress.
 #
 # Usage: kvm-recheck-lock.sh resdir
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2014
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 i="$1"
 if test -d "$i" -a -r "$i"
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh +2 -15
index 0fa8a61ccb7b..2a7f3f4756a7 100755
@@ -1,26 +1,13 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Analyze a given results directory for rcutorture progress.
 #
 # Usage: kvm-recheck-rcu.sh resdir
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2014
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 i="$1"
 if test -d "$i" -a -r "$i"
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh +2 -15
index 8948f7926b21..7d3c2be66c64 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Analyze a given results directory for rcuperf performance measurements,
 # looking for ftrace data.  Exits with 0 if data was found, analyzed, and
@@ -7,23 +8,9 @@
 #
 # Usage: kvm-recheck-rcuperf-ftrace.sh resdir
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2016
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 i="$1"
 . functions.sh
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh +2 -15
index ccebf772fa1e..db0375a57f28 100755
@@ -1,26 +1,13 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Analyze a given results directory for rcuperf performance measurements.
 #
 # Usage: kvm-recheck-rcuperf.sh resdir
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2016
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 i="$1"
 if test -d "$i" -a -r "$i"
tools/testing/selftests/rcutorture/bin/kvm-recheck.sh +2 -15
index c9bab57a77eb..2adde6aaafdb 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Given the results directories for previous KVM-based torture runs,
 # check the build and console output for errors.  Given a directory
@@ -6,23 +7,9 @@
 #
 # Usage: kvm-recheck.sh resdir ...
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2011
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
 . functions.sh
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh +2 -15
index 58ca758a5786..0eb1ec16d78a 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Run a kvm-based test of the specified tree on the specified configs.
 # Fully automated run and error checking, no graphics console.
@@ -20,23 +21,9 @@
 #
 # More sophisticated argument parsing is clearly needed.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2011
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 T=${TMPDIR-/tmp}/kvm-test-1-run.sh.$$
 trap 'rm -rf $T' 0
tools/testing/selftests/rcutorture/bin/kvm.sh +2 -15
index 19864f1cb27a..8f1e337b9b54 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Run a series of tests under KVM.  By default, this series is specified
 # by the relevant CFLIST file, but can be overridden by the --configs
@@ -6,23 +7,9 @@
 #
 # Usage: kvm.sh [ options ]
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2011
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 scriptname=$0
 args="$*"
tools/testing/selftests/rcutorture/bin/mkinitrd.sh +1 -14
index 83552bb007b4..6fa9bd1ddc09 100755
@@ -1,21 +1,8 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Create an initrd directory if one does not already exist.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2013
 #
 # Author: Connor Shu <[email protected]>
tools/testing/selftests/rcutorture/bin/parse-build.sh +2 -15
index 24fe5f822b28..0701b3bf6ade 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Check the build output from an rcutorture run for goodness.
 # The "file" is a pathname on the local system, and "title" is
@@ -8,23 +9,9 @@
 #
 # Usage: parse-build.sh file title
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2011
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 F=$1
 title=$2
tools/testing/selftests/rcutorture/bin/parse-console.sh +2 -15
index 84933f6aed77..4508373a922f 100755
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Check the console output from an rcutorture run for oopses.
 # The "file" is a pathname on the local system, and "title" is
@@ -6,23 +7,9 @@
 #
 # Usage: parse-console.sh file title
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2011
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 T=${TMPDIR-/tmp}/parse-console.sh.$$
 file="$1"
tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh +2 -15
index 80eb646e1319..d3e4b2971f92 100644
@@ -1,24 +1,11 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Kernel-version-dependent shell functions for the rest of the scripts.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2014
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 # locktorture_param_onoff bootparam-string config-file
 #
tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh +2 -15
index 7bab8246392b..effa415f9b92 100644
@@ -1,24 +1,11 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Kernel-version-dependent shell functions for the rest of the scripts.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2013
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 # rcutorture_param_n_barrier_cbs bootparam-string
 #
tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh +2 -15
index d36b8fd6f0fc..777d5b0c190f 100644
@@ -1,24 +1,11 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Torture-suite-dependent shell functions for the rest of the scripts.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can access it online at
-# http://www.gnu.org/licenses/gpl-2.0.html.
-#
 # Copyright (C) IBM Corporation, 2015
 #
-# Authors: Paul E. McKenney <[email protected]>
+# Authors: Paul E. McKenney <[email protected]>
 
 # per_version_boot_params bootparam-string config-file seconds
 #
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/9 rcutorture: Make rcutorture_extend_mask() comment match the code

In reply to Paul E. McKenney

The code actually rarely uses more than one type of RCU read-side protection, as is actually desired given that we need some reasonable probability of preempting RCU read-side critical sections, which cannot happen with multiple types of protection. This comment therefore adjusts the comment.

---
 kernel/rcu/rcutorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/rcutorture.c +1 -1
index f14d1b18a74f..2453229ba15a 100644
@@ -1160,7 +1160,7 @@ rcutorture_extend_mask(int oldmask, struct torture_random_state *trsp)
 	unsigned long randmask2 = randmask1 >> 3;
 
 	WARN_ON_ONCE(mask >> RCUTORTURE_RDR_SHIFT);
-	/* Most of the time lots of bits, half the time only one bit. */
+	/* Mostly only one bit (need preemption!), sometimes lots of bits. */
 	if (!(randmask1 & 0x7))
 		mask = mask & randmask2;
 	else
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/9 rcutorture: Remove ->ext_irq_conflict field

In reply to Paul E. McKenney

Back when there was a separate RCU-bh flavor, the ->ext_irq_conflict field was used to prevent executing local_bh_enable() while interrupts were disabled. However, there is no longer an RCU-bh flavor, so this commit removes the no-longer-needed ->ext_irq_conflict field.

---
 kernel/rcu/rcutorture.c | 5 -----
 1 file changed, 5 deletions(-)
kernel/rcu/rcutorture.c +0 -5
index 2453229ba15a..21ab3c7eb221 100644
@@ -299,7 +299,6 @@ struct rcu_torture_ops {
 	int irq_capable;
 	int can_boost;
 	int extendables;
-	int ext_irq_conflict;
 	const char *name;
 };
 
@@ -1170,10 +1169,6 @@ rcutorture_extend_mask(int oldmask, struct torture_random_state *trsp)
 	    ((!(mask & RCUTORTURE_RDR_BH) && (oldmask & RCUTORTURE_RDR_BH)) ||
 	     (!(mask & RCUTORTURE_RDR_RBH) && (oldmask & RCUTORTURE_RDR_RBH))))
 		mask |= RCUTORTURE_RDR_BH | RCUTORTURE_RDR_RBH;
-	if ((mask & RCUTORTURE_RDR_IRQ) &&
-	    !(mask & cur_ops->ext_irq_conflict) &&
-	    (oldmask & cur_ops->ext_irq_conflict))
-		mask |= cur_ops->ext_irq_conflict; /* Or if readers object. */
 	return mask ?: RCUTORTURE_RDR_RCU;
 }
 
Signature · 1 line
2.17.1
#5 lore raw

PATCH 5/9 rcutorture: Fix expected forward progress duration in OOM notifier

In reply to Paul E. McKenney

From: Neeraj Upadhyay <[email protected]>

The rcutorture_oom_notify() function has a misplaced close parenthesis that results in increasingly long delays in rcu_fwd_progress_check()'s checking for various RCU forward-progress problems. This commit therefore puts the parenthesis in the right place.

---
 kernel/rcu/rcutorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/rcutorture.c +1 -1
index 21ab3c7eb221..b42682b94cb7 100644
@@ -1843,7 +1843,7 @@ static int rcutorture_oom_notify(struct notifier_block *self,
 	WARN(1, "%s invoked upon OOM during forward-progress testing.\n",
 	     __func__);
 	rcu_torture_fwd_cb_hist();
-	rcu_fwd_progress_check(1 + (jiffies - READ_ONCE(rcu_fwd_startat) / 2));
+	rcu_fwd_progress_check(1 + (jiffies - READ_ONCE(rcu_fwd_startat)) / 2);
 	WRITE_ONCE(rcu_fwd_emergency_stop, true);
 	smp_mb(); /* Emergency stop before free and wait to avoid hangs. */
 	pr_info("%s: Freed %lu RCU callbacks.\n",
Signature · 1 line
2.17.1
#6 lore raw

PATCH 6/9 rcutorture: Fix cleanup path for invalid torture_type strings

In reply to Paul E. McKenney

If the specified rcutorture.torture_type is not in the rcu_torture_init() function's torture_ops[] array, rcutorture prints some console messages and then invokes rcu_torture_cleanup() to set state so that a future torture test can run. However, rcu_torture_cleanup() also attempts to end the test that didn't actually start, and in doing so relies on the value of cur_ops, a value that is not particularly relevant in this case. This can result in confusing output or even follow-on failures due to attempts to use facilities that have not been properly initialized.

This commit therefore sets the value of cur_ops to NULL in this case and inserts a check near the beginning of rcu_torture_cleanup(), thus avoiding relying on an irrelevant cur_ops value.

---
 kernel/rcu/rcutorture.c | 5 +++++
 1 file changed, 5 insertions(+)
kernel/rcu/rcutorture.c +5 -0
index b42682b94cb7..e3c0f57ab0aa 100644
@@ -2089,6 +2089,10 @@ rcu_torture_cleanup(void)
 			cur_ops->cb_barrier();
 		return;
 	}
+	if (!cur_ops) {
+		torture_cleanup_end();
+		return;
+	}
 
 	rcu_torture_barrier_cleanup();
 	torture_stop_kthread(rcu_torture_fwd_prog, fwd_prog_task);
@@ -2262,6 +2266,7 @@ rcu_torture_init(void)
 		pr_cont("\n");
 		WARN_ON(!IS_MODULE(CONFIG_RCU_TORTURE_TEST));
 		firsterr = -EINVAL;
+		cur_ops = NULL;
 		goto unwind;
 	}
 	if (cur_ops->fqs == NULL && fqs_duration != 0) {
Signature · 1 line
2.17.1
#7 lore raw

PATCH 7/9 rcuperf: Fix cleanup path for invalid perf_type strings

In reply to Paul E. McKenney

If the specified rcuperf.perf_type is not in the rcu_perf_init() function's perf_ops[] array, rcuperf prints some console messages and then invokes rcu_perf_cleanup() to set state so that a future torture test can run. However, rcu_perf_cleanup() also attempts to end the test that didn't actually start, and in doing so relies on the value of cur_ops, a value that is not particularly relevant in this case. This can result in confusing output or even follow-on failures due to attempts to use facilities that have not been properly initialized.

This commit therefore sets the value of cur_ops to NULL in this case and inserts a check near the beginning of rcu_perf_cleanup(), thus avoiding relying on an irrelevant cur_ops value.

---
 kernel/rcu/rcuperf.c | 5 +++++
 1 file changed, 5 insertions(+)
kernel/rcu/rcuperf.c +5 -0
index c29761152874..7a6890b23c5f 100644
@@ -494,6 +494,10 @@ rcu_perf_cleanup(void)
 
 	if (torture_cleanup_begin())
 		return;
+	if (!cur_ops) {
+		torture_cleanup_end();
+		return;
+	}
 
 	if (reader_tasks) {
 		for (i = 0; i < nrealreaders; i++)
@@ -614,6 +618,7 @@ rcu_perf_init(void)
 		pr_cont("\n");
 		WARN_ON(!IS_MODULE(CONFIG_RCU_PERF_TEST));
 		firsterr = -EINVAL;
+		cur_ops = NULL;
 		goto unwind;
 	}
 	if (cur_ops->init)
Signature · 1 line
2.17.1
#8 lore raw

PATCH 8/9 locktorture: NULL cxt.lwsa and cxt.lrsa to allow bad-arg detection

In reply to Paul E. McKenney

Currently, lock_torture_cleanup() uses the values of cxt.lwsa and cxt.lrsa to detect bad parameters that prevented locktorture from initializing, let alone running. In this case, lock_torture_cleanup() does no cleanup aside from invoking torture_cleanup_begin() and torture_cleanup_end(), as required to permit future torture tests to run. However, this heuristic fails if the run with bad parameters was preceded by a previous run that actually ran: In this case, both cxt.lwsa and cxt.lrsa will remain non-zero, which means that the current lock_torture_cleanup() invocation will be unable to detect the fact that it should skip cleanup, which can result in charming outcomes such as double frees.

This commit therefore NULLs out both cxt.lwsa and cxt.lrsa at the end of any run that actually ran.

Cc Davidlohr Bueso <[email protected]>
Cc Josh Triplett <[email protected]>
---
 kernel/locking/locktorture.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/locking/locktorture.c +2 -0
index ad40a2617063..80a463d31a8d 100644
@@ -829,7 +829,9 @@ static void lock_torture_cleanup(void)
 						"End of test: SUCCESS");
 
 	kfree(cxt.lwsa);
+	cxt.lwsa = NULL;
 	kfree(cxt.lrsa);
+	cxt.lrsa = NULL;
 
 end:
 	torture_cleanup_end();
Signature · 1 line
2.17.1
#9 lore raw

PATCH 9/9 torture: Suppress false-positive CONFIG_INITRAMFS_SOURCE complaint

In reply to Paul E. McKenney

The scripting must supply the CONFIG_INITRAMFS_SOURCE Kconfig option so that kbuild can find the desired initrd, but the configcheck.sh script gets confused by this option because it takes a string instead of the expected y/n/m. This causes checkconfig.sh to complain about CONFIG_INITRAMFS_SOURCE in the torture-test output (though not in the summary). As more people use rcutorture, the resulting confusion is an increasing concern.

This commit therefore suppresses this false-positive warning by filtering CONFIG_INITRAMFS_SOURCE from within the checkconfig.sh script.

---
 tools/testing/selftests/rcutorture/bin/configcheck.sh | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/rcutorture/bin/configcheck.sh +1 -0
index 5b25524d0366..31584cee84d7 100755
@@ -14,6 +14,7 @@ mkdir $T
 cat $1 > $T/.config
 
 cat $2 | sed -e 's/\(.*\)=n/# \1 is not set/' -e 's/^#CHECK#//' |
+grep -v '^CONFIG_INITRAMFS_SOURCE' |
 awk	'
 {
 		print "if grep -q \"" $0 "\" < '"$T/.config"'";
Signature · 1 line
2.17.1