
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 43d8c124ec4624389b14d42595e5f0195e3e5a1d commit: ef015dbb4151c10d0415045f9d0fcf3dc85063d7 [2679/2679] bpf-rvi: pidns: Add for_each_task_in_pidns and loadavg-related kfuncs config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20250815/202508150150.V6YiO7Tg-lkp@i...) compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250815/202508150150.V6YiO7Tg-lkp@i...) 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/202508150150.V6YiO7Tg-lkp@intel.com/ All warnings (new ones prefixed by >>): kernel/bpf-rvi/common_kfuncs.c:15:32: warning: no previous prototype for function 'bpf_mem_cgroup_from_task' [-Wmissing-prototypes] 15 | __bpf_kfunc struct mem_cgroup *bpf_mem_cgroup_from_task(struct task_struct *p) | ^ kernel/bpf-rvi/common_kfuncs.c:15:13: note: declare 'static' if the function is not intended to be used outside of this translation unit 15 | __bpf_kfunc struct mem_cgroup *bpf_mem_cgroup_from_task(struct task_struct *p) | ^ | static
kernel/bpf-rvi/common_kfuncs.c:24:35: warning: no previous prototype for function 'bpf_task_active_pid_ns' [-Wmissing-prototypes] 24 | __bpf_kfunc struct pid_namespace *bpf_task_active_pid_ns(struct task_struct *task) | ^ kernel/bpf-rvi/common_kfuncs.c:24:13: note: declare 'static' if the function is not intended to be used outside of this translation unit 24 | __bpf_kfunc struct pid_namespace *bpf_task_active_pid_ns(struct task_struct *task) | ^ | static kernel/bpf-rvi/common_kfuncs.c:29:17: warning: no previous prototype for function 'bpf_pidns_nr_tasks' [-Wmissing-prototypes] 29 | __bpf_kfunc u64 bpf_pidns_nr_tasks(struct pid_namespace *ns) | ^ kernel/bpf-rvi/common_kfuncs.c:29:13: note: declare 'static' if the function is not intended to be used outside of this translation unit 29 | __bpf_kfunc u64 bpf_pidns_nr_tasks(struct pid_namespace *ns) | ^ | static kernel/bpf-rvi/common_kfuncs.c:43:17: warning: no previous prototype for function 'bpf_pidns_last_pid' [-Wmissing-prototypes] 43 | __bpf_kfunc u32 bpf_pidns_last_pid(struct pid_namespace *ns) | ^ kernel/bpf-rvi/common_kfuncs.c:43:13: note: declare 'static' if the function is not intended to be used outside of this translation unit 43 | __bpf_kfunc u32 bpf_pidns_last_pid(struct pid_namespace *ns) | ^ | static 4 warnings generated.
vim +/bpf_task_active_pid_ns +24 kernel/bpf-rvi/common_kfuncs.c 19 20 /* 21 * Loadavg related kfuncs 22 */ 23
24 __bpf_kfunc struct pid_namespace *bpf_task_active_pid_ns(struct task_struct *task) 25 { 26 return task_active_pid_ns(task); 27 } 28 29 __bpf_kfunc u64 bpf_pidns_nr_tasks(struct pid_namespace *ns) 30 { 31 struct pid_iter iter = {}; 32 u32 nr_running = 0, nr_threads = 0; 33 34 for_each_task_in_pidns(iter, ns) { 35 nr_threads++; 36 if (task_is_running(iter.task)) 37 nr_running++; 38 } 39 40 return (u64)nr_running << 32 | nr_threads; 41 } 42 43 __bpf_kfunc u32 bpf_pidns_last_pid(struct pid_namespace *ns) 44 { 45 return idr_get_cursor(&ns->idr) - 1; 46 } 47
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki