Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022Ab2E3JxJ (ORCPT ); Wed, 30 May 2012 05:53:09 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:24012 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751401Ab2E3Jvy (ORCPT ); Wed, 30 May 2012 05:51:54 -0400 From: Glauber Costa To: Cc: , , Paul Turner , Peter Zijlstra , Tejun Heo , "Eric W. Biederman" , handai.szj@gmail.com, Andrew.Phillips@lmax.com, Serge Hallyn , Glauber Costa Subject: [PATCH v3 1/6] measure exec_clock for rt sched entities Date: Wed, 30 May 2012 13:48:32 +0400 Message-Id: <1338371317-5980-2-git-send-email-glommer@parallels.com> X-Mailer: git-send-email 1.7.10.2 In-Reply-To: <1338371317-5980-1-git-send-email-glommer@parallels.com> References: <1338371317-5980-1-git-send-email-glommer@parallels.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1434 Lines: 51 For simetry with the cfq tasks, measure exec_clock for the rt sched entities (rt_se). This can be used in a number of fashions. For instance, to compute total cpu usage in a cgroup that is generated by rt tasks. Signed-off-by: Glauber Costa CC: Peter Zijlstra CC: Paul Turner --- kernel/sched/rt.c | 5 +++++ kernel/sched/sched.h | 1 + 2 files changed, 6 insertions(+) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index c5565c3..30ee4e2 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -919,6 +919,11 @@ static void update_curr_rt(struct rq *rq) sched_rt_avg_update(rq, delta_exec); + for_each_sched_rt_entity(rt_se) { + rt_rq = rt_rq_of_se(rt_se); + schedstat_add(rt_rq, exec_clock, delta_exec); + } + if (!rt_bandwidth_enabled()) return; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index ba9dccf..cd2f1e1 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -295,6 +295,7 @@ struct rt_rq { struct plist_head pushable_tasks; #endif int rt_throttled; + u64 exec_clock; u64 rt_time; u64 rt_runtime; /* Nests inside the rq lock: */ -- 1.7.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/