Re: [PATCH] tg: add cpu's wait_count of a task group

From
Tejun Heo <hidden>
Date
2021-01-19 15:32:25
Hello,

On Mon, Jan 18, 2021 at 11:07:47AM +0800, liming wu wrote:
quoted
quoted
+             if (schedstat_enabled() && tg != &root_task_group) {
+                     u64 ws = 0;
+                     u64 wc = 0;
+                     int i;
+
+                     for_each_possible_cpu(i) {
+                             ws += schedstat_val(tg->se[i]->statistics.wait_sum);
+                             wc += schedstat_val(tg->se[i]->statistics.wait_count);
+                     }
+
+                     seq_printf(sf, "wait_sum %llu\n"
+                             "wait_count %llu\n", ws, wc);
+             }
What does sum/count tell?
It can tell the task group average latency of every context switch
wait_sum is equivalent to sched_info->run_delay (the second parameter
of /proc/$pid/schedstat)
wait_count is equivalent to sched_info->pcount(the third parameter of
/proc/$pid/schedstat)
Sounds good to me but can you please:

* Rename wait_sum to wait_usec and make sure the duration is in usecs.

* Rename wait_count to nr_waits.

* This should go through the scheduler tree. When you post the updated
  version, please cc the scheduler folks from MAINAINERS.

Thanks.

-- 
tejun
Thread (1 message) 1 message, 1 author, last reply 2021-01-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help