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.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -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 | else | 7920 | 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 | ||
| 7926 | static const struct sysrq_key_op sysrq_sched_ext_reset_op = { | 7924 | static const struct sysrq_key_op sysrq_sched_ext_reset_op = { |