Re: [PATCH 4/5] sched_ext: Factor out scx_cpuperf_set()

[email protected] Fri, 24 Jul 2026 18:30:56 +0000
Newsgroups dev.linux.lists.sched-ext
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Kernel-doc comment disconnected from its intended function.
--

--- Patch [4]: [PATCH 4/5] sched_ext: Factor out scx_cpuperf_set() ---
commit b27126d56fa54ad2d995a8ef1399b04f6ce7c044
Author: Tejun Heo <[email protected]>

sched_ext: Factor out scx_cpuperf_set()

This commit factors out the CPU performance target write from
scx_bpf_cpuperf_set() into a new internal scx_cpuperf_set() helper. It also
flattens the nested validation into early returns to prepare for future
changes.

> diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
> index d78b28d39d46c..00fe8490050df 100644
> --- a/kernel/sched/ext/ext.c
> +++ b/kernel/sched/ext/ext.c
> @@ -9793,49 +9793,60 @@ __bpf_kfunc u32 scx_bpf_cidperf_cur(s32 cid, const struct bpf_prog_aux *aux)
>   * use. Consult hardware and cpufreq documentation for more information. The
>   * current performance level can be monitored using scx_bpf_cpuperf_cur().
>   */
> -__bpf_kfunc void scx_bpf_cpuperf_set(s32 cpu, u32 perf, const struct bpf_prog_aux *aux)
> +static s32 scx_cpuperf_set(struct scx_sched *sch, s32 cpu, u32 perf)

[Severity: Low]
Does this disconnect the kernel-doc comment from its intended function?

By placing the new static helper scx_cpuperf_set() directly under the
kernel-doc block for scx_bpf_cpuperf_set(), kernel-doc will parse this as
the documentation for the helper instead of the kfunc.

This will trigger kernel-doc warnings during documentation builds about
mismatched function names and arguments (such as missing @sch and @aux),
and leaves the public kfunc scx_bpf_cpuperf_set() undocumented in the
generated kernel documentation.

>  {
> -	struct scx_sched *sch;
> -
> -	guard(rcu)();
> -
> -	sch = scx_prog_sched(aux);
> -	if (unlikely(!sch))
> -		return;

[ ... ]

> +	if (!locked_rq)
> +		rq_unlock_irqrestore(rq, &rf);
> +
> +	return 0;
> +}
> +
> +__bpf_kfunc void scx_bpf_cpuperf_set(s32 cpu, u32 perf, const struct bpf_prog_aux *aux)
> +{
> +	struct scx_sched *sch;

-- 
Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=4