tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: faa195bad3afed3c326917fb4cd36e0bd311220c commit: 5e4cec4acb12a17b26d4d2ae4c29eb29b017f854 [3098/3098] bpf-rvi: Add bpf_page_counter_read() kfunc config: x86_64-randconfig-001-20251104 (https://download.01.org/0day-ci/archive/20251105/202511050235.5PdxK5fh-lkp@i...) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251105/202511050235.5PdxK5fh-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/202511050235.5PdxK5fh-lkp@intel.com/ All warnings (new ones prefixed by >>): kernel/bpf-rvi/common_kfuncs.c:19:32: warning: no previous prototype for 'bpf_mem_cgroup_from_task' [-Wmissing-prototypes] 19 | __bpf_kfunc struct mem_cgroup *bpf_mem_cgroup_from_task(struct task_struct *p) | ^~~~~~~~~~~~~~~~~~~~~~~~ kernel/bpf-rvi/common_kfuncs.c:28:35: warning: no previous prototype for 'bpf_task_active_pid_ns' [-Wmissing-prototypes] 28 | __bpf_kfunc struct pid_namespace *bpf_task_active_pid_ns(struct task_struct *task) | ^~~~~~~~~~~~~~~~~~~~~~ kernel/bpf-rvi/common_kfuncs.c:33:17: warning: no previous prototype for 'bpf_pidns_nr_tasks' [-Wmissing-prototypes] 33 | __bpf_kfunc u64 bpf_pidns_nr_tasks(struct pid_namespace *ns) | ^~~~~~~~~~~~~~~~~~ kernel/bpf-rvi/common_kfuncs.c:47:17: warning: no previous prototype for 'bpf_pidns_last_pid' [-Wmissing-prototypes] 47 | __bpf_kfunc u32 bpf_pidns_last_pid(struct pid_namespace *ns) | ^~~~~~~~~~~~~~~~~~ kernel/bpf-rvi/common_kfuncs.c:76:18: warning: no previous prototype for 'bpf_si_memswinfo' [-Wmissing-prototypes] 76 | __bpf_kfunc void bpf_si_memswinfo(struct bpf_sysinfo *bsi) | ^~~~~~~~~~~~~~~~
kernel/bpf-rvi/common_kfuncs.c:86:27: warning: no previous prototype for 'bpf_page_counter_read' [-Wmissing-prototypes] 86 | __bpf_kfunc unsigned long bpf_page_counter_read(struct page_counter *counter) | ^~~~~~~~~~~~~~~~~~~~~
vim +/bpf_page_counter_read +86 kernel/bpf-rvi/common_kfuncs.c 32
33 __bpf_kfunc u64 bpf_pidns_nr_tasks(struct pid_namespace *ns) 34 { 35 struct pid_iter iter = {}; 36 u32 nr_running = 0, nr_threads = 0; 37 38 for_each_task_in_pidns(iter, ns) { 39 nr_threads++; 40 if (task_is_running(iter.task)) 41 nr_running++; 42 } 43 44 return (u64)nr_running << 32 | nr_threads; 45 } 46 47 __bpf_kfunc u32 bpf_pidns_last_pid(struct pid_namespace *ns) 48 { 49 return idr_get_cursor(&ns->idr) - 1; 50 } 51 52 /* 53 * Swaps related kfuncs 54 */ 55 56 /* 57 * no padding member "_f" compared to struct sysinfo, because sizeof(_f) 58 * maybe zero and not supported by bpf_verifier. 59 */ 60 struct bpf_sysinfo { 61 __kernel_long_t uptime; /* Seconds since boot */ 62 __kernel_ulong_t loads[3]; /* 1, 5, and 15 minute load averages */ 63 __kernel_ulong_t totalram; /* Total usable main memory size */ 64 __kernel_ulong_t freeram; /* Available memory size */ 65 __kernel_ulong_t sharedram; /* Amount of shared memory */ 66 __kernel_ulong_t bufferram; /* Memory used by buffers */ 67 __kernel_ulong_t totalswap; /* Total swap space size */ 68 __kernel_ulong_t freeswap; /* swap space still available */ 69 __u16 procs; /* Number of current processes */ 70 __u16 pad; /* Explicit padding for m68k */ 71 __kernel_ulong_t totalhigh; /* Total high memory size */ 72 __kernel_ulong_t freehigh; /* Available high memory size */ 73 __u32 mem_unit; /* Memory unit size in bytes */ 74 }; 75 76 __bpf_kfunc void bpf_si_memswinfo(struct bpf_sysinfo *bsi) 77 { 78 struct sysinfo *si = (struct sysinfo *)bsi; 79 80 if (si) { 81 si_meminfo(si); 82 si_swapinfo(si); 83 } 84 } 85 86 __bpf_kfunc unsigned long bpf_page_counter_read(struct page_counter *counter) 87 { 88 return page_counter_read(counter); 89 } 90
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki