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

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
Loading
Loading
Loading
Loading
+42 −39
Original line number Diff line number Diff line
@@ -1868,7 +1868,11 @@ rcu_torture_stats(void *arg)
		torture_shutdown_absorb("rcu_torture_stats");
	} while (!torture_must_stop());
	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 kmem_cache *kcp;
@@ -1907,9 +1911,6 @@ rcu_torture_stats(void *arg)
	vfree(rhp);
}

	return 0;
}

static void
rcu_torture_print_module_parms(struct rcu_torture_ops *cur_ops, const char *tag)
{
@@ -2825,6 +2826,8 @@ rcu_torture_cleanup(void)
	if (cur_ops->cleanup != NULL)
		cur_ops->cleanup();

	rcu_torture_mem_dump_obj();

	rcu_torture_stats_print();  /* -After- the stats thread is stopped! */

	if (err_segs_recorded) {