]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched_ext: Remove redundant rcu_read_lock/unlock() in sysrq_handle_sched_ext_reset()
authorZqiang <qiang.zhang@linux.dev>
Thu, 30 Apr 2026 08:45:43 +0000 (16:45 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 4 May 2026 21:00:31 +0000 (11:00 -1000)
sysrq_handle_sched_ext_reset() is called from __handle_sysrq(), which
already holds rcu_read_lock() while invoking the sysrq handler. Remove
the redundant rcu_read_lock/unlock() pair.

Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Reviewed-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c

index f3a585e32db36bece0d8fdd5987ca728e09795ad..4287654c746fa63235eebc132cd48c29ae4e4e52 100644 (file)
@@ -7914,13 +7914,11 @@ static void sysrq_handle_sched_ext_reset(u8 key)
 {
        struct scx_sched *sch;
 
-       rcu_read_lock();
        sch = rcu_dereference(scx_root);
        if (likely(sch))
                scx_disable(sch, SCX_EXIT_SYSRQ);
        else
                pr_info("sched_ext: BPF schedulers not loaded\n");
-       rcu_read_unlock();
 }
 
 static const struct sysrq_key_op sysrq_sched_ext_reset_op = {