Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758649Ab2EBDg1 (ORCPT ); Tue, 1 May 2012 23:36:27 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:35450 "EHLO e23smtp09.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758498Ab2EBDg0 (ORCPT ); Tue, 1 May 2012 23:36:26 -0400 Message-ID: <4FA0ABA7.10906@linux.vnet.ibm.com> Date: Wed, 02 May 2012 11:36:07 +0800 From: Michael Wang User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120412 Thunderbird/11.0.1 MIME-Version: 1.0 To: Frederic Weisbecker CC: LKML , linaro-sched-sig@lists.linaro.org, Alessio Igor Bogani , Andrew Morton , Avi Kivity , Chris Metcalf , Christoph Lameter , Daniel Lezcano , Geoff Levand , Gilad Ben Yossef , Hakan Akkan , Ingo Molnar , Kevin Hilman , Max Krasnyansky , "Paul E. McKenney" , Peter Zijlstra , Stephen Hemminger , Steven Rostedt , Sven-Thorsten Dietrich , Thomas Gleixner Subject: Re: [PATCH 35/41] sched: Update rq clock before idle balancing References: <1335830115-14335-1-git-send-email-fweisbec@gmail.com> <1335830115-14335-36-git-send-email-fweisbec@gmail.com> In-Reply-To: <1335830115-14335-36-git-send-email-fweisbec@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit x-cbid: 12050118-3568-0000-0000-000001A212B0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2508 Lines: 66 On 05/01/2012 07:55 AM, Frederic Weisbecker wrote: > idle_balance() is called from schedule() right before we schedule the > idle task. It needs to record the idle timestamp at that time and for > this the rq clock must be accurate. If the CPU is running tickless > we need to update the rq clock manually. > > Signed-off-by: Frederic Weisbecker > Cc: Alessio Igor Bogani > Cc: Andrew Morton > Cc: Avi Kivity > Cc: Chris Metcalf > Cc: Christoph Lameter > Cc: Daniel Lezcano > Cc: Geoff Levand > Cc: Gilad Ben Yossef > Cc: Hakan Akkan > Cc: Ingo Molnar > Cc: Kevin Hilman > Cc: Max Krasnyansky > Cc: Paul E. McKenney > Cc: Peter Zijlstra > Cc: Stephen Hemminger > Cc: Steven Rostedt > Cc: Sven-Thorsten Dietrich > Cc: Thomas Gleixner > --- > kernel/sched/fair.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index eff80e0..cd871e7 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -4638,6 +4638,7 @@ void idle_balance(int this_cpu, struct rq *this_rq) > int pulled_task = 0; > unsigned long next_balance = jiffies + HZ; > > + update_nohz_rq_clock(this_rq); I'm not sure but why we have to care nohz? if we really need an accurate clock, we should do the update anyway, don't we? Some thing also confused me is the description: "If the CPU is running tickless we need to update the rq clock manually." I think the cpu will enter tickless mode only when the idle thread already switched in, then invoke tick_nohz_idle_enter->tick_nohz_stop_sched_tick, isn't it? And if we invoke idle_balance for a cpu, that means it hasn't enter idle(current task is not idle task), so how can such a cpu in tickless mode? Regards, Michael Wang > this_rq->idle_stamp = this_rq->clock; > > if (this_rq->avg_idle < sysctl_sched_migration_cost) -- 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/