mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
sched_ext: Print sub-scheduler disabled log and reason
Take scx_qmap for example, when sub scheduler is attached, there is 'BPF sub-scheduler "qmap" enabled' message, but when detached, the log is missing. Add a new function to do the log thing, it can be used by both root scheduler and sub scheduler. Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn> Reviewed-by: Cheng-Yang Chou <yphbchou0911@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
26fb937c7b
commit
5425abc222
|
|
@ -5526,6 +5526,26 @@ static void scx_disable_dump(struct scx_sched *sch)
|
|||
sch->dump_disabled = true;
|
||||
}
|
||||
|
||||
static void scx_log_sched_disable(struct scx_sched *sch)
|
||||
{
|
||||
struct scx_exit_info *ei = sch->exit_info;
|
||||
const char *type = scx_parent(sch) ? "sub-scheduler" : "scheduler";
|
||||
|
||||
if (ei->kind >= SCX_EXIT_ERROR) {
|
||||
pr_err("sched_ext: BPF %s \"%s\" disabled (%s)\n", type,
|
||||
sch->ops.name, ei->reason);
|
||||
|
||||
if (ei->msg[0] != '\0')
|
||||
pr_err("sched_ext: %s: %s\n", sch->ops.name, ei->msg);
|
||||
#ifdef CONFIG_STACKTRACE
|
||||
stack_trace_print(ei->bt, ei->bt_len, 2);
|
||||
#endif
|
||||
} else {
|
||||
pr_info("sched_ext: BPF %s \"%s\" disabled (%s)\n", type,
|
||||
sch->ops.name, ei->reason);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_EXT_SUB_SCHED
|
||||
static DECLARE_WAIT_QUEUE_HEAD(scx_unlink_waitq);
|
||||
|
||||
|
|
@ -5696,6 +5716,8 @@ static void scx_sub_disable(struct scx_sched *sch)
|
|||
&sub_detach_args);
|
||||
}
|
||||
|
||||
scx_log_sched_disable(sch);
|
||||
|
||||
if (sch->ops.exit)
|
||||
SCX_CALL_OP(sch, exit, NULL, sch->exit_info);
|
||||
kobject_del(&sch->kobj);
|
||||
|
|
@ -5707,7 +5729,6 @@ static void scx_sub_disable(struct scx_sched *sch) { }
|
|||
|
||||
static void scx_root_disable(struct scx_sched *sch)
|
||||
{
|
||||
struct scx_exit_info *ei = sch->exit_info;
|
||||
struct scx_task_iter sti;
|
||||
struct task_struct *p;
|
||||
int cpu;
|
||||
|
|
@ -5797,22 +5818,10 @@ static void scx_root_disable(struct scx_sched *sch)
|
|||
scx_idle_disable();
|
||||
synchronize_rcu();
|
||||
|
||||
if (ei->kind >= SCX_EXIT_ERROR) {
|
||||
pr_err("sched_ext: BPF scheduler \"%s\" disabled (%s)\n",
|
||||
sch->ops.name, ei->reason);
|
||||
|
||||
if (ei->msg[0] != '\0')
|
||||
pr_err("sched_ext: %s: %s\n", sch->ops.name, ei->msg);
|
||||
#ifdef CONFIG_STACKTRACE
|
||||
stack_trace_print(ei->bt, ei->bt_len, 2);
|
||||
#endif
|
||||
} else {
|
||||
pr_info("sched_ext: BPF scheduler \"%s\" disabled (%s)\n",
|
||||
sch->ops.name, ei->reason);
|
||||
}
|
||||
scx_log_sched_disable(sch);
|
||||
|
||||
if (sch->ops.exit)
|
||||
SCX_CALL_OP(sch, exit, NULL, ei);
|
||||
SCX_CALL_OP(sch, exit, NULL, sch->exit_info);
|
||||
|
||||
scx_unlink_sched(sch);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user