summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/rcutorture
AgeCommit message (Collapse)Author
2020-04-03Merge tag 'spdx-5.7-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx Pull SPDX updates from Greg KH: "Here are three SPDX patches for 5.7-rc1. One fixes up the SPDX tag for a single driver, while the other two go through the tree and add SPDX tags for all of the .gitignore files as needed. Nothing too complex, but you will get a merge conflict with your current tree, that should be trivial to handle (one file modified by two things, one file deleted.) All three of these have been in linux-next for a while, with no reported issues other than the merge conflict" * tag 'spdx-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx: ASoC: MT6660: make spdxcheck.py happy .gitignore: add SPDX License Identifier .gitignore: remove too obvious comments
2020-03-25.gitignore: add SPDX License IdentifierMasahiro Yamada
Add SPDX License Identifier to all .gitignore files. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-21Merge branches 'doc.2020.02.27a', 'fixes.2020.03.21a', ↵Paul E. McKenney
'kfree_rcu.2020.02.20a', 'locktorture.2020.02.20a', 'ovld.2020.02.20a', 'rcu-tasks.2020.02.20a', 'srcu.2020.02.20a' and 'torture.2020.02.20a' into HEAD doc.2020.02.27a: Documentation updates. fixes.2020.03.21a: Miscellaneous fixes. kfree_rcu.2020.02.20a: Updates to kfree_rcu(). locktorture.2020.02.20a: Lock torture-test updates. ovld.2020.02.20a: Updates to callback-overload handling. rcu-tasks.2020.02.20a: RCU-tasks updates. srcu.2020.02.20a: SRCU updates. torture.2020.02.20a: Torture-test updates.
2020-02-20rcutorture: Set KCSAN Kconfig options to detect more data racesPaul E. McKenney
This commit enables the KCSAN Kconfig options that (1) detect data races between reads and writes even when the writes do not change the variable's value and (2) detect data races involving plain C-language writes. These changes only affect scripted rcutorture runs and can be overridden using the kvm.sh --kconfig argument. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-02-20rcutorture: Make kvm-find-errors.sh abort on bad directoryPaul E. McKenney
Currently, kvm-find-errors.sh gives a usage prompt when given a bad directory, but then soldiers on, giving a series of confusing error messages. This commit therefore prints an error message and exits when given a bad directory, hopefully reducing confusion. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-02-20rcutorture: Summarize summary of build and run resultsPaul E. McKenney
When running the default list of tests, the run summary of a successful (that is, failed to find any errors) run fits easily on a 24-line screen. But a run with something like "--configs '5*CFLIST'" will be 80 lines long, and it is all too easy to miss a failure message when scrolling back. This commit therefore prints out the number of runs with failing builds or runtime failures, but only if there are any such failures. For example, a run with a single build error and a single runtime error would print two lines like this: 1 runs with build errors. 1 runs with runtime errors. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-02-20rcutorture: Add 100-CPU configurationPaul E. McKenney
The small-system rcutorture configurations have served us well for a great many years, but it is now time to add a larger one. This commit does just that, but does not add it to the defaults in CFLIST. This allows the kvm.sh argument '--configs "4*CFLIST TREE10" to run four instances of each of the default configurations concurrently with one instance of the large configuration. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-02-20torture: Make results-directory date format completion-friendlyPaul E. McKenney
The names of the per-test results directories are of the form 2019.11.29-20:42:19. This works, but the ":" characters make tab-based shell name completion a bit onerous because the user must remember to include a quote character somewhere before the first ":". This commit therefore changes the ":" characters to periods, as in 2019.12.01-20.48.01", which allows tab-based completion to work more naturally. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-02-20locktorture: Allow CPU-hotplug to be disabled via --bootargsPaul E. McKenney
The bootparam_hotplug_cpu() bash function was checking for CPU-hotplug kernel-boot parameters from --bootargs, but that check was specific to rcutorture ("rcutorture\.onoff_"). This commit therefore makes this check also work for locktorture ("torture\.onoff_"). Note that rcuperf does not do CPU-hotplug operations, so it is not necessary to make a similar change for rcuperf. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-12-09torture: Hoist calls to lscpu to higher-level kvm.sh scriptPaul E. McKenney
On some kernels, concurrent calls to the lscpu command result in severe slowdowns. For example, on v4.16, a single lscpu invocation takes about two milliseconds, four concurrent invocations more than two seconds, and 16 concurrent invocations more than 20 seconds. Given that the only goal is to learn the number of CPUs, invoking lscpu but once suffices. This commit therefore invokes lscpu early in kvm.sh execution, setting the initial value of the TORTURE_ALLOTED_CPUS environment variable. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-12-09torture: Allow "CFLIST" to specify default list of scenariosPaul E. McKenney
On a large system, it can be convenient to tell rcutorture to run several instances of the default scenarios. Currently, this requires explicitly listing them, for example, "--configs '2*SRCU-N 2*SRCU-P...'". Although this works, it is rather inconvenient. This commit therefore allows "CFLIST" to be specified to indicate the default list of scenarios called out in the relevant CFLIST file, for example, for RCU, tools/testing/selftests/rcutorture/configs/rcu/CFLIST. In addition, multipliers may be used to run multiple instances of all the scenarios. For example, on a 256-CPU system, "--configs '3*CFLIST'" would run three instances of each scenario concurrently with one CPU left over. Thus "--configs '3*CFLIST TINY01'" would exactly consume all 256 CPUs, which makes rcutorture's jitter feature more effective. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-12-09rcutorture: Add worst-case call_rcu() forward-progress resultsPaul E. McKenney
This commit adds the worst-case results from any call_rcu() forward-progress tests to the rcutorture test-summary output. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-12-09torture: Handle systems lacking the mpstat commandPaul E. McKenney
The rcutorture scripting uses the mpstat command to determine how much the system is being used, and adjusts make's -j argument accordingly. However, mpstat isn't installed by default, so it would be good if the scripting does something useful when mpstat isn't present. This commit therefore makes the scripts assumes that if mpstat is not present, they are free to use all the CPUs. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-12-09torture: Handle jitter for CPUs that cannot be offlinedPaul E. McKenney
Currently, jitter.sh assumes that the underlying hypervisor will be configured with all CPUs hotpluggable, with the possible exception of CPU 0. However, there are installations where the hypervisor prohibits offlining, which breaks jitter.sh. This commit therefore lists the CPUs that cannot be offlined up front, and checks for the case where no CPU can be offlined in the loop. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-12-09rcutorture: Dispense with Dracut for initrd creationPaul E. McKenney
The dracut scripting does not work on all platforms, and there are no known failures from the init binary based on the statically linked C program. This commit therefore removes the dracut scripting so that the statically linked C program is always used to create the init "script". Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-12-09torture: Use gawk instead of awk for systime() functionPaul E. McKenney
In many environments, gawk provides systime(), but awk doesn't. This commit therefore changes awk scripts using systime() to instead be gawk scripts. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-10-05rcutorture: Remove CONFIG_HOTPLUG_CPU=n from scenariosPaul E. McKenney
A number of mainstream CPU families are no longer capable of building kernels having CONFIG_SMP=y and CONFIG_HOTPLUG_CPU=n, so this commit removes this combination from the rcutorture scenarios having it. People wishing to try out this combination may still do so using the "--kconfig CONFIG_HOTPLUG_CPU=n CONFIG_SUSPEND=n CONFIG_HIBERNATION=n" argument to the tools/testing/selftests/rcutorture/bin/kvm.sh script that is used to run rcutorture. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2019-08-01rcutorture: Test TREE03 with the threadirqs kernel boot parameterPaul E. McKenney
Since commit 05f415715ce45 ("rcu: Speed up expedited GPs when interrupting RCU reader") in v5.0 and through v5.1, booting with the threadirqs kernel boot parameter caused self-deadlocks, which can be reproduced using the following command on an 8-CPU system: tools/testing/selftests/rcutorture/bin/kvm.sh --duration 5 --configs "TREE03" --bootargs "threadirqs" This commit therefore adds the threadirqs kernel boot parameter to the TREE03 rcutorture scenario in order to more quickly detect future similar bugs. Link: http://lkml.kernel.org/r/20190626135447.y24mvfuid5fifwjc@linutronix.de Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Joel Fernandes <joel@joelfernandes.org>
2019-08-01torture: Expand last_ts variable in kvm-test-1-run.shPaul E. McKenney
The kvm-test-1-run.sh script says 'test -z "last_ts"' which always evaluates to true (AKA zero) regardless of the value of the last_ts shell variable. This commit therefore inserts the needed dollar sign ("$"). Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Suppress propagating trace_printk() warningPaul E. McKenney
When trace_printk() is used, a message including "BUG" is printed to the console, which fools the rcutorture scripting into believing that the corresponding test scenario failed. This commit therefore filters out this particular instance of "BUG", thus avoiding the false-positive test-failure report. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Add --trust-make to suppress "make clean"Paul E. McKenney
The current rcutorture scripts unconditionally do "make clean", which is a good way of getting the needed testing done despite any imperfections in Makefile dependency tracking. However, this can be a bit irritating when repeatedly running a single scenario after small changes, for example, when debugging a problem that affects only a single scenario. This commit therefore adds a --trust-make argument that suppresses the "make clean". Even when using ccache, this speeds up kernel builds by up to almost an order of magnitude on my laptop. Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Make --cpus override idleness calculationsPaul E. McKenney
Currently, rcutorture will use relatively few CPUs to build the kernel on a busy system, which is often as it should be. However, if the user has used the --cpus argument to dedicate a specified number of CPUs to this torture test, it would be good if the kernel build also made use of them. This commit therefore changes the cpus2use.sh script to use --cpus when specified and to do the idleness calculations otherwise. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Run kernel build in source directoryPaul E. McKenney
For historical reasons, rcutorture places its build products in a tools/testing/selftests/rcutorture/b1 directory using the O= kbuild command-line argument. However, doing this requires that the source directory be pristine: Not just "make clean" pristine, but instead "make mrproper" (or, equivalently, "make distclean") pristine. Therefore, rcutorture executes a "make mrproper" before each build. Unfortunately, "make mrproper" has the side effect of removing pretty much everything, including tags files and cscope databases, which can be inconvenient to people whose workflow centers around a single source tree. This commit therefore makes rcutorture do the build directly in the source directory, removing the need for "make mrproper". This works because all needed build products are moved to their proper place in the "res" directory immediately after the build completes, so that multiple rcutorture kernels can still run concurrently. Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Add function graph-tracing cheat sheetPaul E. McKenney
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Capture qemu outputPaul E. McKenney
Currently qemu output appears on standard output, but is inaccessible later on. This commit therefore captures this output and causes kvm-recheck.sh to output this output if QEMU gave a non-zero non-137 exit code. (And exit code of 137 indicates that QEMU was killed, in which case we want to know about the hang rather than the fact that QEMU was killed.) Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28rcutorture: Tweak kvm optionsSebastian Andrzej Siewior
In one of my rcutorture tests the TSC clocksource got marked unstable due to a large difference in the TSC value. I'm not sure if the guest run for a long time with disabled interrupts or if the host was very busy and didn't schedule the guest for some time. I took a look on the qemu/KVM options and decided to update the options: - Use kvm{32|64} as CPU. We could probably use `host' (like ARM does) for maximum available features but since we don't run any userland I'm not sure if it makes any difference. - Drop the "noapic" option. There is no history why the APIC was disabled, I see no reason for it. Once old qemu versions fade away, we can add "x2apic=on,tsc-deadline=on,hypervisor=on,tsc_adjust=on". - Additional config options. It ensures that the kernel knowns that it runs as a kvm guest and can use virt devices like the kvm-clock as clocksource. The kvm-clock was the main motivation here. - I didn't add a random HW device. It would make the random device ready earlier (not it doesn't complete the initialisation at all) but I doubt that there is any need for this. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> [ paulmck: The world is not quite ready for CONFIG_PARAVIRT_SPINLOCKS=y and x2apic, so they are omitted for the time being. ] Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28rcutorture: Add trivial RCU implementationPaul E. McKenney
I have been showing off a trivial RCU implementation for non-preemptive environments for some time now: #define rcu_read_lock() #define rcu_read_unlock() #define rcu_dereference(p) READ_ONCE(p) #define rcu_assign_pointer(p, v) smp_store_release(&(p), (v)) void synchronize_rcu(void) { int cpu; for_each_online_cpu(cpu) sched_setaffinity(current->pid, cpumask_of(cpu)); } Trivial or not, as the old saying goes, "if it ain't tested, it don't work!". This commit therefore adds a "trivial" flavor to rcutorture and a corresponding TRIVIAL test scenario. This variant does not handle CPU hotplug, which is unconditionally enabled on x86 for post-v5.1-rc3 kernels, which is why the TRIVIAL.boot says "rcutorture.onoff_interval=0". This commit actually does handle CONFIG_PREEMPT=y kernels, but only because it turns back the Linux-kernel clock in order to provide these alternative definitions (or the moral equivalent thereof): #define rcu_read_lock() preempt_disable() #define rcu_read_unlock() preempt_enable() In CONFIG_PREEMPT=n kernels without debugging, these are equivalent to empty macros give or take a compiler barrier. However, the have been successfully tested with actual empty macros as well. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> [ paulmck: Fix symbol issue reported by kbuild test robot <lkp@intel.com>. ] [ paulmck: Work around sched_setaffinity() issue noted by Andrea Parri. ] [ paulmck: Add rcutorture.shuffle_interval=0 to TRIVIAL.boot to fix interaction with shuffler task noted by Peter Zijlstra. ] Tested-by: Andrea Parri <andrea.parri@amarulasolutions.com>
2019-05-28rcutorture: Exempt TREE01 from forward-progress testingPaul E. McKenney
Because TREE01 can end up running more vCPUs that physical CPUs, hammering these shortchanged CPUs with tight loops containing call_rcu() invocations seems a bit like overkill. This commit therefore exempts TREE01 from rcutorture's forward-progress testing. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28rcutorture: Provide rudimentary MakefilePaul E. McKenney
This commit provides a rudimentary Makefile that runs a 10-minute rcutorture test on scenario TREE01. This must be run on a system capable of spawning virtual machines and with everything installed to permit building Linux kernels. Reported-by: Shuah Khan <shuah@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Make kvm-find-errors.sh and kvm-recheck.sh provide exit statusPaul E. McKenney
This commit causes both kvm-find-errors.sh and kvm-recheck.sh to provide an exit status based on whether or not errors were located. In the case of kvm-recheck.sh, this will be the error status of the last run. This change allows these commands to be used in scripting and Makefiles to automatically report failed rcutorture runs. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28rcutorture: Add cpu0 to the set of CPUs to add jitterJoel Fernandes (Google)
jitter.sh currently does not add CPU0 to the list of CPUs for adding of jitter. Let us add it to this list even when it is not hot-pluggable. Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28rcutorture: Select from only online CPUsJoel Fernandes (Google)
The rcutorture jitter.sh script selects a random CPU but does not check if it is offline or online. This leads to taskset errors many times. On my machine, hyper threading is disabled so half the cores are offline causing taskset errors a lot of times. Let us fix this by checking from only the online CPUs on the system. Cc: rcu@vger.kernel.org Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-07Merge tag 'for-5.2/block-20190507' of git://git.kernel.dk/linux-blockLinus Torvalds
Pull block updates from Jens Axboe: "Nothing major in this series, just fixes and improvements all over the map. This contains: - Series of fixes for sed-opal (David, Jonas) - Fixes and performance tweaks for BFQ (via Paolo) - Set of fixes for bcache (via Coly) - Set of fixes for md (via Song) - Enabling multi-page for passthrough requests (Ming) - Queue release fix series (Ming) - Device notification improvements (Martin) - Propagate underlying device rotational status in loop (Holger) - Removal of mtip32xx trim support, which has been disabled for years (Christoph) - Improvement and cleanup of nvme command handling (Christoph) - Add block SPDX tags (Christoph) - Cleanup/hardening of bio/bvec iteration (Christoph) - A few NVMe pull requests (Christoph) - Removal of CONFIG_LBDAF (Christoph) - Various little fixes here and there" * tag 'for-5.2/block-20190507' of git://git.kernel.dk/linux-block: (164 commits) block: fix mismerge in bvec_advance block: don't drain in-progress dispatch in blk_cleanup_queue() blk-mq: move cancel of hctx->run_work into blk_mq_hw_sysfs_release blk-mq: always free hctx after request queue is freed blk-mq: split blk_mq_alloc_and_init_hctx into two parts blk-mq: free hw queue's resource in hctx's release handler blk-mq: move cancel of requeue_work into blk_mq_release blk-mq: grab .q_usage_counter when queuing request from plug code path block: fix function name in comment nvmet: protect discovery change log event list iteration nvme: mark nvme_core_init and nvme_core_exit static nvme: move command size checks to the core nvme-fabrics: check more command sizes nvme-pci: check more command sizes nvme-pci: remove an unneeded variable initialization nvme-pci: unquiesce admin queue on shutdown nvme-pci: shutdown on timeout during deletion nvme-pci: fix psdt field for single segment sgls nvme-multipath: don't print ANA group state by default nvme-multipath: split bios with the ns_head bio_set before submitting ...
2019-04-06block: remove CONFIG_LBDAFChristoph Hellwig
Currently support for 64-bit sector_t and blkcnt_t is optional on 32-bit architectures. These types are required to support block device and/or file sizes larger than 2 TiB, and have generally defaulted to on for a long time. Enabling the option only increases the i386 tinyconfig size by 145 bytes, and many data structures already always use 64-bit values for their in-core and on-disk data structures anyway, so there should not be a large change in dynamic memory usage either. Dropping this option removes a somewhat weird non-default config that has cause various bugs or compiler warnings when actually used. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-26torture: Suppress false-positive CONFIG_INITRAMFS_SOURCE complaintPaul 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. Reported-by: Joel Fernandes <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-03-26tools/.../rcutorture: Convert to SPDX license identifierPaul E. McKenney
Replace the license boiler plate with a SPDX license identifier. While in the area, update an email address and add copyright notices. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-01-25tools headers: Move the nolibc header from rcutorture to tools/include/nolibc/Willy Tarreau
As suggested by Ingo, this header file might benefit other tools than just rcutorture. For now it's quite limited, but is easy to extend, so exposing it into tools/include/nolibc/ will make it much easier to adopt by other tools. The mkinitrd.sh script in rcutorture was updated to use this new location. Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-01-25rcutorture/nolibc: Add a bit of documentation to explain how to use nolibcWilly Tarreau
Ingo rightfully asked for a bit more documentation in the nolibc header, so this patch adds some explanation about its purpose, how it's made, and how to use it. Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
2019-01-25rcutorture/nolibc: Fix some poor indentation and alignmentWilly Tarreau
A few macros had their rightmost backslash misaligned, and the pollfd struct definition resisted the previous code reindent. Nothing else changed. Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com>
2019-01-25rcutorture/nolibc: Fix the clobbered registers in the MIPS syscall definitionWilly Tarreau
A last-minute checkpatch cleanup caused most of list of clobbered registers to be lost in the MIPS syscall definition. Although this code is not yet used on MIPS, it is nevertheless better to fix it before it does get used. Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-01-25torture: Explain and simplify odd "for" loop in mkinitrd.shPaul E. McKenney
Why a Bourne-shell "for" loop? And why 192 instances of "a"? This commit adds a shell comment to present the answer to these mysteries. It also uses a series of factor-of-four Bourne-shell assignments to make it easy to see how many instances there are, replacing the earlier wall of 'a' characters. Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> [ paulmck: Fix wrong-variable bugs noted by Andrea Parri. ]
2018-12-01Merge branches 'bug.2018.11.12a', 'consolidate.2018.12.01a', ↵Paul E. McKenney
'doc.2018.11.12a', 'fixes.2018.11.12a', 'initrd.2018.11.08b', 'sil.2018.11.12a' and 'srcu.2018.11.27a' into HEAD bug.2018.11.12a: Get rid of BUG_ON() and friends consolidate.2018.12.01a: Continued RCU flavor-consolidation cleanup doc.2018.11.12a: Documentation updates fixes.2018.11.12a: Miscellaneous fixes initrd.2018.11.08b: Automate creation of rcutorture initrd sil.2018.11.12a: Remove more spin_unlock_wait() calls
2018-12-01rcutorture/formal: Replace synchronize_sched() with synchronize_rcu()Paul E. McKenney
Now that synchronize_rcu() waits for preempt-disable regions of code as well as RCU read-side critical sections, synchronize_sched() can be replaced by synchronize_rcu(). This commit therefore makes this change, even though it is but a comment. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2018-11-08rcutorture: Make use of nolibc when availableWilly Tarreau
This reduces the size of the init executable from ~800 kB to ~800 bytes on x86_64. This is only implemented for x86_64, i386, arm and arm64. Others not tested. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08rcutorture: Import a copy of nolibcWilly Tarreau
This is a definition of the most common syscalls needed in minimalist init executables, allowing to statically build them with no external dependencies. It is sufficient in its current form to build rcutorture's init on x86_64, i386, arm, and arm64. Others have not been ported or tested. Updates may be found here : http://git.formilux.org/?p=people/willy/nolibc.git Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08rcutorture: Check initrd/init instead of initrd onlyWilly Tarreau
If the build fails, we can end up with an empty initrd directory which prevents the build script from operating again. Better rely on the resulting init executable instead. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08rcutorture: Always strip using the cross-compilerWilly Tarreau
Strip using -s on the compiler command line instead of calling the "strip" utility as the latter isn't necessarily compatible with the target arch. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08rcutorture: Add cross-compile capability to initrd.shPaul E. McKenney
This adds the CROSS_COMPILE environment to the initrd.sh script's gcc command to enable cross compilation. Reported-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08rcutorture: Make initrd/init execute in userspacePaul E. McKenney
Currently, the initrd/init script and executable remain blocked almost all the time. However, it is necessary to test nohz_full userspace execution, which both variants of initrd/init fail to do. This commit therefore causes initrd/init to spend about a millisecond per second executing in userspace. Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08rcutorture: Add initrd support for systems lacking dracutPaul E. McKenney
The support for creating initrd directories using dracut is a great improvement over having to always hand-create them, it is a bit annoying to have to install some otherwise irrelevant package just to be able to run rcutorture. This commit therefore adds support for creating initrd directories on systems innocent of dracut. You do need gcc, but then again you need that to build the kernel (or to build llvm) in any case. The idea is to create an initrd directory containing nothing but a statically linked binary having a for-loop over a long-term sleep(). The result is a Linux kernel with almost no userspace: even the time-honored /dev, /lib, /tmp, and /usr directories are gone. In fact, the only directory present is "/", but only because I don't know how to get rid of it, at least short of not having an initrd in the first place. Although statically linked binaries are much maligned, and rightly so, their disadvantages seem to be irrelevant for this particular use case. From https://www.akkadia.org/drepper/no_static_linking.html: 1. Fixes are difficult to apply to hordes of widely scattered statically linked binaries. But in this case, there is only one binary, but there would otherwise be no fewer than four libraries. 2. Security measures like local address randomization cannot be used. Prudence prevents me from asserting that it is impossible to base a remote attack on a networking-free rcutorture instance. Nevertheless, bonus points to the first person who comes up with such an attack! 3. More efficient use of physical memory. Not in this case, given that libc is 1.8MB and the statically linked binary "only" 800K. 4. Features such as locales, name service switch (NSS), internationalized domain names (IDN) tool, and so on require dynamic linking. Bonus points to the first person coming up with a valid rcutorture use case requiring these features in its initrd. 5. Accidental violations of (L)GPL. Actually, this change actually helps -avoid- such violations by reducing the temptation to pass around tarballs of rcutorture-ready initrd directories. After all, the rcutorture scripts automatically create an initrd directory for you, so why bother with the tarballs? 6. Tools and hacks like ltrace, LD_PRELOAD, LD_PROFILE, and LD_AUDIT don't work. Again, bonus points to the first person coming up with a valid rcutorture use case requiring these features in its initrd. Nevertheless, the script will use dracut if available, and will create the statically linked binary only when dracut are missing. Those preferring the smaller initrd directory resulting from the statically linked binary (like me) are free to hand-edit mkinitrd.sh to remove the code using dracut. ;-) Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>