Commit Graph

327 Commits

Author SHA1 Message Date
Kees Cook 24fe831c17 tools/testing/selftests/sysctl: validate sysctl_writes_strict
This adds several behavioral tests to sysctl string and number writing
to detect unexpected cases that behaved differently when the sysctl
kernel.sysctl_writes_strict != 1.

[ original ]
    root@localhost:~# make test_num
    == Testing sysctl behavior against /proc/sys/kernel/domainname ==
    Writing test file ... ok
    Checking sysctl is not set to test value ... ok
    Writing sysctl from shell ... ok
    Resetting sysctl to original value ... ok
    Writing entire sysctl in single write ... ok
    Writing middle of sysctl after synchronized seek ... FAIL
    Writing beyond end of sysctl ... FAIL
    Writing sysctl with multiple long writes ... FAIL
    Writing entire sysctl in short writes ... FAIL
    Writing middle of sysctl after unsynchronized seek ... ok
    Checking sysctl maxlen is at least 65 ... ok
    Checking sysctl keeps original string on overflow append ... FAIL
    Checking sysctl stays NULL terminated on write ... ok
    Checking sysctl stays NULL terminated on overwrite ... ok
    make: *** [test_num] Error 1
    root@localhost:~# make test_string
    == Testing sysctl behavior against /proc/sys/vm/swappiness ==
    Writing test file ... ok
    Checking sysctl is not set to test value ... ok
    Writing sysctl from shell ... ok
    Resetting sysctl to original value ... ok
    Writing entire sysctl in single write ... ok
    Writing middle of sysctl after synchronized seek ... FAIL
    Writing beyond end of sysctl ... FAIL
    Writing sysctl with multiple long writes ... ok
    make: *** [test_string] Error 1

[ with CONFIG_PROC_SYSCTL_STRICT_WRITES ]
    root@localhost:~# make run_tests
    == Testing sysctl behavior against /proc/sys/kernel/domainname ==
    Writing test file ... ok
    Checking sysctl is not set to test value ... ok
    Writing sysctl from shell ... ok
    Resetting sysctl to original value ... ok
    Writing entire sysctl in single write ... ok
    Writing middle of sysctl after synchronized seek ... ok
    Writing beyond end of sysctl ... ok
    Writing sysctl with multiple long writes ... ok
    Writing entire sysctl in short writes ... ok
    Writing middle of sysctl after unsynchronized seek ... ok
    Checking sysctl maxlen is at least 65 ... ok
    Checking sysctl keeps original string on overflow append ... ok
    Checking sysctl stays NULL terminated on write ... ok
    Checking sysctl stays NULL terminated on overwrite ... ok
    == Testing sysctl behavior against /proc/sys/vm/swappiness ==
    Writing test file ... ok
    Checking sysctl is not set to test value ... ok
    Writing sysctl from shell ... ok
    Resetting sysctl to original value ... ok
    Writing entire sysctl in single write ... ok
    Writing middle of sysctl after synchronized seek ... ok
    Writing beyond end of sysctl ... ok
    Writing sysctl with multiple long writes ... ok

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-06-06 16:08:13 -07:00
Paul E. McKenney 8be7f505f9 rcutorture: Note diffs from git commits
The current scripting only keeps track of the git SHA-1 of the current
HEAD.  This can cause confusion in cases where testing ran in a git
tree where changes had not yet been checked in.  This commit therefore
also records the output of "git diff HEAD" to provide the information
needed to reconstruct the source tree that was tested.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:46:25 -07:00
Paul E. McKenney e8d07a4ebc rcutorture: Test RCU-sched primitives in TREE_PREEMPT_RCU kernels
This commit ensures that RCU-sched primitives are tested in
TREE_PREEMPT_RCU kernels, a combination that was previously omitted.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:46:20 -07:00
Paul E. McKenney 0bca7c33ba torture: Use elapsed time to detect hangs
The kvm-test-1-run.sh currently counts "sleep 1" commands to detect
hangs.  This can fail spectacularly on busy systems, where "sleep 1"
might take far longer than one second to complete.  This commit
therefore changes hang detection to use elapsed time measurements.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:46:18 -07:00
Paul E. McKenney 9eb97fe703 torture: Better summary diagnostics for build failures
The reaction of kvm-recheck.sh is obscure at best, and easy to miss
completely.  This commit therefore prints "BUG: Build failed" in the
summary at the end of a run.  This commit also adds the line of dashes
in cases where performance info is not available, and also avoids
printing nonsense diagnostics in cases where some of the normal test
output is not available.  In addition, this commit saves off the .config
file even when the build fails.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-05-14 09:46:15 -07:00
Paul E. McKenney 499c632dce torture: Add tracing-enabled variant of TREE02
This commit adds a CONFIG_RCU_TRACE=y version of TREE02 for debugging
purposes.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:46:06 -07:00
Paul E. McKenney f189cc8c94 torture: Choose bzImage location based on architecture
Currently, the scripts hard-code arch/x86/boot/bzImage, which does not
work well for other architectures.  This commit therefore provides a
identify_boot_image function that selects the correct bzImage location
relative to the top of the Linux source tree.  This commit also adds a
--bootimage argument that allows selecting some other file, for example,
"vmlinux".

This change requires that the definition of the QEMU variable be
computed earlier in order to identify where to look for the boot image
when it comes time to copy it to the results directory.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:46:04 -07:00
Paul E. McKenney 0618873116 torture: Permit multi-word qemu and boot arguments
This commit applies quotes to permit multi-word --qemu-args and
--bootargs arguments.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:46:03 -07:00
Paul E. McKenney fff35c4e9f torture: Report diagnostics from qemu
The current script does record qemu diagnostics, but the user has to
know where to look for them.  This commit therefore puts them into the
Warnings file so that kvm-recheck.sh will display them.  This change is
especially useful if you are in the habit of killing the qemu process
when you realize that you messed something up, but then later on wonder
why the process terminated early.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-05-14 09:46:00 -07:00
Paul E. McKenney 14d9d84c9e torture: Make "--dryrun script" use same environment as normal run
In a normal torture-test run, the script inherits its environment
variables, but this does not work when producing a script that is
to run later.  Therefore, definitions and exports are prepended to
a dryrun script but not to a script that is run immediately.  This
commit reconciles this by placing definitions and exports at the
beginning of the script in both cases.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>

Conflicts:
	tools/testing/selftests/rcutorture/bin/kvm.sh
2014-05-14 09:45:56 -07:00
Paul E. McKenney 1f5d09205f torture: Make "--dryrun script" output self-sufficient
The scripts produced by kvm.sh's "--dryrun script" argument were intended
for debugging rather than to run, but it is easier to debug if the script
output matches exactly what is run.  This commit therefore makes this
script runnable.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:55 -07:00
Paul E. McKenney 97dc0afed1 torture: Make config-fragment filtering RCU-independent
The torture tests need to set specific values for their respective
Kconfig options (e.g., CONFIG_LOCK_TORTURE_TEST), and must therefore
filter any conflicting definitions from the Kconfig fragment
file.  Unfortunately, the code in kvm-build.sh was looking only for
CONFIG_RCU_TORTURE_TEST.  This commit therefore handles the general case
of CONFIG_[A-Z]*_TORTURE_TEST.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:52 -07:00
Paul E. McKenney 250da31e06 torture: Rename RCU_QEMU_CMD to TORTURE_QEMU_CMD
This commit makes the torture scripts a bit more RCU-independent.
It also removes a redundant export of this same shell variable.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:51 -07:00
Paul E. McKenney d1b1e5170c torture: Rename RCU_QEMU_ARG to TORTURE_QEMU_ARG
This commit makes the torture scripts a bit more RCU-independent.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:49 -07:00
Paul E. McKenney 58f724f741 torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MAC
This commit makes the torture scripts a bit more RCU-independent.
It also drops an redundant "export" statement.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:48 -07:00
Paul E. McKenney a0edd47ca4 torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE
This commit makes the torture scripts a bit more RCU-independent.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:46 -07:00
Paul E. McKenney 805ffee232 torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLY
This commit makes the torture scripts a bit more RCU-independent by
changing RCU_BUILDONLY to TORTURE_BUILDONLY.  It also removes an
unnecessary export command.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:45 -07:00
Paul E. McKenney 98bc8cc871 torture: Rename RCU_BOOTARGS to TORTURE_BOOTARGS
This commit makes the torture scripts a bit more RCU-independent.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:44 -07:00
Paul E. McKenney 58d280bd70 torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARG
This commit makes the torture scripts a bit more RCU-independent by
changing RCU_KMAKE_ARG to TORTURE_KMAKE_ARG.  It also removes the
unnecessary export command.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:42 -07:00
Paul E. McKenney 8c55f2271c torture: Allow variations of "defconfig" to be specified
Some environments require some variation on "make defconfig" to initialize
the .config file.  This commit therefore adds a --defconfig argument to
allow this to be specified.  The default value is of course "defconfig".

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14 09:45:19 -07:00
Paul E. McKenney 2f66dbc1e8 torture: Rename RCU_INITRD to TORTURE_INITRD
This commit makes the torture scripts a bit more RCU-independent.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-13 17:02:56 -07:00
Paul E. McKenney 4074b51b6f torture: Make parse-rcutorture.sh less RCU-specific
It can be a bit jarring to see a locking test complain about RCU, so
this commit renames parse-rcutorture.sh to parse-torture.sh and makes
the messages it emits more generic.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-13 17:02:48 -07:00
Paul E. McKenney 9352ad1339 torture: Add batch headers "--dryrun sched"
This commit makes the output of "--dryrun sched" more user-friendly,
clearly indicating the batch starts.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-13 17:02:42 -07:00
Paul E. McKenney f7ff6e6cf5 torture: Remove obsolete builddir options
The --builddir and --relbuilddir options were initially intended to handle
parallel tests.  However, since commit 43e38ab3d5 (Enable concurrent
rcutorture runs), the script manages multiple build directories as
needed for parallel testing.  This commit therefore removes these two
obsolete options.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-13 17:02:33 -07:00
Linus Torvalds 05b1332eaf This just contains a single update by Satoru Takeuchi, which adds
CLOSE_CONSOLE_SIGNAL to the kvm.conf file, as the kvm guest requires
 a different signal than a normal console uses.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJTOuRXAAoJEKQekfcNnQGuukQH/3x8/rCkDSfn44zdA0srumm6
 1yKfn3QBgspoxi78zypPLiCmSKLMVWpKOfFwyN3jaQSy7/UfoSTLEEPKcKIEdaUe
 2HWMIO2OxToghRfo1WSA899p0MPtw44J7gy6bvLv9qMl8yyNE9KBotEQTT2vJ+ya
 ODMXNhy4lmRvz3jHFLu4Z62PsJ/YQvHzehgb1N62EkwvBwtaCu8CAt1qvN5B9EnO
 wWCYJ+DfdnXwNhA+e7w4hOTxc8thO4bRXFKVs50ST7zMHWNtTxs+WODlmJKQGUUS
 SNeZcwkh/BBdM9MYIQQUpqUQ16lEh7/6fVdFMHpCK2IL32T0wNwpFf3A+ZTnRoo=
 =b4GL
 -----END PGP SIGNATURE-----

Merge tag 'ktest-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest

Pull single ktest fix from Steven Rostedt:
 "This just contains a single update by Satoru Takeuchi, which adds
  CLOSE_CONSOLE_SIGNAL to the kvm.conf file, as the kvm guest requires a
  different signal than a normal console uses"

* tag 'ktest-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
  ktest: Set CLOSE_CONSOLE_SIGNAL in the kvm.conf
2014-04-04 21:27:43 -07:00
Linus Torvalds 235c7b9feb Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull main powerpc updates from Ben Herrenschmidt:
 "This time around, the powerpc merges are going to be a little bit more
  complicated than usual.

  This is the main pull request with most of the work for this merge
  window.  I will describe it a bit more further down.

  There is some additional cpuidle driver work, however I haven't
  included it in this tree as it depends on some work in tip/timer-core
  which Thomas accidentally forgot to put in a topic branch.  Since I
  didn't want to carry all of that tip timer stuff in powerpc -next, I
  setup a separate branch on top of Thomas tree with just that cpuidle
  driver in it, and Stephen has been carrying that in next separately
  for a while now.  I'll send a separate pull request for it.

  Additionally, two new pieces in this tree add users for a sysfs API
  that Tejun and Greg have been deprecating in drivers-core-next.
  Thankfully Greg reverted the patch that removes the old API so this
  merge can happen cleanly, but once merged, I will send a patch
  adjusting our new code to the new API so that Greg can send you the
  removal patch.

  Now as for the content of this branch, we have a lot of perf work for
  power8 new counters including support for our new "nest" counters
  (also called 24x7) under pHyp (not natively yet).

  We have new functionality when running under the OPAL firmware
  (non-virtualized or KVM host), such as access to the firmware error
  logs and service processor dumps, system parameters and sensors, along
  with a hwmon driver for the latter.

  There's also a bunch of bug fixes accross the board, some LE fixes,
  and a nice set of selftests for validating our various types of copy
  loops.

  On the Freescale side, we see mostly new chip/board revisions, some
  clock updates, better support for machine checks and debug exceptions,
  etc..."

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (70 commits)
  powerpc/book3s: Fix CFAR clobbering issue in machine check handler.
  powerpc/compat: 32-bit little endian machine name is ppcle, not ppc
  powerpc/le: Big endian arguments for ppc_rtas()
  powerpc: Use default set of netfilter modules (CONFIG_NETFILTER_ADVANCED=n)
  powerpc/defconfigs: Enable THP in pseries defconfig
  powerpc/mm: Make sure a local_irq_disable prevent a parallel THP split
  powerpc: Rate-limit users spamming kernel log buffer
  powerpc/perf: Fix handling of L3 events with bank == 1
  powerpc/perf/hv_{gpci, 24x7}: Add documentation of device attributes
  powerpc/perf: Add kconfig option for hypervisor provided counters
  powerpc/perf: Add support for the hv 24x7 interface
  powerpc/perf: Add support for the hv gpci (get performance counter info) interface
  powerpc/perf: Add macros for defining event fields & formats
  powerpc/perf: Add a shared interface to get gpci version and capabilities
  powerpc/perf: Add 24x7 interface headers
  powerpc/perf: Add hv_gpci interface header
  powerpc: Add hvcalls for 24x7 and gpci (Get Performance Counter Info)
  sysfs: create bin_attributes under the requested group
  powerpc/perf: Enable BHRB access for EBB events
  powerpc/perf: Add BHRB constraint and IFM MMCRA handling for EBB
  ...
2014-04-02 13:42:59 -07:00
Linus Torvalds b3fd4ea9df Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RCU updates from Ingo Molnar:
 "Main changes:

   - Torture-test changes, including refactoring of rcutorture and
     introduction of a vestigial locktorture.

   - Real-time latency fixes.

   - Documentation updates.

   - Miscellaneous fixes"

* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (77 commits)
  rcu: Provide grace-period piggybacking API
  rcu: Ensure kernel/rcu/rcu.h can be sourced/used stand-alone
  rcu: Fix sparse warning for rcu_expedited from kernel/ksysfs.c
  notifier: Substitute rcu_access_pointer() for rcu_dereference_raw()
  Documentation/memory-barriers.txt: Clarify release/acquire ordering
  rcutorture: Save kvm.sh output to log
  rcutorture: Add a lock_busted to test the test
  rcutorture: Place kvm-test-1-run.sh output into res directory
  rcutorture: Rename TREE_RCU-Kconfig.txt
  locktorture: Add kvm-recheck.sh plug-in for locktorture
  rcutorture: Gracefully handle NULL cleanup hooks
  locktorture: Add vestigial locktorture configuration
  rcutorture: Introduce "rcu" directory level underneath configs
  rcutorture: Rename kvm-test-1-rcu.sh
  rcutorture: Remove RCU dependencies from ver_functions.sh API
  rcutorture: Create CFcommon file for common Kconfig parameters
  rcutorture: Create config files for scripted test-the-test testing
  rcutorture: Add an rcu_busted to test the test
  locktorture: Add a lock-torture kernel module
  rcutorture: Abstract kvm-recheck.sh
  ...
2014-03-31 11:05:24 -07:00
Colin Ian King 5394223236 tools/testing/selftests/ipc/msgque.c: handle msgget failure return correctly
A failed msgget causes the test to return an uninitialised value in ret.
Assign ret to -errno on error exit.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Davidlohr Bueso <davidlohr@hp.com>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-03-10 17:26:21 -07:00
Michael Ellerman 22d651dcef selftests/powerpc: Import Anton's memcpy / copy_tofrom_user tests
Turn Anton's memcpy / copy_tofrom_user test into something that can
live in tools/testing/selftests.

It requires one turd in arch/powerpc/lib/memcpy_64.S, but it's pretty
harmless IMHO.

We are sailing very close to the wind with the feature macros. We define
them to nothing, which currently means we get a few extra nops and
include the unaligned calls.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-03-07 15:53:12 +11:00
Satoru Takeuchi 62183dcac5 ktest: Set CLOSE_CONSOLE_SIGNAL in the kvm.conf
As mentioned at commit 5a5d8e4844, we can't terminate 'virsh console'
with the default signal(INT). So it's better to set CLOSE_CONSOLE_SIGNAL
in the kvm.conf.

Link: http://lkml.kernel.org/r/8738jatylb.wl%satoru.takeuchi@gmail.com

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
[ Typo fixed by ]
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2014-02-26 15:26:24 -05:00
Paul E. McKenney 73fa867e2c rcutorture: Save kvm.sh output to log
This commit logs the progress text that kvm.sh outputs, improving
after-the-fact troubleshooting.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:44 -08:00
Paul E. McKenney b46f358ae5 rcutorture: Place kvm-test-1-run.sh output into res directory
The output of each kvm-test-1-run.sh script is placed into a file
whose name parallels that of the build directory.  This means that
the kvm-test-1-run.sh output is overwritten by later run.  This
commit therefore places the kvm-test-1-run.sh output into the
per-test-case directory in the "res" hierarchy.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:42 -08:00
Paul Bolle 48a21d5cf0 rcutorture: Rename TREE_RCU-Kconfig.txt
It used to be that:

    git ls-files "*Kconfig*"

would find all Kconfig files and would only find Kconfig files. This
commit renames TREE_RCU-Kconfig.txt to TREE_RCU-kconfig.txt so that this
is once again true.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:41 -08:00
Paul E. McKenney 02736b81dd locktorture: Add kvm-recheck.sh plug-in for locktorture
This commit adds the kvm-recheck-lock.sh plug-in for locktorture to
print out lock-specific progress statistics.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:40 -08:00
Paul E. McKenney 9dfa5b35c1 locktorture: Add vestigial locktorture configuration
This commit adds a trivial set of configuration files for lock
torturing.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:37 -08:00
Paul E. McKenney 61010e74d7 rcutorture: Introduce "rcu" directory level underneath configs
This commit uses the standard software ploy of introducing another
level of indirection below the configs directory.  This allows each
torture-test suite to have its own set of Kconfig files, boot parameters,
and version-specific scripts.  Initially, we have only rcu, but lock
will follow soonish.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:36 -08:00
Paul E. McKenney d3b1548aa2 rcutorture: Rename kvm-test-1-rcu.sh
The kvm-test-1-rcu.sh is not specific to RCU, so this commit renames it
to kvm-test-1-run.sh.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:34 -08:00
Paul E. McKenney a5afdeb13c rcutorture: Remove RCU dependencies from ver_functions.sh API
The current set of functions in ver_functions.sh have APIs that are
specific to RCU.  This commit therefore makes an RCU-independent function
that outputs version-specific boot arguments.  This has the benefit that
a test-type-independent call in kvm-test-1-rcu.sh can now handle any type
of test, given a test-type-specific set of files in a configs directory.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:33 -08:00
Paul E. McKenney d2ebf7eea0 rcutorture: Create CFcommon file for common Kconfig parameters
Currently, CONFIG_RCU_TORTURE_TEST=y is hardcoded into the
kvm-test-1-rcu.sh script and CONFIG_PRINTK_TIME=y is mentioned in each
and every configs file.  This commit creates a CFcommon file for these
two Kconfig parameters, and modifies kvm-test-1-rcu.sh to copy this new
file into the .config file during the build.  This change will allow
these scripts to operate on torture types other than just rcutorture.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:32 -08:00
Paul E. McKenney a1be00d953 rcutorture: Create config files for scripted test-the-test testing
This commit adds a pair of files in the configs directory to allow
test-the-test runs of rcutorture via a "--configs BUSTED" argument to
the kvm.sh script.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:31 -08:00
Paul E. McKenney 2193e1604e rcutorture: Abstract kvm-recheck.sh
This commit creates a plug-in to allow kvm-recheck.sh to process
non-rcutorture console output.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:04:28 -08:00
Paul E. McKenney 3c626237eb rcutorture: Print dates when doing parallel rcutorture runs
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-23 09:01:09 -08:00
Paul E. McKenney daeda23de1 rcutorture: Don't create results directory for dryruns
This commit prevents the results directory from being created for
dryruns.  However, a script generated from a dryrun will create
the results directory should it be run.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org
2014-02-23 09:00:59 -08:00
Paul E. McKenney ec256c0f68 rcutorture: Print results directory when dumping results
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-18 12:27:30 -08:00
Paul E. McKenney df1cc81ba7 rcutorture: Flag tests requiring more CPUs than are available
This commit adds a "(!)" flag after the number of CPUs required by a
given test if that test requires more than the available number of CPUs.
Note that these flags appear only when the number of CPUs is specified
using the --cpus argument.  In the absence of a --cpus argument, no
tests are flagged.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-18 12:27:24 -08:00
Paul E. McKenney 78ad069323 rcutorture: Add comments, especially on bin packing.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-18 12:27:19 -08:00
Paul E. McKenney 5395467103 rcutorture: Do better bin packing
Running the standard set of rcutorture tests on 24 CPUs results in
the following sub-optimal schedule:

	----start batch----
	 TREE07 16
	----start batch----
	 TREE08 16
	 SRCU-P 8
	----start batch----
	 TREE01 8
	 TREE02 8
	 TREE03 8
	----start batch----
	 TREE04 8
	 TREE05 8
	 TREE06 8
	----start batch----
	 SRCU-N 4
	 TINY01 1
	 TINY02 1
	 TREE09 1

If one of the eight-CPU runs were to be moved into the first batch,
the test suite would complete in four batches rather than five.

This commit therefore uses a greedy algorithm to re-order the test
entries so that the sequential batching will produce an optimal schedule
in this case:

	----start batch----
	 TREE07 16
	 SRCU-P 8
	----start batch----
	 TREE08 16
	 TREE01 8
	----start batch----
	 TREE02 8
	 TREE03 8
	 TREE04 8
	----start batch----
	 TREE05 8
	 TREE06 8
	 SRCU-N 4
	 TINY01 1
	 TINY02 1
	 TREE09 1

Please note that this is still not an optimal bin-packing algorithm,
however, it does produce optimal solutions for most common scenarios.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-18 12:26:52 -08:00
Paul E. McKenney 0ae3f73af5 rcutorture: Handle multiple runs of the same test
This commit fixes handling numbering of multiple runs of the same test
so as to disambiguate output.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-18 12:26:46 -08:00
Paul E. McKenney a7582815b9 rcutorture: Add dryrun capability
Actual rcutorture tests take considerable time and machine resources,
so it is inconvenient to actually do an rcutorture run when optimizing
the bin-packing algorithm.  This commit therefore adds a --dryrun
argument, which defaults to doing a run, but for which "sched"
says to simply print the run schedule and "script" dumps the script
without running it.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-18 12:26:35 -08:00
Paul E. McKenney db007ab5ce rcutorture: Fix results-directory error message
The message complains about a build directory when it should instead
be complaining about the results directory, so this commit fixes it.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-02-18 12:26:30 -08:00