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
7914{7914{
7915 struct scx_sched *sch;7915 struct scx_sched *sch;
7916 7916
7917 rcu_read_lock();
7918 sch = rcu_dereference(scx_root);7917 sch = rcu_dereference(scx_root);
7919 if (likely(sch))7918 if (likely(sch))
7920 scx_disable(sch, SCX_EXIT_SYSRQ);7919 scx_disable(sch, SCX_EXIT_SYSRQ);
7921 else7920 else
7922 pr_info("sched_ext: BPF schedulers not loaded\n");7921 pr_info("sched_ext: BPF schedulers not loaded\n");
7923 rcu_read_unlock();
7924}7922}
7925 7923
7926static const struct sysrq_key_op sysrq_sched_ext_reset_op = {7924static const struct sysrq_key_op sysrq_sched_ext_reset_op = {