On Wed, Oct 18, 2023 at 02:17:40PM +0800, Chuyi Zhou wrote: > This patch adds kfuncs bpf_iter_css_task_{new,next,destroy} which allow > creation and manipulation of struct bpf_iter_css_task in open-coded > iterator style. These kfuncs actually wrapps css_task_iter_{start,next, > end}. BPF programs can use these kfuncs through bpf_for_each macro for > iteration of all tasks under a css. > > css_task_iter_*() would try to get the global spin-lock *css_set_lock*, so > the bpf side has to be careful in where it allows to use this iter. > Currently we only allow it in bpf_lsm and bpf iter-s. > > Signed-off-by: Chuyi Zhou <zhouchuyi@xxxxxxxxxxxxx> > Acked-by: Tejun Heo <tj@xxxxxxxxxx> With this patch in linux-next: Building m68k:defconfig ... failed -------------- Error log: kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_new': kernel/bpf/task_iter.c:917:14: error: 'CSS_TASK_ITER_PROCS' undeclared (first use in this function) 917 | case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED: | ^~~~~~~~~~~~~~~~~~~ kernel/bpf/task_iter.c:917:14: note: each undeclared identifier is reported only once for each function it appears in kernel/bpf/task_iter.c:917:36: error: 'CSS_TASK_ITER_THREADED' undeclared (first use in this function) 917 | case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED: My apologies for the noise if this has already been reported and/or fixed. Guenter