* Re: [PATCH bpf-next v3 2/6] bpf: Allow per unit prefill for non-fix-size percpu memory allocator
[not found] <20231216023015.3741144-1-yonghong.song@linux.dev>
@ 2023-12-16 15:27 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-16 15:27 UTC (permalink / raw)
To: Yonghong Song, bpf
Cc: llvm, oe-kbuild-all, Alexei Starovoitov, Andrii Nakryiko,
Daniel Borkmann, kernel-team, Martin KaFai Lau
Hi Yonghong,
kernel test robot noticed the following build warnings:
[auto build test WARNING on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Yonghong-Song/bpf-Avoid-unnecessary-extra-percpu-memory-allocation/20231216-103310
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20231216023015.3741144-1-yonghong.song%40linux.dev
patch subject: [PATCH bpf-next v3 2/6] bpf: Allow per unit prefill for non-fix-size percpu memory allocator
config: x86_64-randconfig-003-20231216 (https://download.01.org/0day-ci/archive/20231216/202312162351.UuoFmjJk-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231216/202312162351.UuoFmjJk-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/202312162351.UuoFmjJk-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/bpf/memalloc.c:665:14: warning: variable 'objcg' is uninitialized when used here [-Wuninitialized]
c->objcg = objcg;
^~~~~
kernel/bpf/memalloc.c:642:26: note: initialize the variable 'objcg' to silence this warning
struct obj_cgroup *objcg;
^
= NULL
1 warning generated.
vim +/objcg +665 kernel/bpf/memalloc.c
637
638 int bpf_mem_alloc_percpu_unit_init(struct bpf_mem_alloc *ma, int size)
639 {
640 int cpu, i, err = 0, unit_size, percpu_size;
641 struct bpf_mem_caches *cc, __percpu *pcc;
642 struct obj_cgroup *objcg;
643 struct bpf_mem_cache *c;
644
645 i = bpf_mem_cache_idx(size);
646 if (i < 0)
647 return -EINVAL;
648
649 /* room for llist_node and per-cpu pointer */
650 percpu_size = LLIST_NODE_SZ + sizeof(void *);
651
652 pcc = ma->caches;
653 unit_size = sizes[i];
654
655 #ifdef CONFIG_MEMCG_KMEM
656 objcg = get_obj_cgroup_from_current();
657 #endif
658 for_each_possible_cpu(cpu) {
659 cc = per_cpu_ptr(pcc, cpu);
660 c = &cc->cache[i];
661 if (cpu == 0 && c->unit_size)
662 goto out;
663
664 c->unit_size = unit_size;
> 665 c->objcg = objcg;
666 c->percpu_size = percpu_size;
667 c->tgt = c;
668
669 init_refill_work(c);
670 prefill_mem_cache(c, cpu);
671
672 if (cpu == 0) {
673 err = check_obj_size(c, i);
674 if (err) {
675 drain_mem_cache(c);
676 memset(c, 0, sizeof(*c));
677 goto out;
678 }
679 }
680 }
681
682 out:
683 return err;
684 }
685
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-16 15:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231216023015.3741144-1-yonghong.song@linux.dev>
2023-12-16 15:27 ` [PATCH bpf-next v3 2/6] bpf: Allow per unit prefill for non-fix-size percpu memory allocator kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox