radix tree test suite: Register the main thread with the RCU library
Several test runners register individual worker threads with the RCU library, but neglect to register the main thread, which can lead to objects being freed while the main thread is in what appears to be an RCU critical section. Reported-by: Chris von Recklinghausen <crecklin@redhat.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
This commit is contained in:
parent
7487de534d
commit
1bb4bd266c
@ -577,6 +577,7 @@ void ida_tests(void)
|
|||||||
|
|
||||||
int __weak main(void)
|
int __weak main(void)
|
||||||
{
|
{
|
||||||
|
rcu_register_thread();
|
||||||
radix_tree_init();
|
radix_tree_init();
|
||||||
idr_checks();
|
idr_checks();
|
||||||
ida_tests();
|
ida_tests();
|
||||||
@ -584,5 +585,6 @@ int __weak main(void)
|
|||||||
rcu_barrier();
|
rcu_barrier();
|
||||||
if (nr_allocated)
|
if (nr_allocated)
|
||||||
printf("nr_allocated = %d\n", nr_allocated);
|
printf("nr_allocated = %d\n", nr_allocated);
|
||||||
|
rcu_unregister_thread();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,9 @@ void multiorder_checks(void)
|
|||||||
|
|
||||||
int __weak main(void)
|
int __weak main(void)
|
||||||
{
|
{
|
||||||
|
rcu_register_thread();
|
||||||
radix_tree_init();
|
radix_tree_init();
|
||||||
multiorder_checks();
|
multiorder_checks();
|
||||||
|
rcu_unregister_thread();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,13 @@ void xarray_tests(void)
|
|||||||
|
|
||||||
int __weak main(void)
|
int __weak main(void)
|
||||||
{
|
{
|
||||||
|
rcu_register_thread();
|
||||||
radix_tree_init();
|
radix_tree_init();
|
||||||
xarray_tests();
|
xarray_tests();
|
||||||
radix_tree_cpu_dead(1);
|
radix_tree_cpu_dead(1);
|
||||||
rcu_barrier();
|
rcu_barrier();
|
||||||
if (nr_allocated)
|
if (nr_allocated)
|
||||||
printf("nr_allocated = %d\n", nr_allocated);
|
printf("nr_allocated = %d\n", nr_allocated);
|
||||||
|
rcu_unregister_thread();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user