History

srcu: Early test SRCU polling start

Place an early call to start_poll_synchronize_srcu() before the invocation of call_srcu() on the same srcu_struct structure. After the later call to srcu_barrier(), the completion of the first grace period should be visible to a subsequent invocation of poll_state_synchronize_srcu(), and if not, warn.

Frederic Weisbecker committed 5 years ago

Commit 0a580fa1 parent b5befe81 file · +5 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/rcu/update.c+5−1
@@ -524,6 +524,7 @@ static void test_callback(struct rcu_head *r) · 523 unmodified lines
524524 }
525525
526526 DEFINE_STATIC_SRCU(early_srcu);
527+static unsigned long early_srcu_cookie;
527528
528529 struct early_boot_kfree_rcu {
529530 struct rcu_head rh;
@@ -536,8 +537,10 @@ static void early_boot_test_call_rcu(void) · 6 unmodified lines
536537 struct early_boot_kfree_rcu *rhp;
537538
538539 call_rcu(&head, test_callback);
539− if (IS_ENABLED(CONFIG_SRCU))
540+ if (IS_ENABLED(CONFIG_SRCU)) {
541+ early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu);
540542 call_srcu(&early_srcu, &shead, test_callback);
543+ }
541544 rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
542545 if (!WARN_ON_ONCE(!rhp))
543546 kfree_rcu(rhp, rh);
@@ -563,6 +566,7 @@ static int rcu_verify_early_boot_tests(void) · 19 unmodified lines
563566 if (IS_ENABLED(CONFIG_SRCU)) {
564567 early_boot_test_counter++;
565568 srcu_barrier(&early_srcu);
569+ WARN_ON_ONCE(!poll_state_synchronize_srcu(&early_srcu, early_srcu_cookie));
566570 }
567571 }
568572 if (rcu_self_test_counter != early_boot_test_counter) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t