Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161076Ab3DFQra (ORCPT ); Sat, 6 Apr 2013 12:47:30 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:46380 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753002Ab3DFQqM (ORCPT ); Sat, 6 Apr 2013 12:46:12 -0400 From: Frederic Weisbecker To: Ingo Molnar Cc: LKML , Frederic Weisbecker , Alessio Igor Bogani , Andrew Morton , Chris Metcalf , Christoph Lameter , Geoff Levand , Gilad Ben Yossef , Hakan Akkan , Li Zhong , Namhyung Kim , "Paul E. McKenney" , Paul Gortmaker , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Paul Turner , Mike Galbraith Subject: [PATCH 2/7] sched: Update rq clock on nohz CPU before setting fair group shares Date: Sat, 6 Apr 2013 18:45:55 +0200 Message-Id: <1365266760-24725-3-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1365266760-24725-1-git-send-email-fweisbec@gmail.com> References: <1365266760-24725-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2067 Lines: 53 Because we may update the execution time (sched_group_set_shares()-> update_cfs_shares()->reweight_entity()->update_curr()) before reweighting the entity after updating the group shares and this requires an uptodate version of the runqueue clock. Let's update it on the target CPU if it runs tickless because scheduler_tick() is not there to maintain it. Signed-off-by: Frederic Weisbecker Cc: Alessio Igor Bogani Cc: Andrew Morton Cc: Chris Metcalf Cc: Christoph Lameter Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: Ingo Molnar Cc: Li Zhong Cc: Namhyung Kim Cc: Paul E. McKenney Cc: Paul Gortmaker Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Paul Turner Cc: Mike Galbraith --- kernel/sched/fair.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 539760e..6d35f8a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6060,6 +6060,11 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares) se = tg->se[i]; /* Propagate contribution to hierarchy */ raw_spin_lock_irqsave(&rq->lock, flags); + /* + * We may call update_curr() which needs an up-to-date + * version of rq clock if the CPU runs tickless. + */ + update_nohz_rq_clock(rq); for_each_sched_entity(se) update_cfs_shares(group_cfs_rq(se)); raw_spin_unlock_irqrestore(&rq->lock, flags); -- 1.7.5.4 -- 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/