From: kernel test robot <lkp@intel.com>
To: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
martin.lau@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, andrii@kernel.org, kernel-team@meta.com
Subject: Re: [PATCH bpf-next] bpf: consistently use bpf_rcu_lock_held() everywhere
Date: Sat, 11 Oct 2025 22:24:41 +0800 [thread overview]
Message-ID: <202510112101.pygcEmGf-lkp@intel.com> (raw)
In-Reply-To: <20251010173021.3952776-1-andrii@kernel.org>
Hi Andrii,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Andrii-Nakryiko/bpf-consistently-use-bpf_rcu_lock_held-everywhere/20251011-013430
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20251010173021.3952776-1-andrii%40kernel.org
patch subject: [PATCH bpf-next] bpf: consistently use bpf_rcu_lock_held() everywhere
config: i386-buildonly-randconfig-001-20251011 (https://download.01.org/0day-ci/archive/20251011/202510112101.pygcEmGf-lkp@intel.com/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251011/202510112101.pygcEmGf-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510112101.pygcEmGf-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/workqueue.h:17,
from include/linux/bpf.h:11,
from include/linux/bpf_verifier.h:7,
from net/core/filter.c:21:
include/linux/bpf_local_storage.h: In function 'bpf_local_storage_lookup':
>> include/linux/bpf_local_storage.h:149:39: error: implicit declaration of function 'bpf_rcu_lock_held'; did you mean 'rcu_read_lock_held'? [-Werror=implicit-function-declaration]
149 | bpf_rcu_lock_held());
| ^~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:399:53: note: in definition of macro 'RCU_LOCKDEP_WARN'
399 | if (debug_lockdep_rcu_enabled() && (c) && \
| ^
include/linux/rcupdate.h:680:9: note: in expansion of macro '__rcu_dereference_check'
680 | __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf_local_storage.h:148:17: note: in expansion of macro 'rcu_dereference_check'
148 | sdata = rcu_dereference_check(local_storage->cache[smap->cache_idx],
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +149 include/linux/bpf_local_storage.h
450af8d0f6be2e KP Singh 2020-08-25 129
c83597fa5dc6b3 Yonghong Song 2022-10-25 130 struct bpf_map *
c83597fa5dc6b3 Yonghong Song 2022-10-25 131 bpf_local_storage_map_alloc(union bpf_attr *attr,
08a7ce384e33e5 Martin KaFai Lau 2023-03-22 132 struct bpf_local_storage_cache *cache,
08a7ce384e33e5 Martin KaFai Lau 2023-03-22 133 bool bpf_ma);
450af8d0f6be2e KP Singh 2020-08-25 134
68bc61c26cacf1 Marco Elver 2024-02-07 135 void __bpf_local_storage_insert_cache(struct bpf_local_storage *local_storage,
68bc61c26cacf1 Marco Elver 2024-02-07 136 struct bpf_local_storage_map *smap,
68bc61c26cacf1 Marco Elver 2024-02-07 137 struct bpf_local_storage_elem *selem);
68bc61c26cacf1 Marco Elver 2024-02-07 138 /* If cacheit_lockit is false, this lookup function is lockless */
68bc61c26cacf1 Marco Elver 2024-02-07 139 static inline struct bpf_local_storage_data *
450af8d0f6be2e KP Singh 2020-08-25 140 bpf_local_storage_lookup(struct bpf_local_storage *local_storage,
450af8d0f6be2e KP Singh 2020-08-25 141 struct bpf_local_storage_map *smap,
68bc61c26cacf1 Marco Elver 2024-02-07 142 bool cacheit_lockit)
68bc61c26cacf1 Marco Elver 2024-02-07 143 {
68bc61c26cacf1 Marco Elver 2024-02-07 144 struct bpf_local_storage_data *sdata;
68bc61c26cacf1 Marco Elver 2024-02-07 145 struct bpf_local_storage_elem *selem;
68bc61c26cacf1 Marco Elver 2024-02-07 146
68bc61c26cacf1 Marco Elver 2024-02-07 147 /* Fast path (cache hit) */
68bc61c26cacf1 Marco Elver 2024-02-07 148 sdata = rcu_dereference_check(local_storage->cache[smap->cache_idx],
68bc61c26cacf1 Marco Elver 2024-02-07 @149 bpf_rcu_lock_held());
68bc61c26cacf1 Marco Elver 2024-02-07 150 if (sdata && rcu_access_pointer(sdata->smap) == smap)
68bc61c26cacf1 Marco Elver 2024-02-07 151 return sdata;
68bc61c26cacf1 Marco Elver 2024-02-07 152
68bc61c26cacf1 Marco Elver 2024-02-07 153 /* Slow path (cache miss) */
68bc61c26cacf1 Marco Elver 2024-02-07 154 hlist_for_each_entry_rcu(selem, &local_storage->list, snode,
68bc61c26cacf1 Marco Elver 2024-02-07 155 rcu_read_lock_trace_held())
68bc61c26cacf1 Marco Elver 2024-02-07 156 if (rcu_access_pointer(SDATA(selem)->smap) == smap)
68bc61c26cacf1 Marco Elver 2024-02-07 157 break;
68bc61c26cacf1 Marco Elver 2024-02-07 158
68bc61c26cacf1 Marco Elver 2024-02-07 159 if (!selem)
68bc61c26cacf1 Marco Elver 2024-02-07 160 return NULL;
68bc61c26cacf1 Marco Elver 2024-02-07 161 if (cacheit_lockit)
68bc61c26cacf1 Marco Elver 2024-02-07 162 __bpf_local_storage_insert_cache(local_storage, smap, selem);
68bc61c26cacf1 Marco Elver 2024-02-07 163 return SDATA(selem);
68bc61c26cacf1 Marco Elver 2024-02-07 164 }
450af8d0f6be2e KP Singh 2020-08-25 165
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2025-10-11 14:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 17:30 [PATCH bpf-next] bpf: consistently use bpf_rcu_lock_held() everywhere Andrii Nakryiko
2025-10-11 14:24 ` kernel test robot [this message]
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=202510112101.pygcEmGf-lkp@intel.com \
--to=lkp@intel.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox