Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470Ab2E3Ke2 (ORCPT ); Wed, 30 May 2012 06:34:28 -0400 Received: from mx2.parallels.com ([64.131.90.16]:57903 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416Ab2E3Ke0 (ORCPT ); Wed, 30 May 2012 06:34:26 -0400 Message-ID: <4FC5F727.2040804@parallels.com> Date: Wed, 30 May 2012 14:32:07 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Peter Zijlstra CC: , , , Paul Turner , Tejun Heo , "Eric W. Biederman" , , , Serge Hallyn Subject: Re: [PATCH v3 1/6] measure exec_clock for rt sched entities References: <1338371317-5980-1-git-send-email-glommer@parallels.com> <1338371317-5980-2-git-send-email-glommer@parallels.com> <1338373759.26856.238.camel@twins> In-Reply-To: <1338373759.26856.238.camel@twins> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1741 Lines: 54 On 05/30/2012 02:29 PM, Peter Zijlstra wrote: > On Wed, 2012-05-30 at 13:48 +0400, Glauber Costa wrote: >> For simetry with the cfq tasks, measure exec_clock for the rt >> sched entities (rt_se). > > Symmetry methinks.. =p bad me > anyway, where is the symmetry?, fair.c:update_curr() > doesn't do the for_each_sched_entity() thing. It does implicitly, because fair.c:update_curr() is called from within enqueue_task(), that is called for_each_sched_entity in enqueue_task_fair(). > >> 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; > > See, this just makes me sad.. you now have a double > for_each_sched_rt_entity() loop. The way I read the rt.c code, it it is called from enqueue_task_rt only once. -- 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/