From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: kernel/bpf/percpu_freelist.c:176:17: sparse: sparse: context imbalance in '___pcpu_freelist_pop_nmi' - different lock contexts for basic block
Date: Tue, 25 May 2021 17:11:46 +0800 [thread overview]
Message-ID: <202105251731.k4wwWRuY-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4604 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Song Liu <songliubraving@fb.com>
CC: Daniel Borkmann <daniel@iogearbox.net>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a050a6d2b7e80ca52b2f4141eaf3420d201b72b3
commit: 39d8f0d1026a990604770a658708f5845f7dbec0 bpf: Use raw_spin_trylock() for pcpu_freelist_push/pop in NMI
date: 8 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 8 months ago
config: ia64-randconfig-s032-20210525 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.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-341-g8af24329-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-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
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/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 26472 bytes --]
next reply other threads:[~2021-05-25 9:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 9:11 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-08-16 11:48 kernel/bpf/percpu_freelist.c:176:17: sparse: sparse: context imbalance in '___pcpu_freelist_pop_nmi' - different lock contexts for basic block kernel test robot
2021-04-25 5:05 kernel test robot
2021-03-23 9:22 kernel test robot
2021-02-27 20:29 kernel test robot
2021-02-04 6:27 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202105251731.k4wwWRuY-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.