Commit 7ab2bd31 authored by Paul E. McKenney's avatar Paul E. McKenney

rcutorture: Move mem_dump_obj() tests into separate function

To make the purpose of the code more apparent, this commit moves the
tests of mem_dump_obj() to a new rcu_torture_mem_dump_obj() function
and calls it from rcu_torture_cleanup().
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 3d78668e
...@@ -1868,8 +1868,12 @@ rcu_torture_stats(void *arg) ...@@ -1868,8 +1868,12 @@ rcu_torture_stats(void *arg)
torture_shutdown_absorb("rcu_torture_stats"); torture_shutdown_absorb("rcu_torture_stats");
} while (!torture_must_stop()); } while (!torture_must_stop());
torture_kthread_stopping("rcu_torture_stats"); torture_kthread_stopping("rcu_torture_stats");
return 0;
}
{ /* Test mem_dump_obj() and friends. */
static void rcu_torture_mem_dump_obj(void)
{
struct rcu_head *rhp; struct rcu_head *rhp;
struct kmem_cache *kcp; struct kmem_cache *kcp;
static int z; static int z;
...@@ -1905,9 +1909,6 @@ rcu_torture_stats(void *arg) ...@@ -1905,9 +1909,6 @@ rcu_torture_stats(void *arg)
pr_alert("mem_dump_obj(vmalloc %px):", &rhp->func); pr_alert("mem_dump_obj(vmalloc %px):", &rhp->func);
mem_dump_obj(&rhp->func); mem_dump_obj(&rhp->func);
vfree(rhp); vfree(rhp);
}
return 0;
} }
static void static void
...@@ -2825,6 +2826,8 @@ rcu_torture_cleanup(void) ...@@ -2825,6 +2826,8 @@ rcu_torture_cleanup(void)
if (cur_ops->cleanup != NULL) if (cur_ops->cleanup != NULL)
cur_ops->cleanup(); cur_ops->cleanup();
rcu_torture_mem_dump_obj();
rcu_torture_stats_print(); /* -After- the stats thread is stopped! */ rcu_torture_stats_print(); /* -After- the stats thread is stopped! */
if (err_segs_recorded) { if (err_segs_recorded) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment