Re: [PATCH 01/16] sched_ext: Exit early on hotplug events during attach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Wed, Sep 03, 2025 at 11:33:27AM +0200, Andrea Righi wrote:
>  static int validate_ops(struct scx_sched *sch, const struct sched_ext_ops *ops)
> @@ -5627,11 +5630,15 @@ static int scx_enable(struct sched_ext_ops *ops, struct bpf_link *link)
>  		if (((void (**)(void))ops)[i])
>  			set_bit(i, sch->has_op);
>  
> -	check_hotplug_seq(sch, ops);
> -	scx_idle_update_selcpu_topology(ops);
> +	ret = check_hotplug_seq(sch, ops);
> +	if (!ret)
> +		scx_idle_update_selcpu_topology(ops);
>  
>  	cpus_read_unlock();
>  
> +	if (ret)
> +		goto err_disable;

The double testing is a bit jarring. Maybe just add cpus_read_unlock() in
the error block so that error return can take place right after
check_hotplug_seq()? Alternatively, create a new error jump target - e.g.
err_disable_unlock_cpus and share it between here and the init failure path?

Thanks.

-- 
tejun




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux