From patchwork Thu Sep 13 04:11:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 11383 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5CD1A23E41 for ; Thu, 13 Sep 2012 04:11:41 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6A90034B9216 for ; Thu, 13 Sep 2012 04:11:39 +0000 (UTC) Received: by iafj25 with SMTP id j25so1829722iaf.11 for ; Wed, 12 Sep 2012 21:11:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=eNUJE/gSUxfLE0bwlTqnhSXVj+2nWh2YldWDKzLGBgc=; b=BNgvypSXxvEeoJMOkBUcqMAU+t9ErY6Lx3fSIMAl8gaANKi98gI5XMYdWfVcFTF9Hk WkJ+SWqsMHguLz8rR2iEZwpeKy4oB6330hhrJL6uV5y9mW82+7AYH7oUEVljd0+xAbVL PMpsErfFeDLkPzKKNgzCMUfdlv5iiJZUGbvW87i9aeDxbj1gBKmNieJv4WnVnEojBG35 uzPEzUHVYRwHRXbD0v6neFL0XDUrJ5JyDXvj2sWu/qDKb9ZsRavr+By6Vl0QatS2yUQ5 fd+faduL4OvZS3qI0WIBOH4NN6edoURPREy0Rp6KDNGRBa2jZb5ZJ0Ojph/xJHfcDthb jKIw== Received: by 10.42.109.194 with SMTP id m2mr493198icp.48.1347509498651; Wed, 12 Sep 2012 21:11:38 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp111836igc; Wed, 12 Sep 2012 21:11:37 -0700 (PDT) Received: by 10.152.114.3 with SMTP id jc3mr553459lab.11.1347509496920; Wed, 12 Sep 2012 21:11:36 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx.google.com with ESMTPS id q7si32591119lbf.53.2012.09.12.21.11.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Sep 2012 21:11:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.178 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=209.85.217.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.217.178 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) smtp.mail=vincent.guittot@linaro.org Received: by lbok6 with SMTP id k6so1925525lbo.37 for ; Wed, 12 Sep 2012 21:11:36 -0700 (PDT) Received: by 10.112.25.99 with SMTP id b3mr360065lbg.114.1347509495987; Wed, 12 Sep 2012 21:11:35 -0700 (PDT) Received: from lmenx30s.homerun.telia.com (host-78-65-129-30.homerun.telia.com. [78.65.129.30]) by mx.google.com with ESMTPS id lr17sm22049108lab.12.2012.09.12.21.11.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Sep 2012 21:11:34 -0700 (PDT) From: Vincent Guittot To: linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org Cc: peterz@infradead.org, mingo@redhat.com, Vincent Guittot Subject: [RFC] sched: nohz_idle_balance Date: Thu, 13 Sep 2012 06:11:26 +0200 Message-Id: <1347509486-8688-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmCzWa6uBBdj8sueUkcyQag1GfSApJ0+5X7maKK1+IomsJczO806OKV+E05j3MKkMO6LsRL On tickless system, one CPU runs load balance for all idle CPUs. The cpu_load of this CPU is updated before starting the load balance of each other idle CPUs. We should instead update the cpu_load of the balance_cpu. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1ca4fe4..9ae3a5b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4794,14 +4794,15 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) if (need_resched()) break; - raw_spin_lock_irq(&this_rq->lock); - update_rq_clock(this_rq); - update_idle_cpu_load(this_rq); - raw_spin_unlock_irq(&this_rq->lock); + rq = cpu_rq(balance_cpu); + + raw_spin_lock_irq(&rq->lock); + update_rq_clock(rq); + update_idle_cpu_load(rq); + raw_spin_unlock_irq(&rq->lock); rebalance_domains(balance_cpu, CPU_IDLE); - rq = cpu_rq(balance_cpu); if (time_after(this_rq->next_balance, rq->next_balance)) this_rq->next_balance = rq->next_balance; }