History

sched_ext: Remove redundant rcu_read_lock/unlock() in sysrq_handle_sched_ext_reset()

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.

Zqiang committed 6 months ago

Commit d757ac21 parent 97f86c31 file · +0 −2Browse files

Unified · Split

kernel/sched/ext.c+0−2
@@ -7914,13 +7914,11 @@ static void sysrq_handle_sched_ext_reset(u8 key) · 7913 unmodified lines
79147914 {
79157915 struct scx_sched *sch;
79167916
7917− rcu_read_lock();
79187917 sch = rcu_dereference(scx_root);
79197918 if (likely(sch))
79207919 scx_disable(sch, SCX_EXIT_SYSRQ);
79217920 else
79227921 pr_info("sched_ext: BPF schedulers not loaded\n");
7923− rcu_read_unlock();
79247922 }
79257923
79267924 static const struct sysrq_key_op sysrq_sched_ext_reset_op = {