CC: [email protected]
CC: [email protected]
TO: Song Liu <[email protected]>
CC: Daniel Borkmann <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   7c60610d476766e128cc4284bb6349732cbd6606
commit: 39d8f0d1026a990604770a658708f5845f7dbec0 bpf: Use raw_spin_trylock() 
for pcpu_freelist_push/pop in NMI
date:   11 months ago
:::::: branch date: 12 hours ago
:::::: commit date: 11 months ago
config: ia64-randconfig-s032-20210816 (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-348-gf0e6938b-dirty
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=39d8f0d1026a990604770a658708f5845f7dbec0
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 39d8f0d1026a990604770a658708f5845f7dbec0
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 
SHELL=/bin/bash kernel/bpf/

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/bpf/percpu_freelist.c:176:17: sparse: sparse: context imbalance in 
>> '___pcpu_freelist_pop_nmi' - different lock contexts for basic block

vim +/___pcpu_freelist_pop_nmi +176 kernel/bpf/percpu_freelist.c

39d8f0d1026a99 Song Liu           2020-10-05  156  
39d8f0d1026a99 Song Liu           2020-10-05  157  static struct 
pcpu_freelist_node *
39d8f0d1026a99 Song Liu           2020-10-05  158  
___pcpu_freelist_pop_nmi(struct pcpu_freelist *s)
39d8f0d1026a99 Song Liu           2020-10-05  159  {
39d8f0d1026a99 Song Liu           2020-10-05  160       struct 
pcpu_freelist_head *head;
39d8f0d1026a99 Song Liu           2020-10-05  161       struct 
pcpu_freelist_node *node;
39d8f0d1026a99 Song Liu           2020-10-05  162       int orig_cpu, cpu;
39d8f0d1026a99 Song Liu           2020-10-05  163  
39d8f0d1026a99 Song Liu           2020-10-05  164       orig_cpu = cpu = 
raw_smp_processor_id();
39d8f0d1026a99 Song Liu           2020-10-05  165       while (1) {
39d8f0d1026a99 Song Liu           2020-10-05  166               head = 
per_cpu_ptr(s->freelist, cpu);
39d8f0d1026a99 Song Liu           2020-10-05  167               if 
(raw_spin_trylock(&head->lock)) {
39d8f0d1026a99 Song Liu           2020-10-05  168                       node = 
head->first;
39d8f0d1026a99 Song Liu           2020-10-05  169                       if 
(node) {
39d8f0d1026a99 Song Liu           2020-10-05  170                               
head->first = node->next;
39d8f0d1026a99 Song Liu           2020-10-05  171                               
raw_spin_unlock(&head->lock);
39d8f0d1026a99 Song Liu           2020-10-05  172                               
return node;
39d8f0d1026a99 Song Liu           2020-10-05  173                       }
39d8f0d1026a99 Song Liu           2020-10-05  174                       
raw_spin_unlock(&head->lock);
39d8f0d1026a99 Song Liu           2020-10-05  175               }
39d8f0d1026a99 Song Liu           2020-10-05 @176               cpu = 
cpumask_next(cpu, cpu_possible_mask);
39d8f0d1026a99 Song Liu           2020-10-05  177               if (cpu >= 
nr_cpu_ids)
39d8f0d1026a99 Song Liu           2020-10-05  178                       cpu = 0;
39d8f0d1026a99 Song Liu           2020-10-05  179               if (cpu == 
orig_cpu)
39d8f0d1026a99 Song Liu           2020-10-05  180                       break;
39d8f0d1026a99 Song Liu           2020-10-05  181       }
39d8f0d1026a99 Song Liu           2020-10-05  182  
39d8f0d1026a99 Song Liu           2020-10-05  183       /* cannot pop from per 
cpu lists, try extralist */
39d8f0d1026a99 Song Liu           2020-10-05  184       if 
(!raw_spin_trylock(&s->extralist.lock))
e19494edab82f5 Alexei Starovoitov 2016-03-07  185               return NULL;
39d8f0d1026a99 Song Liu           2020-10-05  186       node = 
s->extralist.first;
39d8f0d1026a99 Song Liu           2020-10-05  187       if (node)
39d8f0d1026a99 Song Liu           2020-10-05  188               
s->extralist.first = node->next;
39d8f0d1026a99 Song Liu           2020-10-05  189       
raw_spin_unlock(&s->extralist.lock);
39d8f0d1026a99 Song Liu           2020-10-05  190       return node;
e19494edab82f5 Alexei Starovoitov 2016-03-07  191  }
39d8f0d1026a99 Song Liu           2020-10-05  192  

---
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