Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1469812ybd; Wed, 26 Jun 2019 18:38:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/Zjal+XFCUNdSalUAh81/jqM545/a39YX0ruXtD/hahWWp7VMu5vMYQPwZl0lN3oR8ynR X-Received: by 2002:a17:902:8eca:: with SMTP id x10mr1409707plo.266.1561599485884; Wed, 26 Jun 2019 18:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561599485; cv=none; d=google.com; s=arc-20160816; b=nKabYRvcZElVEsyXvyx1Tn1EW60avNyiWiXIB5PzEANt/i4Y8kfAVPoCDcgcZQ6PvP fjkM9BMm00MbFw7jOm25iu+fm3ELFGGjRgPr+QcgEMVGSPvlNA9B5ZpcbPcDc6UfCUIC y8YaOPZO2hp6OpPYEaGBk/wUjPQnxohu0ZH86aCtW0bpaziOs6vRVgfF0fyjBtG6niAS /rK96HC/yk89iVQtm1ujKqaD6HgkXyU8FRKtFWbEycBmJ4xbpa9/yBhinkEOJWWjfR5W PJgB15jJHc8uYidIvb/G1Yp8z3ekTu6dtUb7kthZd/EX/r0a9sDAmTFGycNczREFNY9D 0j8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Tct/r78PzAI1Nw33grKOwsL1YAYVa9bkSMicZSxpV80=; b=aw7QpVi9VQ4Wc7+5uN/K6SZlXwA9yGZ294EXIONVR1em225Ld0gm76REajxeqkrjm/ 51/z2XfHmXbCOb2v8uOK3GNbMyCCQ80UB4y+P7V7gQpkc4ZlBWmGPfkTzG+KkkHVskxO z+Icjv3Wm+5CtnHhnGAW/0RD9aCNq7PHVybeTbaWPT5kHV7uQtBfqqxKzJs5m+1SEFiD Sm0AEDgBcZOmPCYR2Y1OIaJ9zNMRCDmPTiBeHAe41Fs7ghzE/RExjcMiDIsogmZMvUt6 QmTYbrDuEP3jhrG6CGXj/X4xzcnce3ZoWmYaR5XtHtwBc/lMMyGR0Ob45L/eKhHE/iUc rKtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=kacUom4T; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si639571pgv.233.2019.06.26.18.37.50; Wed, 26 Jun 2019 18:38:05 -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=@oracle.com header.s=corp-2018-07-02 header.b=kacUom4T; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726836AbfF0BhC (ORCPT + 99 others); Wed, 26 Jun 2019 21:37:02 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:37904 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbfF0BhB (ORCPT ); Wed, 26 Jun 2019 21:37:01 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5R1YiH8013914; Thu, 27 Jun 2019 01:36:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=Tct/r78PzAI1Nw33grKOwsL1YAYVa9bkSMicZSxpV80=; b=kacUom4TNyk1mlggbtCdX0kflSN9NbJIaehCoEwjwwdqnDvhJpIoGj2Ju79k4uK8b0PB WVyPJVHkwy9THcMafJBvEtOsgG1/a6NZ3l8eZTyh9PmtktrHV8B59HbX4BoBDQxVJvfy OgcKXwGxJVsJ21o2/rwyVXiOZkiTfJc5P89RAMP/Zv0sj3dzhvXK9Y+iK81UQqZLwHUv EGTDMytPFBlIIjnsbgZkapoQp2TbjOdOzIIVkKOxhKPCH/2qqm01yF53MMXwuOOTEP9/ wafPUfm2bEFrIkGA0fPb0RTjpXev0TlTgHZqZ+Zblf8MHcxoygaCOt7N4BA9OULnamsV Ow== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2t9brtdfkx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2019 01:36:31 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5R1XdUv017552; Thu, 27 Jun 2019 01:34:31 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2tat7d4a44-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2019 01:34:31 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x5R1YUIF007575; Thu, 27 Jun 2019 01:34:30 GMT Received: from smazumda-Precision-T1600.us.oracle.com (/10.132.91.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Jun 2019 18:34:30 -0700 From: subhra mazumdar To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, tglx@linutronix.de, steven.sistare@oracle.com, dhaval.giani@oracle.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, viresh.kumar@linaro.org, tim.c.chen@linux.intel.com, mgorman@techsingularity.net Subject: [PATCH v3 7/7] sched: use per-cpu variable cpumask_weight_sibling Date: Wed, 26 Jun 2019 18:29:19 -0700 Message-Id: <20190627012919.4341-8-subhra.mazumdar@oracle.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20190627012919.4341-1-subhra.mazumdar@oracle.com> References: <20190627012919.4341-1-subhra.mazumdar@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9300 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=783 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906270016 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9300 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=829 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906270017 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use per-cpu var cpumask_weight_sibling for quick lookup in select_idle_cpu. This is the fast path of scheduler and every cycle is worth saving. Usage of cpumask_weight can result in iterations. Signed-off-by: subhra mazumdar --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6a74808..878f11c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6206,7 +6206,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t if (sched_feat(SIS_PROP)) { u64 span_avg = sd->span_weight * avg_idle; - floor = cpumask_weight(topology_sibling_cpumask(target)); + floor = topology_sibling_weight(target); if (floor < 2) floor = 2; limit = floor << 1; -- 2.9.3