CC: [email protected]
TO: Frederic Weisbecker <[email protected]>

tree:   
https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git 
rcu/dev-v2
head:   925ee3076eb694db893e2c6664d90ad8fb9cb6e5
commit: 5530b1d0d6817b6a7a51665390eb20cd25919ddf [5/13] rcu/nocb: Merge 
nocb_timer to the rdp leader
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: x86_64-randconfig-s032-20210222 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-229-g60c1f270-dirty
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git/commit/?id=5530b1d0d6817b6a7a51665390eb20cd25919ddf
        git remote add dynticks 
https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
        git fetch --no-tags dynticks rcu/dev-v2
        git checkout 5530b1d0d6817b6a7a51665390eb20cd25919ddf
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


"sparse warnings: (new ones prefixed by >>)"
   kernel/rcu/tree.c: note: in included file:
   kernel/rcu/tree_plugin.h:1561:5: sparse: sparse: symbol 
'nocb_nobypass_lim_per_jiffy' was not declared. Should it be static?
   kernel/rcu/tree.c:1455:9: sparse: sparse: context imbalance in 
'rcu_start_this_gp' - different lock contexts for basic block
   kernel/rcu/tree.c:1867:9: sparse: sparse: context imbalance in 'rcu_gp_init' 
- different lock contexts for basic block
   kernel/rcu/tree.c:2646:9: sparse: sparse: context imbalance in 
'force_qs_rnp' - different lock contexts for basic block
   kernel/rcu/tree.c:2699:25: sparse: sparse: context imbalance in 
'rcu_force_quiescent_state' - unexpected unlock
   kernel/rcu/tree.c:2729:30: sparse: sparse: context imbalance in 'rcu_core' - 
different lock contexts for basic block
   kernel/rcu/tree.c: note: in included file:
   kernel/rcu/tree_stall.h:318:9: sparse: sparse: context imbalance in 
'rcu_print_task_stall' - unexpected unlock
   kernel/rcu/tree_stall.h:540:9: sparse: sparse: context imbalance in 
'print_other_cpu_stall' - different lock contexts for basic block
   kernel/rcu/tree_stall.h:821:17: sparse: sparse: context imbalance in 
'rcu_check_gp_start_stall' - different lock contexts for basic block
   kernel/rcu/tree.c: note: in included file:
   kernel/rcu/tree_exp.h:189:9: sparse: sparse: context imbalance in 
'__rcu_report_exp_rnp' - different lock contexts for basic block
   kernel/rcu/tree.c: note: in included file:
   kernel/rcu/tree_plugin.h:1607:16: sparse: sparse: context imbalance in 
'rcu_nocb_bypass_trylock' - wrong count at exit
   kernel/rcu/tree_plugin.h:1624:13: sparse: sparse: context imbalance in 
'rcu_nocb_lock' - wrong count at exit
   kernel/rcu/tree_plugin.h:1639:17: sparse: sparse: context imbalance in 
'rcu_nocb_unlock' - unexpected unlock
   kernel/rcu/tree_plugin.h:1652:17: sparse: sparse: context imbalance in 
'rcu_nocb_unlock_irqrestore' - unexpected unlock
   kernel/rcu/tree_plugin.h:1784:9: sparse: sparse: context imbalance in 
'rcu_nocb_do_flush_bypass' - unexpected unlock
   kernel/rcu/tree_plugin.h:1799:13: sparse: sparse: context imbalance in 
'rcu_nocb_flush_bypass' - wrong count at exit
   kernel/rcu/tree_plugin.h:1961:13: sparse: sparse: context imbalance in 
'__call_rcu_nocb_wake' - wrong count at exit
   kernel/rcu/tree_plugin.h:2030:9: sparse: sparse: context imbalance in 
'do_nocb_bypass_wakeup_timer' - different lock contexts for basic block
   kernel/rcu/tree_plugin.h:2107:9: sparse: sparse: context imbalance in 
'nocb_gp_wait' - different lock contexts for basic block
   kernel/rcu/tree_plugin.h:2329:9: sparse: sparse: context imbalance in 
'nocb_cb_wait' - wrong count at exit
   kernel/rcu/tree_plugin.h:2445:9: sparse: sparse: context imbalance in 
'rdp_offload_toggle' - wrong count at exit
>> kernel/rcu/tree_plugin.h:2483:32: sparse: sparse: context imbalance in 
>> 'rcu_nocb_rdp_deoffload' - different lock contexts for basic block

vim +/rcu_nocb_rdp_deoffload +2483 kernel/rcu/tree_plugin.h

254e11efde66ca0 Frederic Weisbecker 2020-11-13  2447  
d5583036705d111 Frederic Weisbecker 2021-01-28  2448  static long 
rcu_nocb_rdp_deoffload(void *arg)
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2449  {
d5583036705d111 Frederic Weisbecker 2021-01-28  2450    struct rcu_data *rdp = 
arg;
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2451    struct rcu_segcblist 
*cblist = &rdp->cblist;
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2452    unsigned long flags;
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2453    int ret;
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2454  
d5583036705d111 Frederic Weisbecker 2021-01-28  2455    WARN_ON_ONCE(rdp->cpu 
!= raw_smp_processor_id());
d5583036705d111 Frederic Weisbecker 2021-01-28  2456  
f759081e8f5ac64 Paul E. McKenney    2020-12-21  2457    pr_info("De-offloading 
%d\n", rdp->cpu);
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2458  
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2459    
rcu_nocb_lock_irqsave(rdp, flags);
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2460    /*
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2461     * Flush once and for 
all now. This suffices because we are
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2462     * running on the 
target CPU holding ->nocb_lock (thus having
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2463     * interrupts 
disabled), and because rdp_offload_toggle()
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2464     * invokes 
rcu_segcblist_offload(), which clears SEGCBLIST_OFFLOADED.
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2465     * Thus future calls to 
rcu_segcblist_completely_offloaded() will
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2466     * return false, which 
means that future calls to rcu_nocb_try_bypass()
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2467     * will refuse to put 
anything into the bypass.
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2468     */
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2469    
WARN_ON_ONCE(!rcu_nocb_flush_bypass(rdp, NULL, jiffies));
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2470    ret = 
rdp_offload_toggle(rdp, false, flags);
5bb39dc956f3d4f Frederic Weisbecker 2020-11-13  2471    
swait_event_exclusive(rdp->nocb_state_wq,
5bb39dc956f3d4f Frederic Weisbecker 2020-11-13  2472                          
!rcu_segcblist_test_flags(cblist, SEGCBLIST_KTHREAD_CB |
5bb39dc956f3d4f Frederic Weisbecker 2020-11-13  2473                            
                        SEGCBLIST_KTHREAD_GP));
314202f84ddd61e Frederic Weisbecker 2020-11-13  2474    /*
5530b1d0d6817b6 Frederic Weisbecker 2021-01-22  2475     * Lock one last time 
to acquire latest callback updates from kthreads
5530b1d0d6817b6 Frederic Weisbecker 2021-01-22  2476     * so we can later 
handle callbacks locally without locking.
314202f84ddd61e Frederic Weisbecker 2020-11-13  2477     */
314202f84ddd61e Frederic Weisbecker 2020-11-13  2478    
rcu_nocb_lock_irqsave(rdp, flags);
5530b1d0d6817b6 Frederic Weisbecker 2021-01-22  2479    /*
5530b1d0d6817b6 Frederic Weisbecker 2021-01-22  2480     * Theoretically we 
could set SEGCBLIST_SOFTIRQ_ONLY after the nocb
5530b1d0d6817b6 Frederic Weisbecker 2021-01-22  2481     * lock is released but 
how about being paranoid for once?
5530b1d0d6817b6 Frederic Weisbecker 2021-01-22  2482     */
b9ced9e1ab51ed6 Frederic Weisbecker 2020-11-13 @2483    
rcu_segcblist_set_flags(cblist, SEGCBLIST_SOFTIRQ_ONLY);
b9ced9e1ab51ed6 Frederic Weisbecker 2020-11-13  2484    /*
b9ced9e1ab51ed6 Frederic Weisbecker 2020-11-13  2485     * With 
SEGCBLIST_SOFTIRQ_ONLY, we can't use
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2486     * 
rcu_nocb_unlock_irqrestore() anymore.
b9ced9e1ab51ed6 Frederic Weisbecker 2020-11-13  2487     */
b9ced9e1ab51ed6 Frederic Weisbecker 2020-11-13  2488    
raw_spin_unlock_irqrestore(&rdp->nocb_lock, flags);
314202f84ddd61e Frederic Weisbecker 2020-11-13  2489  
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2490    /* Sanity check */
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2491    
WARN_ON_ONCE(rcu_cblist_n_cbs(&rdp->nocb_bypass));
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2492  
5e04f21e88df8ce Frederic Weisbecker 2021-01-20  2493  
254e11efde66ca0 Frederic Weisbecker 2020-11-13  2494    return ret;
d97b078182406c0 Frederic Weisbecker 2020-11-13  2495  }
d97b078182406c0 Frederic Weisbecker 2020-11-13  2496  

:::::: The code at line 2483 was first introduced by commit
:::::: b9ced9e1ab51ed6057ac8198fd1eeb404a32a867 rcu/nocb: Set 
SEGCBLIST_SOFTIRQ_ONLY at the very last stage of de-offloading

:::::: TO: Frederic Weisbecker <[email protected]>
:::::: CC: Paul E. McKenney <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to