All of lore.kernel.org
 help / color / mirror / Atom feed
* get_state_synchronize_rcu() at boot time
@ 2022-11-25 16:05 Paul E. McKenney
  2022-11-25 18:33 ` Uladzislau Rezki
  0 siblings, 1 reply; 6+ messages in thread
From: Paul E. McKenney @ 2022-11-25 16:05 UTC (permalink / raw)
  To: urezki; +Cc: rcu

Hello, Uladzislau,

Here is where I placed that probe code and the corresponding output.
Where should I be placing it instead?

						Thanx, Paul

------------------------------------------------------------------------

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 219b4b516f387..308cbc5e68a64 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -4546,8 +4546,17 @@ void rcu_scheduler_starting(void)
 	local_irq_restore(flags);
 
 	// Switch out of early boot mode.
+	pr_err("-> [%d] Invoke synchronize_rcu(): seq number: %lu\n", current->pid, get_state_synchronize_rcu());
+	synchronize_rcu();
+	pr_err("-> [%d] Done. A seq number: %lu\n", current->pid, get_state_synchronize_rcu());
 	rcu_scheduler_active = RCU_SCHEDULER_INIT;
+	pr_err("-> [%d] Invoke synchronize_rcu(): seq number: %lu\n", current->pid, get_state_synchronize_rcu());
+	synchronize_rcu();
+	pr_err("-> [%d] Done. A seq number: %lu\n", current->pid, get_state_synchronize_rcu());
 	rcu_test_sync_prims();
+	pr_err("-> [%d] Invoke synchronize_rcu(): seq number: %lu\n", current->pid, get_state_synchronize_rcu());
+	synchronize_rcu();
+	pr_err("-> [%d] Done. A seq number: %lu\n", current->pid, get_state_synchronize_rcu());
 }
 
 /*
@@ -4817,6 +4826,9 @@ void __init rcu_init(void)
 
 	kfree_rcu_batch_init();
 	rcu_bootup_announce();
+	pr_err("-> [%d] Invoke synchronize_rcu(): seq number: %lu\n", current->pid, get_state_synchronize_rcu());
+	synchronize_rcu();
+	pr_err("-> [%d] Done. A seq number: %lu\n", current->pid, get_state_synchronize_rcu());
 	sanitize_kthread_prio();
 	rcu_init_geometry();
 	rcu_init_one();
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 7b1e183b0eb23..2993be46f81d5 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -557,9 +557,12 @@ struct early_boot_kfree_rcu {
 static void early_boot_test_call_rcu(void)
 {
 	static struct rcu_head head;
+	int idx;
 	static struct rcu_head shead;
 	struct early_boot_kfree_rcu *rhp;
 
+	idx = srcu_down_read(&early_srcu);
+	srcu_up_read(&early_srcu, idx);
 	call_rcu(&head, test_callback);
 	early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu);
 	call_srcu(&early_srcu, &shead, test_callback);

------------------------------------------------------------------------

[    0.016333] rcu: -> [0] Invoke synchronize_rcu(): seq number: 12
[    0.016334] rcu: -> [0] Done. A seq number: 16
[    0.114209] rcu: -> [0] Invoke synchronize_rcu(): seq number: 32
[    0.114662] rcu: -> [0] Done. A seq number: 36
[    0.115191] rcu: -> [0] Invoke synchronize_rcu(): seq number: 36
[    0.115684] rcu: -> [0] Done. A seq number: 40
[    0.116046] rcu: -> [0] Invoke synchronize_rcu(): seq number: 48
[    0.116202] rcu: -> [0] Done. A seq number: 52

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-26  2:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-25 16:05 get_state_synchronize_rcu() at boot time Paul E. McKenney
2022-11-25 18:33 ` Uladzislau Rezki
2022-11-25 18:45   ` Paul E. McKenney
2022-11-25 20:17     ` Paul E. McKenney
2022-11-26  1:38       ` Joel Fernandes
2022-11-26  2:25         ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.