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
524}524}
525 525
526DEFINE_STATIC_SRCU(early_srcu);526DEFINE_STATIC_SRCU(early_srcu);
527static unsigned long early_srcu_cookie;
527 528
528struct early_boot_kfree_rcu {529struct early_boot_kfree_rcu {
529 struct rcu_head rh;530 struct rcu_head rh;
@@ -536,8 +537,10 @@ static void early_boot_test_call_rcu(void) · 6 unmodified lines
536 struct early_boot_kfree_rcu *rhp;537 struct early_boot_kfree_rcu *rhp;
537 538
538 call_rcu(&head, test_callback);539 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);
540 call_srcu(&early_srcu, &shead, test_callback);542 call_srcu(&early_srcu, &shead, test_callback);
543 }
541 rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);544 rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
542 if (!WARN_ON_ONCE(!rhp))545 if (!WARN_ON_ONCE(!rhp))
543 kfree_rcu(rhp, rh);546 kfree_rcu(rhp, rh);
@@ -563,6 +566,7 @@ static int rcu_verify_early_boot_tests(void) · 19 unmodified lines
563 if (IS_ENABLED(CONFIG_SRCU)) {566 if (IS_ENABLED(CONFIG_SRCU)) {
564 early_boot_test_counter++;567 early_boot_test_counter++;
565 srcu_barrier(&early_srcu);568 srcu_barrier(&early_srcu);
569 WARN_ON_ONCE(!poll_state_synchronize_srcu(&early_srcu, early_srcu_cookie));
566 }570 }
567 }571 }
568 if (rcu_self_test_counter != early_boot_test_counter) {572 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