sched_ext: Remove redundant rcu_read_lock/unlock() in sysrq_handle_sched_ext_reset()
Subsystems (2)
PATCH 1/1 sched_ext: Remove redundant rcu_read_lock/unlock() in sysrq_handle_sched_ext_reset()
The sysrq_handle_sched_ext_reset() callback has already been executed in the rcu read critical section within __handle_sysrq(), this commit therefore remove redundant rcu_read_lock/unlock() in the sysrq_handle_sched_ext_reset().
--- kernel/sched/ext.c | 2 -- 1 file changed, 2 deletions(-)
kernel/sched/ext.c +0 -2
@@ -7953,13 +7953,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 = {
Signature · 1 line
2.17.1
Hi Zqiang,
Quoted 3 lines · Zqiang
The
sysrq_handle_sched_ext_reset()callback has already been executed in the rcu read critical section within__handle_sysrq(), this commit therefore remove redundant rcu_read_lock/unlock() in
Nit: s/remove/removes
Looks good!
Quoted 29 lines
the
sysrq_handle_sched_ext_reset().Signed-off-by Zqiang <[email protected]>--- kernel/sched/ext.c | 2 -- 1 file changed, 2 deletions(-)kernel/sched/ext.c +0
-2@@ -7953,13 +7953,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 = {Signature · 1 line
2.17.1
Signature · 2 lines
Cheers, Cheng-Yang
Hi Zqiang,
Quoted 6 lines · Zqiang
The
sysrq_handle_sched_ext_reset()callback has already been executed in the rcu read critical section within__handle_sysrq(), this commit therefore remove redundant rcu_read_lock/unlock() in thesysrq_handle_sched_ext_reset().Signed-off-by Zqiang <[email protected]>
Looks good to me.
Thanks,
-Andrea
Quoted 25 lines
--- kernel/sched/ext.c | 2 -- 1 file changed, 2 deletions(-)kernel/sched/ext.c +0
-2@@ -7953,13 +7953,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 = {Signature · 1 line
2.17.1
Andrea Righi
reviewerQuoted 7 lines · Andrea Righi
Hi Zqiang,
Quoted 4 lines · Zqiang
The
sysrq_handle_sched_ext_reset()callback has already been executed in the rcu read critical section within__handle_sysrq(), this commit therefore remove redundant rcu_read_lock/unlock() in thesysrq_handle_sched_ext_reset().
Actually, minor nits in the commit message:
1) s/has already been executed/is executed/
2) s/remove/removes/
Or maybe rephrase as following?
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.
Thanks,
-Andrea
Quoted 35 lines
Quoted 2 lines
Signed-off-by Zqiang <[email protected]>Looks good to me.
Reviewed-by Andrea Righi <[email protected]>Thanks,
-AndreaQuoted 25 lines
--- kernel/sched/ext.c | 2 -- 1 file changed, 2 deletions(-)kernel/sched/ext.c +0
-2@@ -7953,13 +7953,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 = {Signature · 1 line
2.17.1
Hello,
Applied to sched_ext/for-7.2 with Andrea's suggested commit message rewording and both Reviewed-by tags.
Thanks.
--
tejun
Quoted 5 lines
Hello,
Applied to sched_ext/for-7.2 with Andrea's suggested commit message rewording and both Reviewed-by tags.
Thanks both (Andrea's suggested commit and Cheng-Yang Chou's review) and tejun.
Thanks
Zqiang
Quoted 6 lines
Thanks.
--
tejun