* Re: [PATCH 34/39] sched_ext: Implement core-sched support
@ 2024-05-02 23:45 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-05-02 23:45 UTC (permalink / raw)
Cc: oe-kbuild-all, llvm
In-Reply-To: <20240501151312.635565-35-tj@kernel.org>
References: <20240501151312.635565-35-tj@kernel.org>
TO: Tejun Heo <tj@kernel.org>
TO: torvalds@linux-foundation.org
TO: mingo@redhat.com
TO: peterz@infradead.org
TO: juri.lelli@redhat.com
TO: vincent.guittot@linaro.org
TO: dietmar.eggemann@arm.com
TO: rostedt@goodmis.org
TO: bsegall@google.com
TO: mgorman@suse.de
TO: bristot@redhat.com
TO: vschneid@redhat.com
TO: ast@kernel.org
TO: daniel@iogearbox.net
TO: andrii@kernel.org
TO: martin.lau@kernel.org
TO: joshdon@google.com
TO: brho@google.com
TO: pjt@google.com
TO: derkling@google.com
TO: haoluo@google.com
TO: dvernet@meta.com
TO: dschatzberg@meta.com
TO: dskarlat@cs.cmu.edu
TO: riel@surriel.com
TO: changwoo@igalia.com
TO: himadrics@inria.fr
TO: memxor@gmail.com
TO: andrea.righi@canonical.com
TO: joel@joelfernandes.org
CC: linux-kernel@vger.kernel.org
Hi Tejun,
kernel test robot noticed the following build warnings:
[auto build test WARNING on shuah-kselftest/next]
[also build test WARNING on shuah-kselftest/fixes tj-cgroup/for-next linus/master v6.9-rc6]
[cannot apply to tip/sched/core next-20240502]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Tejun-Heo/sched-Restructure-sched_class-order-sanity-checks-in-sched_init/20240502-031858
base: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
patch link: https://lore.kernel.org/r/20240501151312.635565-35-tj%40kernel.org
patch subject: [PATCH 34/39] sched_ext: Implement core-sched support
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20240503/202405030744.PiA8O8o8-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 37ae4ad0eef338776c7e2cffb3896153d43dcd90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240503/202405030744.PiA8O8o8-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/202405030744.PiA8O8o8-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from kernel/sched/build_policy.c:25:
In file included from include/linux/livepatch.h:13:
In file included from include/linux/ftrace.h:13:
In file included from include/linux/kallsyms.h:13:
In file included from include/linux/mm.h:2208:
include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
509 | item];
| ~~~~
include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
516 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
528 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
537 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
In file included from kernel/sched/build_policy.c:61:
>> kernel/sched/ext.c:4809:35: warning: bitwise operation between different enumeration types ('enum bpf_type_flag' and 'enum bpf_reg_type') [-Wenum-enum-conversion]
4809 | info->reg_type = PTR_MAYBE_NULL | PTR_TO_BTF_ID | PTR_TRUSTED;
| ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
>> kernel/sched/ext.c:5276:31: warning: bitwise operation between different enumeration types ('enum scx_enq_flags' and 'enum scx_deq_flags') [-Wenum-enum-conversion]
5276 | WRITE_ONCE(v, SCX_ENQ_WAKEUP | SCX_DEQ_SLEEP | SCX_KICK_PREEMPT |
| ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
61 | __WRITE_ONCE(x, val); \
| ^~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
7 warnings generated.
vim +4809 kernel/sched/ext.c
0fd2633c1c5c3c Tejun Heo 2024-05-01 4756
0fd2633c1c5c3c Tejun Heo 2024-05-01 4757 /* Make the 2nd argument of .dispatch a pointer that can be NULL. */
0fd2633c1c5c3c Tejun Heo 2024-05-01 4758 static bool promote_dispatch_2nd_arg(int off, int size,
0fd2633c1c5c3c Tejun Heo 2024-05-01 4759 enum bpf_access_type type,
0fd2633c1c5c3c Tejun Heo 2024-05-01 4760 const struct bpf_prog *prog,
0fd2633c1c5c3c Tejun Heo 2024-05-01 4761 struct bpf_insn_access_aux *info)
0fd2633c1c5c3c Tejun Heo 2024-05-01 4762 {
0fd2633c1c5c3c Tejun Heo 2024-05-01 4763 struct btf *btf = bpf_get_btf_vmlinux();
0fd2633c1c5c3c Tejun Heo 2024-05-01 4764 const struct bpf_struct_ops_desc *st_ops_desc;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4765 const struct btf_member *member;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4766 const struct btf_type *t;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4767 u32 btf_id, member_idx;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4768 const char *mname;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4769
0fd2633c1c5c3c Tejun Heo 2024-05-01 4770 /* btf_id should be the type id of struct sched_ext_ops */
0fd2633c1c5c3c Tejun Heo 2024-05-01 4771 btf_id = prog->aux->attach_btf_id;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4772 st_ops_desc = bpf_struct_ops_find(btf, btf_id);
0fd2633c1c5c3c Tejun Heo 2024-05-01 4773 if (!st_ops_desc)
0fd2633c1c5c3c Tejun Heo 2024-05-01 4774 return false;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4775
0fd2633c1c5c3c Tejun Heo 2024-05-01 4776 /* BTF type of struct sched_ext_ops */
0fd2633c1c5c3c Tejun Heo 2024-05-01 4777 t = st_ops_desc->type;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4778
0fd2633c1c5c3c Tejun Heo 2024-05-01 4779 member_idx = prog->expected_attach_type;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4780 if (member_idx >= btf_type_vlen(t))
0fd2633c1c5c3c Tejun Heo 2024-05-01 4781 return false;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4782
0fd2633c1c5c3c Tejun Heo 2024-05-01 4783 /*
0fd2633c1c5c3c Tejun Heo 2024-05-01 4784 * Get the member name of this struct_ops program, which corresponds to
0fd2633c1c5c3c Tejun Heo 2024-05-01 4785 * a field in struct sched_ext_ops. For example, the member name of the
0fd2633c1c5c3c Tejun Heo 2024-05-01 4786 * dispatch struct_ops program (callback) is "dispatch".
0fd2633c1c5c3c Tejun Heo 2024-05-01 4787 */
0fd2633c1c5c3c Tejun Heo 2024-05-01 4788 member = &btf_type_member(t)[member_idx];
0fd2633c1c5c3c Tejun Heo 2024-05-01 4789 mname = btf_name_by_offset(btf_vmlinux, member->name_off);
0fd2633c1c5c3c Tejun Heo 2024-05-01 4790
0fd2633c1c5c3c Tejun Heo 2024-05-01 4791 /*
0fd2633c1c5c3c Tejun Heo 2024-05-01 4792 * Check if it is the second argument of the function pointer at
0fd2633c1c5c3c Tejun Heo 2024-05-01 4793 * "dispatch" in struct sched_ext_ops. The arguments of struct_ops
0fd2633c1c5c3c Tejun Heo 2024-05-01 4794 * operators are sequential and 64-bit, so the second argument is at
0fd2633c1c5c3c Tejun Heo 2024-05-01 4795 * offset sizeof(__u64).
0fd2633c1c5c3c Tejun Heo 2024-05-01 4796 */
0fd2633c1c5c3c Tejun Heo 2024-05-01 4797 if (strcmp(mname, "dispatch") == 0 &&
0fd2633c1c5c3c Tejun Heo 2024-05-01 4798 off == sizeof(__u64)) {
0fd2633c1c5c3c Tejun Heo 2024-05-01 4799 /*
0fd2633c1c5c3c Tejun Heo 2024-05-01 4800 * The value is a pointer to a type (struct task_struct) given
0fd2633c1c5c3c Tejun Heo 2024-05-01 4801 * by a BTF ID (PTR_TO_BTF_ID). It is trusted (PTR_TRUSTED),
0fd2633c1c5c3c Tejun Heo 2024-05-01 4802 * however, can be a NULL (PTR_MAYBE_NULL). The BPF program
0fd2633c1c5c3c Tejun Heo 2024-05-01 4803 * should check the pointer to make sure it is not NULL before
0fd2633c1c5c3c Tejun Heo 2024-05-01 4804 * using it, or the verifier will reject the program.
0fd2633c1c5c3c Tejun Heo 2024-05-01 4805 *
0fd2633c1c5c3c Tejun Heo 2024-05-01 4806 * Longer term, this is something that should be addressed by
0fd2633c1c5c3c Tejun Heo 2024-05-01 4807 * BTF, and be fully contained within the verifier.
0fd2633c1c5c3c Tejun Heo 2024-05-01 4808 */
0fd2633c1c5c3c Tejun Heo 2024-05-01 @4809 info->reg_type = PTR_MAYBE_NULL | PTR_TO_BTF_ID | PTR_TRUSTED;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4810 info->btf = btf_vmlinux;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4811 info->btf_id = task_struct_type_id;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4812
0fd2633c1c5c3c Tejun Heo 2024-05-01 4813 return true;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4814 }
0fd2633c1c5c3c Tejun Heo 2024-05-01 4815
0fd2633c1c5c3c Tejun Heo 2024-05-01 4816 return false;
0fd2633c1c5c3c Tejun Heo 2024-05-01 4817 }
0fd2633c1c5c3c Tejun Heo 2024-05-01 4818
--
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:[~2024-05-02 23:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02 23:45 [PATCH 34/39] sched_ext: Implement core-sched support 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