Messages in this thread Patch in this message | | | Date | Mon, 18 Feb 2019 17:56:36 +0100 | From | Peter Zijlstra <> | Subject | [RFC][PATCH 16/16] sched: Debug bits... |
| |
Not-Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> --- --- kernel/sched/core.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-)
--- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -91,6 +91,10 @@ static inline bool __prio_less(struct ta { int pa = __task_prio(a), pb = __task_prio(b); + trace_printk("(%s/%d;%d,%Lu,%Lu) ?< (%s/%d;%d,%Lu,%Lu)\n", + a->comm, a->pid, pa, a->se.vruntime, a->dl.deadline, + b->comm, b->pid, pa, b->se.vruntime, b->dl.deadline); + if (-pa < -pb) return true; @@ -245,6 +249,8 @@ static void __sched_core_enable(void) static_branch_enable(&__sched_core_enabled); stop_machine(__sched_core_stopper, (void *)true, NULL); + + printk("core sched enabled\n"); } static void __sched_core_disable(void) @@ -253,6 +259,8 @@ static void __sched_core_disable(void) stop_machine(__sched_core_stopper, (void *)false, NULL); static_branch_disable(&__sched_core_enabled); + + printk("core sched disabled\n"); } void sched_core_get(void) @@ -3684,6 +3692,14 @@ pick_next_task(struct rq *rq, struct tas put_prev_task(rq, prev); set_next_task(rq, next); } + + trace_printk("pick pre selected (%u %u %u): %s/%d %lx\n", + rq->core->core_task_seq, + rq->core->core_pick_seq, + rq->core_sched_seq, + next->comm, next->pid, + next->core_cookie); + return next; } @@ -3753,6 +3769,10 @@ pick_next_task(struct rq *rq, struct tas */ if (i == cpu && !rq->core->core_cookie && !p->core_cookie) { next = p; + + trace_printk("unconstrained pick: %s/%d %lx\n", + next->comm, next->pid, next->core_cookie); + goto done; } @@ -3761,6 +3781,9 @@ pick_next_task(struct rq *rq, struct tas rq_i->core_pick = p; + trace_printk("cpu(%d): selected: %s/%d %lx\n", + i, p->comm, p->pid, p->core_cookie); + /* * If this new candidate is of higher priority than the * previous; and they're incompatible; we need to wipe @@ -3774,6 +3797,7 @@ pick_next_task(struct rq *rq, struct tas rq->core->core_cookie = p->core_cookie; max = p; + trace_printk("max: %s/%d %lx\n", max->comm, max->pid, max->core_cookie); if (old_max && !cookie_match(old_max, p)) { for_each_cpu(j, smt_mask) { @@ -3810,13 +3834,17 @@ next_class:; if (i == cpu) continue; - if (rq_i->curr != rq_i->core_pick) + if (rq_i->curr != rq_i->core_pick) { resched_curr(rq_i); + trace_printk("IPI(%d)\n", i); + } } rq->core_sched_seq = rq->core->core_pick_seq; next = rq->core_pick; + trace_printk("picked: %s/%d %lx\n", next->comm, next->pid, next->core_cookie); + done: set_next_task(rq, next); return next; @@ -3853,6 +3881,10 @@ static bool try_steal_cookie(int this, i if (p->core_occupation > dst->idle->core_occupation) goto next; + trace_printk("core fill: %s/%d (%d->%d) %d %d %lx\n", + p->comm, p->pid, that, this, + p->core_occupation, dst->idle->core_occupation, cookie); + p->on_rq = TASK_ON_RQ_MIGRATING; deactivate_task(src, p, 0); set_task_cpu(p, this); @@ -6434,6 +6466,8 @@ int sched_cpu_starting(unsigned int cpu) WARN_ON_ONCE(rq->core && rq->core != core_rq); rq->core = core_rq; } + + printk("core: %d -> %d\n", cpu, cpu_of(core_rq)); #endif /* CONFIG_SCHED_CORE */ sched_rq_cpu_starting(cpu);
| |