Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2df49954 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/rt: Improve RT throttling debugging



Most of the times, RT throttling is hit due to the current task
hogging the CPU. But we have to do the ramdump analysis to
really confirm that the current task is running for long time.
We can help the cause by printing this information in logbuf.
Print the RT period timer info which will tell if throttling
happened because runtime is not replenished.

Change-Id: Ic032b26b40c771a0e6d9419a6c13ab2f32f83a77
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 0620a466
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -914,15 +914,30 @@ static void dump_throttled_rt_tasks(struct rt_rq *rt_rq)
	char *pos = buf;
	char *end = buf + sizeof(buf);
	int idx;
	struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq);

	pos += snprintf(pos, sizeof(buf),
		"sched: RT throttling activated for rt_rq %p (cpu %d)\n",
		rt_rq, cpu_of(rq_of_rt_rq(rt_rq)));

	pos += snprintf(pos, end - pos,
			"rt_period_timer: expires=%lld now=%llu period=%llu\n",
			hrtimer_get_expires_ns(&rt_b->rt_period_timer),
			ktime_get_ns(), sched_rt_period(rt_rq));

	if (bitmap_empty(array->bitmap, MAX_RT_PRIO))
		goto out;

	pos += snprintf(pos, end - pos, "potential CPU hogs:\n");
#ifdef CONFIG_SCHED_INFO
	if (sched_info_on())
		pos += snprintf(pos, end - pos,
				"current %s (%d) is running for %llu nsec\n",
				current->comm, current->pid,
				rq_clock(rq_of_rt_rq(rt_rq)) -
				current->sched_info.last_arrival);
#endif

	idx = sched_find_first_bit(array->bitmap);
	while (idx < MAX_RT_PRIO) {
		list_for_each_entry(rt_se, array->queue + idx, run_list) {