aboutsummaryrefslogtreecommitdiff
path: root/tests/test-rcu-list.c
AgeCommit message (Collapse)Author
2019-01-11qemu/queue.h: leave head structs anonymous unless necessaryPaolo Bonzini
Most list head structs need not be given a name. In most cases the name is given just in case one is going to use QTAILQ_LAST, QTAILQ_PREV or reverse iteration, but this does not apply to lists of other kinds, and even for QTAILQ in practice this is only rarely needed. In addition, we will soon reimplement those macros completely so that they do not need a name for the head struct. So clean up everything, not giving a name except in the rare case where it is necessary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-10-02test-rcu-list: access n_reclaims and n_nodes_removed with atomic64Emilio G. Cota
To avoid undefined behaviour. Note that these "atomics" are atomic in the "access once" sense. The variables are updated by a single thread at a time, so no "full" atomics are necessary. Signed-off-by: Emilio G. Cota <cota@braap.org> Message-Id: <20180910232752.31565-6-cota@braap.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-08-23tests: add test-rcu-tailqEmilio G. Cota
Signed-off-by: Emilio G. Cota <cota@braap.org> Message-Id: <20180819091335.22863-10-cota@braap.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-08-23tests: add test-list-simpleqEmilio G. Cota
Signed-off-by: Emilio G. Cota <cota@braap.org> Message-Id: <20180819091335.22863-9-cota@braap.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-08-23test-rcu-list: abstract the list implementationEmilio G. Cota
So that we can test other implementations. Signed-off-by: Emilio G. Cota <cota@braap.org> Message-Id: <20180819091335.22863-8-cota@braap.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-08-23test-rcu-list: access goflag with atomicsEmilio G. Cota
Instead of declaring it volatile. Signed-off-by: Emilio G. Cota <cota@braap.org> Message-Id: <20180819091335.22863-6-cota@braap.org> 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-07-24rcu: actually register threads that have RCU read-side critical sectionsPaolo Bonzini
Otherwise, grace periods are detected too early! Signed-off-by: Paolo Bonzini <pbonzini@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-16rcu: introduce RCU-enabled QLISTMike Day
Add RCU-enabled variants on the existing bsd DQ facility. Each operation has the same interface as the existing (non-RCU) version. Also, each operation is implemented as macro. Using the RCU-enabled QLIST, existing QLIST users will be able to convert to RCU without using a different list interface. Signed-off-by: Mike Day <ncmike@ncultra.org> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>