@@ -1903,6 +1903,7 @@ rcutorture_loop_extend(int *readstate, struct torture_random_state *trsp,
1903
1903
*/
1904
1904
static bool rcu_torture_one_read (struct torture_random_state * trsp , long myid )
1905
1905
{
1906
+ bool checkpolling = !(torture_random (trsp ) & 0xfff );
1906
1907
unsigned long cookie ;
1907
1908
struct rcu_gp_oldstate cookie_full ;
1908
1909
int i ;
@@ -1920,10 +1921,12 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp, long myid)
1920
1921
WARN_ON_ONCE (!rcu_is_watching ());
1921
1922
newstate = rcutorture_extend_mask (readstate , trsp );
1922
1923
rcutorture_one_extend (& readstate , newstate , trsp , rtrsp ++ );
1923
- if (cur_ops -> get_gp_state && cur_ops -> poll_gp_state )
1924
- cookie = cur_ops -> get_gp_state ();
1925
- if (cur_ops -> get_gp_state_full && cur_ops -> poll_gp_state_full )
1926
- cur_ops -> get_gp_state_full (& cookie_full );
1924
+ if (checkpolling ) {
1925
+ if (cur_ops -> get_gp_state && cur_ops -> poll_gp_state )
1926
+ cookie = cur_ops -> get_gp_state ();
1927
+ if (cur_ops -> get_gp_state_full && cur_ops -> poll_gp_state_full )
1928
+ cur_ops -> get_gp_state_full (& cookie_full );
1929
+ }
1927
1930
started = cur_ops -> get_gp_seq ();
1928
1931
ts = rcu_trace_clock_local ();
1929
1932
p = rcu_dereference_check (rcu_torture_current ,
@@ -1957,20 +1960,22 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp, long myid)
1957
1960
}
1958
1961
__this_cpu_inc (rcu_torture_batch [completed ]);
1959
1962
preempt_enable ();
1960
- if (cur_ops -> get_gp_state && cur_ops -> poll_gp_state )
1961
- WARN_ONCE (cur_ops -> poll_gp_state (cookie ),
1962
- "%s: Cookie check 2 failed %s(%d) %lu->%lu\n" ,
1963
- __func__ ,
1964
- rcu_torture_writer_state_getname (),
1965
- rcu_torture_writer_state ,
1966
- cookie , cur_ops -> get_gp_state ());
1967
- if (cur_ops -> get_gp_state_full && cur_ops -> poll_gp_state_full )
1968
- WARN_ONCE (cur_ops -> poll_gp_state_full (& cookie_full ),
1969
- "%s: Cookie check 6 failed %s(%d) online %*pbl\n" ,
1970
- __func__ ,
1971
- rcu_torture_writer_state_getname (),
1972
- rcu_torture_writer_state ,
1973
- cpumask_pr_args (cpu_online_mask ));
1963
+ if (checkpolling ) {
1964
+ if (cur_ops -> get_gp_state && cur_ops -> poll_gp_state )
1965
+ WARN_ONCE (cur_ops -> poll_gp_state (cookie ),
1966
+ "%s: Cookie check 2 failed %s(%d) %lu->%lu\n" ,
1967
+ __func__ ,
1968
+ rcu_torture_writer_state_getname (),
1969
+ rcu_torture_writer_state ,
1970
+ cookie , cur_ops -> get_gp_state ());
1971
+ if (cur_ops -> get_gp_state_full && cur_ops -> poll_gp_state_full )
1972
+ WARN_ONCE (cur_ops -> poll_gp_state_full (& cookie_full ),
1973
+ "%s: Cookie check 6 failed %s(%d) online %*pbl\n" ,
1974
+ __func__ ,
1975
+ rcu_torture_writer_state_getname (),
1976
+ rcu_torture_writer_state ,
1977
+ cpumask_pr_args (cpu_online_mask ));
1978
+ }
1974
1979
rcutorture_one_extend (& readstate , 0 , trsp , rtrsp );
1975
1980
WARN_ON_ONCE (readstate );
1976
1981
// This next splat is expected behavior if leakpointer, especially
0 commit comments