From patchwork Thu Apr 27 08:29:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 98280 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp700090qgf; Thu, 27 Apr 2017 01:31:02 -0700 (PDT) X-Received: by 10.99.117.19 with SMTP id q19mr4260252pgc.106.1493281862109; Thu, 27 Apr 2017 01:31:02 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78si1959640pgh.24.2017.04.27.01.31.01; Thu, 27 Apr 2017 01:31:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934538AbdD0Iaw (ORCPT + 25 others); Thu, 27 Apr 2017 04:30:52 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:33644 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751701AbdD0Ian (ORCPT ); Thu, 27 Apr 2017 04:30:43 -0400 Received: by mail-pf0-f181.google.com with SMTP id a188so19984386pfa.0 for ; Thu, 27 Apr 2017 01:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=YYuetL+EUGpHq7kOs3N450paGyMt0zx8Mp5RxOY6r8g=; b=DscDbQ9QZnF/ud1V8wJOCIBsA8FkKfXSXjIzrmw/S+AA/clBVHzeAMiv8PKvIQ4Xaj dG5MUP5rgH9gyhxVaFAfHFNPhnFKSYFHi8r23akL3S2P/48S5sXZ+BhbRiYZR7P+J1iJ kq1bMkCfFr22lXEPqkq6DjgevoQHUAssn8vOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=YYuetL+EUGpHq7kOs3N450paGyMt0zx8Mp5RxOY6r8g=; b=gQNUK0G4YfcMzCHQUEYZaDArruTPKIx4m/l1sMWaU3XkXfCG5Bk9jFAfYPoG55Knfo VmXjDp0qGxP0HidBxajuPj5v4dATanpDl33R1QgR35cGpyJVQKgKHFYAOqAjtXkvEmK2 84mIql7+tLdK3Snos6uJldL52UuMfiMaV2P+U8jivISMJmu7K2n2l4dmoDPeolcE9wpN fBZmBw5ww0TFQXZ3QYInNOdrGR5qJtqk+gVZC9lZClTWtdVkUY73o4PImc8eRS37HdtX 8bXl+uwMocJWGrSH7lB89I2HrsyBO/a4156OI2qbtdIu/xV2tYtSWp20LLjo0atW+4/8 N0FA== X-Gm-Message-State: AN3rC/5DxfHvU7TJYRFRiT0WgnIXxO6K+H0ccB1EH3JiQ6ZMz+AAOFM8 Y7RhAhD46XOnKFf2 X-Received: by 10.98.137.221 with SMTP id n90mr4600364pfk.52.1493281842256; Thu, 27 Apr 2017 01:30:42 -0700 (PDT) Received: from localhost ([122.172.121.5]) by smtp.gmail.com with ESMTPSA id e5sm3571617pga.13.2017.04.27.01.30.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Apr 2017 01:30:41 -0700 (PDT) From: Viresh Kumar To: Ingo Molnar , Peter Zijlstra Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Vincent Guittot , Viresh Kumar Subject: [PATCH 2/2] sched: topology: Initialize span_weight from sd_init() Date: Thu, 27 Apr 2017 13:59:00 +0530 Message-Id: X-Mailer: git-send-email 2.12.0.432.g71c3a4f4ba37 In-Reply-To: <36e4cbb6210002cadae89920ae97e19e7e513008.1493281605.git.viresh.kumar@linaro.org> References: <36e4cbb6210002cadae89920ae97e19e7e513008.1493281605.git.viresh.kumar@linaro.org> In-Reply-To: <36e4cbb6210002cadae89920ae97e19e7e513008.1493281605.git.viresh.kumar@linaro.org> References: <36e4cbb6210002cadae89920ae97e19e7e513008.1493281605.git.viresh.kumar@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most of the sched domain structure gets initialized from sd_init() and it looks reasonable to initialize span_weight too from it. Currently it is getting initialized from build_sched_domains(), which doesn't looks to be the ideal place for doing so. With this change we need to additionally reset span_weight for a special error case, but that looks reasonable as span_weight must be updated every time domain span is updated. Signed-off-by: Viresh Kumar --- kernel/sched/topology.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.12.0.432.g71c3a4f4ba37 diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 09a56ca76bd1..691b290a679e 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -892,6 +892,7 @@ sd_init(struct sched_domain_topology_level *tl, .last_balance = jiffies, .balance_interval = sd_weight, + .span_weight = sd_weight, .smt_gain = 0, .max_newidle_lb_cost = 0, .next_decay_max_lb_cost = jiffies, @@ -1373,6 +1374,7 @@ static struct sched_domain *build_sched_domain(struct sched_domain_topology_leve cpumask_or(sched_domain_span(sd), sched_domain_span(sd), sched_domain_span(child)); + sd->span_weight = cpumask_weight(sched_domain_span(sd)); } } @@ -1417,7 +1419,6 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att /* Build the groups for the domains */ for_each_cpu(i, cpu_map) { for (sd = *per_cpu_ptr(d.sd, i); sd; sd = sd->parent) { - sd->span_weight = cpumask_weight(sched_domain_span(sd)); if (sd->flags & SD_OVERLAP) { if (build_overlap_sched_groups(sd, i)) goto error;