From: bot+bpf-ci@kernel.org
To: ziyang.meme@gmail.com,shuah@kernel.org,tj@kernel.org,hannes@cmpxchg.org,mkoutny@suse.com,jikos@kernel.org,bentiss@kernel.org,void@manifault.com,eddyz87@gmail.com
Cc: vmalik@redhat.com,arighi@nvidia.com,changwoo@igalia.com,mhocko@kernel.org,roman.gushchin@linux.dev,shakeel.butt@linux.dev,muchun.song@linux.dev,akpm@linux-foundation.org,inwardvessel@gmail.com,mykolal@meta.com,nathan@kernel.org,ziyang.meme@gmail.com,kernel-team@meta.com,linux-kselftest@vger.kernel.org,cgroups@vger.kernel.org,linux-input@vger.kernel.org,sched-ext@lists.linux.dev,linux-mm@kvack.org,bpf@vger.kernel.org,llvm@lists.linux.dev,linux-kernel@vger.kernel.org,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH v5 4/4] selftests/sched_ext: build BPF schedulers via the shared lib.bpf.mk
Date: Fri, 11 Sep 2026 07:44:53 +0000 (UTC) [thread overview]
Message-ID: <c51a056670cea30c7fb85ed0ef80a6be9b7e538196a5ae53cbad3b374db70c2c@mail.kernel.org> (raw)
In-Reply-To: <20260910233303.1063501-5-ziyang.meme@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4013 bytes --]
> diff --git a/tools/testing/selftests/sched_ext/Makefile b/tools/testing/selftests/sched_ext/Makefile
> index 3cfe90e0f34f..dd3f5594af24 100644
> --- a/tools/testing/selftests/sched_ext/Makefile
> +++ b/tools/testing/selftests/sched_ext/Makefile
> @@ -14,48 +14,29 @@ CURDIR := $(abspath .)
> REPOROOT := $(abspath ../../../..)
> TOOLSDIR := $(REPOROOT)/tools
> LIBDIR := $(TOOLSDIR)/lib
> -BPFDIR := $(LIBDIR)/bpf
> TOOLSINCDIR := $(TOOLSDIR)/include
> -BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool
> -APIDIR := $(TOOLSINCDIR)/uapi
> GENDIR := $(REPOROOT)/include/generated
> GENHDR := $(GENDIR)/autoconf.h
> -SCXTOOLSDIR := $(TOOLSDIR)/sched_ext
> SCXTOOLSINCDIR := $(TOOLSDIR)/sched_ext/include
>
> -OUTPUT_DIR := $(OUTPUT)/build
> -OBJ_DIR := $(OUTPUT_DIR)/obj
> -INCLUDE_DIR := $(OUTPUT_DIR)/include
> -BPFOBJ_DIR := $(OBJ_DIR)/libbpf
> -SCXOBJ_DIR := $(OBJ_DIR)/sched_ext
> -BPFOBJ := $(BPFOBJ_DIR)/libbpf.a
> -LIBBPF_OUTPUT := $(OBJ_DIR)/libbpf/libbpf.a
> -
> -DEFAULT_BPFTOOL := $(OUTPUT_DIR)/host/sbin/bpftool
> -HOST_OBJ_DIR := $(OBJ_DIR)/host/bpftool
> -HOST_LIBBPF_OUTPUT := $(OBJ_DIR)/host/libbpf/
> -HOST_LIBBPF_DESTDIR := $(OUTPUT_DIR)/host/
> -HOST_DESTDIR := $(OUTPUT_DIR)/host/
> -
> -VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \
> - $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \
> - ../../../../vmlinux \
> - /sys/kernel/btf/vmlinux \
> - /boot/vmlinux-$(shell uname -r)
> -VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
> -ifeq ($(VMLINUX_BTF),)
> -$(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)")
> -endif
> +# Build scheduler skeletons and subskeletons with the shared BPF rules.
> +BPF_SRCS := $(wildcard *.bpf.c)
> +BPF_SKEL_EXT := .bpf.skel.h
> +BPF_GEN_SUBSKEL := 1
This isn't a bug, but is anything consuming the generated
*.bpf.subskel.h headers? Grepping the directory for "subskel" matches
only the Makefile itself - no .c or .h file under
tools/testing/selftests/sched_ext/ includes a subskeleton header. The
pre-patch rule generated them too, so this preserves existing behavior,
but the conversion makes the subskeleton an explicit one-line opt-in.
Would dropping BPF_GEN_SUBSKEL be a reasonable follow-up to save a
bpftool run per scheduler?
> +# Preserve the existing build/ layout.
> +BPF_OBJ_DIR := $(OUTPUT)/build/obj/sched_ext
> +BPF_SKEL_DIR := $(OUTPUT)/build/include
> +SCXOBJ_DIR := $(BPF_OBJ_DIR)
>
> -BPFTOOL ?= $(DEFAULT_BPFTOOL)
> +include ../lib.bpf.mk
[ ... ]
> @@ -64,102 +45,26 @@ endif
>
> LDFLAGS = -lelf -lz -lpthread -lzstd
[ ... ]
> +EXTRA_CLEAN += $(OUTPUT)/build
>
> ################
> # C schedulers #
> ################
>
> -override define CLEAN
> - rm -rf $(OUTPUT_DIR)
> - rm -f $(TEST_GEN_PROGS)
> -endef
> -
> -# Every testcase takes all of the BPF progs are dependencies by default. This
> -# allows testcases to load any BPF scheduler, which is useful for testcases
> -# that don't need their own prog to run their test.
> -all_test_bpfprogs := $(foreach prog,$(wildcard *.bpf.c),$(INCLUDE_DIR)/$(patsubst %.c,%.skel.h,$(prog)))
> +# Build every scheduler before each test.
> +all_test_bpfprogs := $(BPF_SKELS)
This isn't a bug, but since the variable assignment is otherwise a
straight substitution (the foreach expression becomes $(BPF_SKELS)),
would it be worth keeping the original comment wording? The previous
text explained the rationale - "Every testcase takes all of the BPF
progs as dependencies by default. This allows testcases to load any BPF
scheduler, which is useful for testcases that don't need their own prog
to run their test." - while the replacement restates what the following
line does and drops the reason a testcase depends on schedulers it does
not own.
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/34573210499
prev parent reply other threads:[~2026-09-11 7:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 23:32 [PATCH v5 0/4] selftests: add shared Makefile for BPF selftests and a new memcg test Ziyang Men
2026-09-10 23:33 ` [PATCH v5 1/4] selftests: add shared lib.bpf.mk to build BPF progs and skeletons Ziyang Men
2026-09-10 23:33 ` [PATCH v5 2/4] selftests/cgroup: add memcg_stat_cross_cpu correctness test for flush Ziyang Men
2026-09-10 23:44 ` sashiko-bot
2026-09-11 8:03 ` bot+bpf-ci
2026-09-10 23:33 ` [PATCH v5 3/4] selftests/hid: build the BPF program via the shared lib.bpf.mk Ziyang Men
2026-09-11 7:44 ` bot+bpf-ci
2026-09-10 23:33 ` [PATCH v5 4/4] selftests/sched_ext: build BPF schedulers " Ziyang Men
2026-09-11 7:44 ` bot+bpf-ci [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c51a056670cea30c7fb85ed0ef80a6be9b7e538196a5ae53cbad3b374db70c2c@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=arighi@nvidia.com \
--cc=ast@kernel.org \
--cc=bentiss@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=changwoo@igalia.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=ihor.solodrai@linux.dev \
--cc=inwardvessel@gmail.com \
--cc=jikos@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=martin.lau@kernel.org \
--cc=mason@kernel.org \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=mykolal@meta.com \
--cc=nathan@kernel.org \
--cc=roman.gushchin@linux.dev \
--cc=sched-ext@lists.linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
--cc=vmalik@redhat.com \
--cc=void@manifault.com \
--cc=yonghong.song@linux.dev \
--cc=ziyang.meme@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox