summaryrefslogtreecommitdiff
path: root/tests/rcutorture.c
AgeCommit message (Collapse)Author
2020-02-25tests/rcutorture: mild documenting refactor of update threadAlex Bennée
This is mainly to help with reasoning what the test is trying to do. We can move rcu_stress_idx to a local variable as there is only ever one updater thread. I've also added an assert to catch the case where we end up updating the current structure to itself which is the only way I can see the mberror cases we are seeing on Travis. We shall see if the rcutorture test failures go away now. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200225124710.14152-5-alex.bennee@linaro.org>
2020-02-25tests/rcutorture: better document locking of statsAlex Bennée
This is pure code motion with no functional effect. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200225124710.14152-4-alex.bennee@linaro.org>
2020-02-25tests/rcutorture: update usage hintAlex Bennée
Although documented in the comments we don't display all the various invocations we can in the usage. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200225124710.14152-3-alex.bennee@linaro.org>
2018-03-12rcutorture: remove synchronize_rcu from readersPaolo Bonzini
This gives much worse numbers for readers, especially if synchronize_rcu is made more expensive as is the case with --enable-membarrier. Before: $ tests/rcutorture 10 stress 10 n_reads: 98304 n_updates: 529 n_mberror: 0 rcu_stress_count: 98302 2 0 0 0 0 0 0 0 0 0 After: $ tests/rcutorture 10 stress 10 n_reads: 165158482 n_updates: 429 n_mberror: 0 rcu_stress_count: 165154364 4118 0 0 0 0 0 0 0 0 0 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-06-07tests: Remove unnecessary glib.h includesPeter Maydell
Remove glib.h includes, as it is provided by osdep.h. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-02-16tests: Clean up includesPeter Maydell
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Eric Blake <eblake@redhat.com>
2015-03-25rcu tests: fix compilation on 32-bit ppcPaolo Bonzini
32-bit PPC cannot do atomic operations on long long. Inside the loops, we are already using local counters that are summed at the end of the run---with some exceptions (rcu_stress_count for rcutorture, n_nodes for test-rcu-list): fix them to use the same technique. For test-rcu-list, remove the mostly unused member "val" from the list. Then, use a mutex to protect the global counts. Performance does not matter there because every thread will only enter the critical section once. Remaining uses of atomic instructions are for ints or pointers. Reported-by: Andreas Faerber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-02rcu: allow nesting of rcu_read_lock/rcu_read_unlockPaolo Bonzini
Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-02rcu: add rcutorturePaolo Bonzini
rcutorture is the unit test for rcu. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>