Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rcutorture: Test srcu_expedite_current()

This commit adds a ->exp_current member to the rcu_torture_ops structure
to test the srcu_expedite_current() function.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <bpf@vger.kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>

authored by

Paul E. McKenney and committed by
Frederic Weisbecker
950063c6 34dc27f0

+12
+12
kernel/rcu/rcutorture.c
··· 389 389 void (*deferred_free)(struct rcu_torture *p); 390 390 void (*sync)(void); 391 391 void (*exp_sync)(void); 392 + void (*exp_current)(void); 392 393 unsigned long (*get_gp_state_exp)(void); 393 394 unsigned long (*start_gp_poll_exp)(void); 394 395 void (*start_gp_poll_exp_full)(struct rcu_gp_oldstate *rgosp); ··· 858 857 synchronize_srcu_expedited(srcu_ctlp); 859 858 } 860 859 860 + static void srcu_torture_expedite_current(void) 861 + { 862 + srcu_expedite_current(srcu_ctlp); 863 + } 864 + 861 865 static struct rcu_torture_ops srcu_ops = { 862 866 .ttype = SRCU_FLAVOR, 863 867 .init = rcu_sync_torture_init, ··· 877 871 .deferred_free = srcu_torture_deferred_free, 878 872 .sync = srcu_torture_synchronize, 879 873 .exp_sync = srcu_torture_synchronize_expedited, 874 + .exp_current = srcu_torture_expedite_current, 880 875 .same_gp_state = same_state_synchronize_srcu, 881 876 .get_comp_state = get_completed_synchronize_srcu, 882 877 .get_gp_state = srcu_torture_get_gp_state, ··· 926 919 .deferred_free = srcu_torture_deferred_free, 927 920 .sync = srcu_torture_synchronize, 928 921 .exp_sync = srcu_torture_synchronize_expedited, 922 + .exp_current = srcu_torture_expedite_current, 929 923 .same_gp_state = same_state_synchronize_srcu, 930 924 .get_comp_state = get_completed_synchronize_srcu, 931 925 .get_gp_state = srcu_torture_get_gp_state, ··· 1708 1700 ulo[i] = cur_ops->get_comp_state(); 1709 1701 gp_snap = cur_ops->start_gp_poll(); 1710 1702 rcu_torture_writer_state = RTWS_POLL_WAIT; 1703 + if (cur_ops->exp_current && !torture_random(&rand) % 0xff) 1704 + cur_ops->exp_current(); 1711 1705 while (!cur_ops->poll_gp_state(gp_snap)) { 1712 1706 gp_snap1 = cur_ops->get_gp_state(); 1713 1707 for (i = 0; i < ulo_size; i++) ··· 1730 1720 cur_ops->get_comp_state_full(&rgo[i]); 1731 1721 cur_ops->start_gp_poll_full(&gp_snap_full); 1732 1722 rcu_torture_writer_state = RTWS_POLL_WAIT_FULL; 1723 + if (cur_ops->exp_current && !torture_random(&rand) % 0xff) 1724 + cur_ops->exp_current(); 1733 1725 while (!cur_ops->poll_gp_state_full(&gp_snap_full)) { 1734 1726 cur_ops->get_gp_state_full(&gp_snap1_full); 1735 1727 for (i = 0; i < rgo_size; i++)