Skip to content

[PW_SID:1073526] block: Introduce a BPF-based I/O scheduler#1676

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1073526
Closed

[PW_SID:1073526] block: Introduce a BPF-based I/O scheduler#1676
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1073526

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1073526 applied to workflow__riscv__fixes

Name: block: Introduce a BPF-based I/O scheduler
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1073526
Version: 1

Kaitao Cheng added 2 commits March 27, 2026 12:51
Introduce IOSCHED_UFQ, a blk-mq elevator ("ufq: User-programmable
Flexible Queueing") whose policy is supplied by an eBPF program via
struct_ops (insert, dispatch, merge, finish, etc.).

When no eBPF program is attached, the UFQ I/O scheduler uses a simple,
per-ctx queueing policy (similar to none). After an eBPF program is
attached, the user-defined scheduling policy replaces UFQ’s built-in
queueing policy, while per-ctx queues remain available as a fallback
mechanism.

Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add ufq_iosched as a simple example for the UFQ block I/O scheduler,
In the ufq_simple example, we implement the eBPF struct_ops hooks the
kernel exposes so we can exercise and validate the behavior and stability
of the kernel UFQ scheduling framework. The Makefile and directory
layout are modeled after sched_ext.

This mirrors the sched_ext examples pattern so developers can experiment
with user-defined queueing policies on top of IOSCHED_UFQ.

Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 136.38 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 738.53 seconds
Result: ERROR
Output:

Redirect to /build/tmp.QfT9SlqdkB and /build/tmp.OiujqGLPU5
Tree base:
c315cbf1a162a ("Adding CI files")
Building the whole tree with the patch
error:
Warning: /build/tmp3rytbjvt/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:244 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!



real	12m12.189s
user	460m21.017s
sys	81m48.431s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1078.66 seconds
Result: ERROR
Output:

Redirect to /build/tmp.xRorGjWUCc and /build/tmp.wkyPZUNnbw
Tree base:
c315cbf1a162a ("Adding CI files")
Building the whole tree with the patch
error:
Warning: /build/tmp3rytbjvt/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:244 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!



real	17m52.343s
user	642m11.683s
sys	99m57.030s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.99 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 24.72 seconds
Result: ERROR
Output:

Full log:
W: Support for running offline not available (unshare: unshare failed: Operation not permitted)
I: config: PASS in 0:00:04.525946
I: default: FAIL in 0:00:14.472162
I: kernel: SKIP in 0:00:00.000008
I: xipkernel: SKIP in 0:00:00.000004
I: modules: SKIP in 0:00:00.003856
I: dtbs: PASS in 0:00:01.410286
I: dtbs-legacy: SKIP in 0:00:00.004694
I: debugkernel: SKIP in 0:00:00.000005
I: headers: PASS in 0:00:01.179692
I: build output in /build/tmp.MC4KljADoo
tuxmake --download-all-korg-gcc-toolchains --target-arch=riscv --kconfig=nommu_virt_defconfig --toolchain=gcc --wrapper=ccache --environment=KBUILD_BUILD_TIMESTAMP=@1621270510 --environment=KBUILD_BUILD_USER=tuxmake --environment=KBUILD_BUILD_HOST=tuxmake --environment=KCFLAGS=-ffile-prefix-map=/build/tmp.MC4KljADoo/build/= --runtime=null --image=docker.io/tuxmake/riscv_gcc CROSS_COMPILE=riscv64-linux- config default kernel xipkernel modules dtbs dtbs-legacy debugkernel headers
make --silent --keep-going --jobs=48 O=/build/tmp.MC4KljADoo/build ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc' nommu_virt_defconfig
make --silent --keep-going --jobs=48 O=/build/tmp.MC4KljADoo/build ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc'
/build/tmp3rytbjvt/block/ufq-bpfops.c: In function 'bpf_ufq_is_valid_access':
/build/tmp3rytbjvt/block/ufq-bpfops.c:44:22: error: implicit declaration of function 'btf_ctx_access'; did you mean 'btf_struct_access'? [-Wimplicit-function-declaration]
   44 |                 if (!btf_ctx_access(off, size, type, prog, info))
      |                      ^~~~~~~~~~~~~~
      |                      btf_struct_access
In file included from /build/tmp3rytbjvt/include/linux/bpf_verifier.h:7,
                 from /build/tmp3rytbjvt/block/ufq-bpfops.c:8:
/build/tmp3rytbjvt/block/ufq-bpfops.c: In function 'bpf_ufq_ops_init':
/build/tmp3rytbjvt/include/linux/bpf.h:2142:50: warning: statement with no effect [-Wunused-value]
 2142 | #define register_bpf_struct_ops(st_ops, type) ({ (void *)(st_ops); 0; })
      |                                                  ^~~~~~~~~~~~~~~~
/build/tmp3rytbjvt/block/ufq-bpfops.c:211:16: note: in expansion of macro 'register_bpf_struct_ops'
  211 |         return register_bpf_struct_ops(&bpf_iosched_ufq_ops, ufq_iosched_ops);
      |                ^~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [/build/tmp3rytbjvt/scripts/Makefile.build:289: block/ufq-bpfops.o] Error 1
make[4]: Target 'block/' not remade because of errors.
make[3]: *** [/build/tmp3rytbjvt/scripts/Makefile.build:546: block] Error 2
make[3]: Target './' not remade because of errors.
make[2]: *** [/build/tmp3rytbjvt/Makefile:2101: .] Error 2
make[2]: Target '__all' not remade because of errors.
make[1]: *** [/build/tmp3rytbjvt/Makefile:248: __sub-make] Error 2
make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:248: __sub-make] Error 2
make: Target '__all' not remade because of errors.
make --silent --keep-going --jobs=48 O=/build/tmp.MC4KljADoo/build INSTALL_DTBS_PATH=/build/tmp.MC4KljADoo/build/dtbsinstall/dtbs ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc' dtbs
rm -rf /build/tmp.MC4KljADoo/build/dtbsinstall
mkdir -p /build/tmp.MC4KljADoo/build/dtbsinstall/dtbs
make --silent --keep-going --jobs=48 O=/build/tmp.MC4KljADoo/build INSTALL_DTBS_PATH=/build/tmp.MC4KljADoo/build/dtbsinstall/dtbs ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc' dtbs_install
tar --sort=name --owner=tuxmake:1000 --group=tuxmake:1000 --mtime=@1774615892 --clamp-mtime -caf /build/tmp.MC4KljADoo/build/dtbs.tar -C /build/tmp.MC4KljADoo/build/dtbsinstall dtbs
rm -rf /build/tmp.MC4KljADoo/build/install_hdr
make --silent --keep-going --jobs=48 O=/build/tmp.MC4KljADoo/build INSTALL_HDR_PATH=/build/tmp.MC4KljADoo/build/install_hdr/ ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc' headers_install
tar --sort=name --owner=tuxmake:1000 --group=tuxmake:1000 --mtime=@1774615892 --clamp-mtime -caf /build/tmp.MC4KljADoo/build/headers.tar -C /build/tmp.MC4KljADoo/build/install_hdr .
warnings/errors:
/build/tmp3rytbjvt/block/ufq-bpfops.c:44:22: error: implicit declaration of function 'btf_ctx_access'; did you mean 'btf_struct_access'? [-Wimplicit-function-declaration]
/build/tmp3rytbjvt/include/linux/bpf.h:2142:50: warning: statement with no effect [-Wunused-value]


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 5.52 seconds
Result: WARNING
Output:

CHECK: Alignment should match open parenthesis
#135: FILE: block/blk-merge.c:1180:
+bool blk_mq_sched_merge_fn(struct request_queue *q, struct bio *bio,
+		unsigned int nr_segs, struct request **merged_request,

CHECK: Alignment should match open parenthesis
#173: FILE: block/blk-mq-sched.h:11:
+bool blk_mq_sched_merge_fn(struct request_queue *q, struct bio *bio,
+		unsigned int nr_segs, struct request **merged_request,

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#232: 
new file mode 100644

CHECK: Alignment should match open parenthesis
#624: FILE: block/ufq-iosched.c:169:
+static void ufq_merged_request(struct request_queue *q, struct request *rq,
+		enum elv_merge type)

CHECK: Alignment should match open parenthesis
#635: FILE: block/ufq-iosched.c:180:
+static bool ufq_sched_try_merge(struct request_queue *q, struct bio *bio,
+		unsigned int nr_segs, struct request **merged_request)

CHECK: Please don't use multiple blank lines
#641: FILE: block/ufq-iosched.c:186:
+
+

CHECK: Alignment should match open parenthesis
#693: FILE: block/ufq-iosched.c:238:
+static bool ufq_bio_merge(struct request_queue *q, struct bio *bio,
+		unsigned int nr_segs)

CHECK: Alignment should match open parenthesis
#780: FILE: block/ufq-iosched.c:325:
+static void ufq_insert_requests(struct blk_mq_hw_ctx *hctx,
+			       struct list_head *list,

CHECK: Alignment should match open parenthesis
#806: FILE: block/ufq-iosched.c:351:
+				list_add_tail(&rq->queuelist,
+					&ctx->rq_lists[hctx->type]);

CHECK: Alignment should match open parenthesis
#1006: FILE: block/ufq-iosched.h:19:
+	int (*insert_req)(struct request_queue *q, struct request *rq,
+			blk_insert_t flags);

CHECK: Alignment should match open parenthesis
#1012: FILE: block/ufq-iosched.h:25:
+	struct request *(*merge_req)(struct request_queue *q, struct request *rq,
+			int *type);

CHECK: Alignment should match open parenthesis
#1014: FILE: block/ufq-iosched.h:27:
+	struct request *(*find_req_from_sector)(struct request_queue *q,
+			sector_t start, sector_t end);

CHECK: Please use a blank line after function/struct/union/enum declarations
#1020: FILE: block/ufq-iosched.h:33:
+};
+extern struct ufq_iosched_ops ufq_ops;

total: 0 errors, 1 warnings, 12 checks, 1019 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit f2d9f1cf38cc ("block: Introduce the UFQ I/O scheduler") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 12 checks, 1019 lines checked
CHECK: Alignment should match open parenthesis
CHECK: Please don't use multiple blank lines
CHECK: Please use a blank line after function/struct/union/enum declarations
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.39 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
kdoc
Desc: Detects for kdoc errors
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
module-param
Desc: Detect module_param changes
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/2] block: Introduce the UFQ I/O scheduler"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 136.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 739.03 seconds
Result: ERROR
Output:

Redirect to /build/tmp.gCjRGedAzG and /build/tmp.wwdxdSJYaH
Tree base:
f2d9f1cf38cc6 ("block: Introduce the UFQ I/O scheduler")
Building the whole tree with the patch
error:
Warning: /build/tmpcd0x79d0/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:244 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!



real	12m12.770s
user	459m37.761s
sys	81m57.422s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1080.38 seconds
Result: ERROR
Output:

Redirect to /build/tmp.QJn270jXyj and /build/tmp.PWdkjVFn8o
Tree base:
f2d9f1cf38cc6 ("block: Introduce the UFQ I/O scheduler")
Building the whole tree with the patch
error:
Warning: /build/tmpcd0x79d0/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:244 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!



real	17m53.945s
user	641m51.927s
sys	100m24.912s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 24.30 seconds
Result: ERROR
Output:

Full log:
W: Support for running offline not available (unshare: unshare failed: Operation not permitted)
I: config: PASS in 0:00:04.554555
I: default: FAIL in 0:00:14.141438
I: kernel: SKIP in 0:00:00.000005
I: xipkernel: SKIP in 0:00:00.000002
I: modules: SKIP in 0:00:00.001266
I: dtbs: PASS in 0:00:01.320678
I: dtbs-legacy: SKIP in 0:00:00.004592
I: debugkernel: SKIP in 0:00:00.000005
I: headers: PASS in 0:00:01.130806
I: build output in /build/tmp.dBr5IU4zl1
tuxmake --download-all-korg-gcc-toolchains --target-arch=riscv --kconfig=nommu_virt_defconfig --toolchain=gcc --wrapper=ccache --environment=KBUILD_BUILD_TIMESTAMP=@1621270510 --environment=KBUILD_BUILD_USER=tuxmake --environment=KBUILD_BUILD_HOST=tuxmake --environment=KCFLAGS=-ffile-prefix-map=/build/tmp.dBr5IU4zl1/build/= --runtime=null --image=docker.io/tuxmake/riscv_gcc CROSS_COMPILE=riscv64-linux- config default kernel xipkernel modules dtbs dtbs-legacy debugkernel headers
make --silent --keep-going --jobs=48 O=/build/tmp.dBr5IU4zl1/build ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc' nommu_virt_defconfig
make --silent --keep-going --jobs=48 O=/build/tmp.dBr5IU4zl1/build ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc'
/build/tmpcd0x79d0/block/ufq-bpfops.c: In function 'bpf_ufq_is_valid_access':
/build/tmpcd0x79d0/block/ufq-bpfops.c:44:22: error: implicit declaration of function 'btf_ctx_access'; did you mean 'btf_struct_access'? [-Wimplicit-function-declaration]
   44 |                 if (!btf_ctx_access(off, size, type, prog, info))
      |                      ^~~~~~~~~~~~~~
      |                      btf_struct_access
In file included from /build/tmpcd0x79d0/include/linux/bpf_verifier.h:7,
                 from /build/tmpcd0x79d0/block/ufq-bpfops.c:8:
/build/tmpcd0x79d0/block/ufq-bpfops.c: In function 'bpf_ufq_ops_init':
/build/tmpcd0x79d0/include/linux/bpf.h:2142:50: warning: statement with no effect [-Wunused-value]
 2142 | #define register_bpf_struct_ops(st_ops, type) ({ (void *)(st_ops); 0; })
      |                                                  ^~~~~~~~~~~~~~~~
/build/tmpcd0x79d0/block/ufq-bpfops.c:211:16: note: in expansion of macro 'register_bpf_struct_ops'
  211 |         return register_bpf_struct_ops(&bpf_iosched_ufq_ops, ufq_iosched_ops);
      |                ^~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [/build/tmpcd0x79d0/scripts/Makefile.build:289: block/ufq-bpfops.o] Error 1
make[4]: Target 'block/' not remade because of errors.
make[3]: *** [/build/tmpcd0x79d0/scripts/Makefile.build:546: block] Error 2
make[3]: Target './' not remade because of errors.
make[2]: *** [/build/tmpcd0x79d0/Makefile:2101: .] Error 2
make[2]: Target '__all' not remade because of errors.
make[1]: *** [/build/tmpcd0x79d0/Makefile:248: __sub-make] Error 2
make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:248: __sub-make] Error 2
make: Target '__all' not remade because of errors.
make --silent --keep-going --jobs=48 O=/build/tmp.dBr5IU4zl1/build INSTALL_DTBS_PATH=/build/tmp.dBr5IU4zl1/build/dtbsinstall/dtbs ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc' dtbs
rm -rf /build/tmp.dBr5IU4zl1/build/dtbsinstall
mkdir -p /build/tmp.dBr5IU4zl1/build/dtbsinstall/dtbs
make --silent --keep-going --jobs=48 O=/build/tmp.dBr5IU4zl1/build INSTALL_DTBS_PATH=/build/tmp.dBr5IU4zl1/build/dtbsinstall/dtbs ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc' dtbs_install
tar --sort=name --owner=tuxmake:1000 --group=tuxmake:1000 --mtime=@1774615893 --clamp-mtime -caf /build/tmp.dBr5IU4zl1/build/dtbs.tar -C /build/tmp.dBr5IU4zl1/build/dtbsinstall dtbs
rm -rf /build/tmp.dBr5IU4zl1/build/install_hdr
make --silent --keep-going --jobs=48 O=/build/tmp.dBr5IU4zl1/build INSTALL_HDR_PATH=/build/tmp.dBr5IU4zl1/build/install_hdr/ ARCH=riscv CROSS_COMPILE=riscv64-linux- 'CC=ccache riscv64-linux-gcc' 'HOSTCC=ccache gcc' headers_install
tar --sort=name --owner=tuxmake:1000 --group=tuxmake:1000 --mtime=@1774615893 --clamp-mtime -caf /build/tmp.dBr5IU4zl1/build/headers.tar -C /build/tmp.dBr5IU4zl1/build/install_hdr .
warnings/errors:
/build/tmpcd0x79d0/block/ufq-bpfops.c:44:22: error: implicit declaration of function 'btf_ctx_access'; did you mean 'btf_struct_access'? [-Wimplicit-function-declaration]
/build/tmpcd0x79d0/include/linux/bpf.h:2142:50: warning: statement with no effect [-Wunused-value]


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 5.23 seconds
Result: ERROR
Output:

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#40: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parentheses
#502: FILE: tools/ufq_iosched/include/ufq/common.bpf.h:22:
+#define BPF_STRUCT_OPS(name, args...)					\
+	SEC("struct_ops/" #name) BPF_PROG(name, ##args)

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at
   file-scope, where C disallows code (it must be in functions).  See
   $exceptions if you have one to add by name.

   More troublesome is declarative macros used at top of new scope,
   like DECLARE_PER_CPU.  These might just compile with a do-while-0
   wrapper, but would be incorrect.  Most of these are handled by
   detecting struct,union,etc declaration primitives in $exceptions.

   Theres also macros called inside an if (block), which "return" an
   expression.  These cannot do-while, and need a ({}) wrapper.

   Enjoy this qualification while we work to improve our heuristics.

CHECK: Alignment should match open parenthesis
#526: FILE: tools/ufq_iosched/include/ufq/common.bpf.h:46:
+int bpf_list_push_front_impl(struct bpf_list_head *head,
+				    struct bpf_list_node *node,

CHECK: Alignment should match open parenthesis
#531: FILE: tools/ufq_iosched/include/ufq/common.bpf.h:51:
+int bpf_list_push_back_impl(struct bpf_list_head *head,
+				   struct bpf_list_node *node,

ERROR: space required after that ',' (ctx:BxB)
#596: FILE: tools/ufq_iosched/include/ufq/common.h:37:
+		fprintf(stderr, __fmt __VA_OPT__(,) __VA_ARGS__);		\
 		                                 ^

ERROR: space required after that ',' (ctx:BxB)
#605: FILE: tools/ufq_iosched/include/ufq/common.h:46:
+			UFQ_ERR((__fmt) __VA_OPT__(,) __VA_ARGS__);		\
 			                           ^

CHECK: Macro argument '__ufq_name' may be better as '(__ufq_name)' to avoid precedence issues
#612: FILE: tools/ufq_iosched/include/ufq/common.h:53:
+#define UFQ_OPS_OPEN(__ops_name, __ufq_name) ({					\
+	struct __ufq_name *__skel;						\
+										\
+	__skel = __ufq_name##__open();						\
+	UFQ_ERR_IF(!__skel, "Could not open " #__ufq_name);			\
+	(void)__skel->maps.__ops_name;						\
+	__skel;									\
+})

WARNING: Argument '__skel' is not used in function-like macro
#637: FILE: tools/ufq_iosched/include/ufq/common.h:78:
+#define __UFQ_OPS_DISABLE_AUTOATTACH(__skel, __ops_name) do {} while (0)

WARNING: Argument '__ops_name' is not used in function-like macro
#637: FILE: tools/ufq_iosched/include/ufq/common.h:78:
+#define __UFQ_OPS_DISABLE_AUTOATTACH(__skel, __ops_name) do {} while (0)

CHECK: Alignment should match open parenthesis
#1017: FILE: tools/ufq_iosched/ufq_simple.bpf.c:334:
+struct request *BPF_STRUCT_OPS(ufq_simple_merge_req, struct request_queue *q,
+				struct request *rq, int *type)

CHECK: Alignment should match open parenthesis
#1085: FILE: tools/ufq_iosched/ufq_simple.bpf.c:402:
+				snode = container_of(rb_node,
+					struct sort_tree_node, rb_node);

CHECK: Alignment should match open parenthesis
#1101: FILE: tools/ufq_iosched/ufq_simple.bpf.c:418:
+					lnode = container_of(list_node,
+						struct sort_tree_node, list_node);

CHECK: Alignment should match open parenthesis
#1119: FILE: tools/ufq_iosched/ufq_simple.bpf.c:436:
+UFQ_OPS_DEFINE(ufq_simple_ops,
+	.init_sched		= (void *)ufq_simple_init_sched,

WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#1162: FILE: tools/ufq_iosched/ufq_simple.c:28:
+static volatile int exit_req;

CHECK: Alignment should match open parenthesis
#1238: FILE: tools/ufq_iosched/ufq_simple.c:104:
+		printf("(insert:   cnt=%llu size=%llu) (merge:  cnt=%llu size=%llu)\n",
+				stats[UFQ_SIMP_INSERT_CNT], stats[UFQ_SIMP_INSERT_SIZE],

CHECK: Alignment should match open parenthesis
#1241: FILE: tools/ufq_iosched/ufq_simple.c:107:
+		printf("(dispatch: cnt=%llu size=%llu) (finish: cnt=%llu size=%llu)\n",
+			stats[UFQ_SIMP_DISPATCH_CNT], stats[UFQ_SIMP_DISPATCH_SIZE],

total: 3 errors, 4 warnings, 9 checks, 1160 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 36436a60fb1e ("tools/ufq_iosched: add BPF example scheduler and build scaffolding") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
CHECK: Alignment should match open parenthesis
CHECK: Macro argument '__ufq_name' may be better as '(__ufq_name)' to avoid precedence issues
ERROR: Macros with complex values should be enclosed in parentheses
ERROR: space required after that ',' (ctx:BxB)
WARNING: Argument '__ops_name' is not used in function-like macro
WARNING: Argument '__skel' is not used in function-like macro
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/2] tools/ufq_iosched: add BPF example scheduler and build scaffolding"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1073526 branch March 31, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant