Received: by 10.192.165.148 with SMTP id m20csp4033250imm; Mon, 23 Apr 2018 17:41:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+SgIaAHyuaWHyfVw1oAjFOFagfCuxaqkJbq0tqTdg9b6I07sui/Nusbwf/In35j0wdD8uF X-Received: by 2002:a17:902:a24:: with SMTP id 33-v6mr22953203plo.72.1524530484882; Mon, 23 Apr 2018 17:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524530484; cv=none; d=google.com; s=arc-20160816; b=CmW5/E9WX15bQjy+LpgObkpi8RZTgpyU0P2bCfgzTu0jF/3lPbff/0zAx5HpAAejPZ kMPK2wXIy+mQIIALninSSlWvBqBOJeFPQ8NrFA3JDkxrXwt7eppuSqFvAtZHBpEPl1Hf dSQryLBg3Z/pmyRUNjn9rj42kG//p79qOVGs37tXihDDT3woBE1cdG6CQMlQpCC2g1v4 2vjBXD/0KW2Uw6mHe5HlSpdFgQzhYpMA+PVMPveCwNUAwHP+ieQogm2+54TyCGqMD1H9 f0eIlH2DJCCyTyabtMEdaudpqvWiTFYgK8LZvBVdwUnw3l7/YlhPhvhSCay4HfBi3GQz toxA== 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:arc-authentication-results; bh=LUnnU1uk+bTaENSz3SyWJLUjWRdzAXk7/V+jz65KojE=; b=i5mnCDWc3Af9nxoIbrMozGGijSxSbZzPwDQn8Y6IEg97ddL41mBOfIa6teXFs8wzOx aY2RH2acxLaVvAOL5/anuSuHrNIeNdKID0o2lew6hiuIPSVwrujBmOjOJVq21pgk/9K7 cJMujTSMBDUbPvvsn7KTFoo0OULtwnlh5oXsWCqvWyeW84bvX//BN1rZPjtbw6qXPCRZ 3UqnydQMCBsGgvsFb7vBg0Mvz2IQPUCyx+2O3i+OmUFVylzl8QrIW1YQ/N0nK9oSh96u Dy67/iFKUPU+eySStLzfn79nrnVpUufnwqS8/JwYHaBCnDQZ10UFHzHIrhv2wR1y3TM8 yrCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=X+dRxNJ9; 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 g14si10583551pgn.227.2018.04.23.17.41.10; Mon, 23 Apr 2018 17:41:24 -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-2017-10-26 header.b=X+dRxNJ9; 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 S932749AbeDXAjb (ORCPT + 99 others); Mon, 23 Apr 2018 20:39:31 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:54676 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932688AbeDXAjA (ORCPT ); Mon, 23 Apr 2018 20:39:00 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3O0UoOo028077; Tue, 24 Apr 2018 00:38:24 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-2017-10-26; bh=LUnnU1uk+bTaENSz3SyWJLUjWRdzAXk7/V+jz65KojE=; b=X+dRxNJ9wa6VGjz3ClNvxCLDgX5Z9YyCZDWR5qHOm63/GMhHITsc6R19A1z2jQUBcGMq 8Bmdz8zSX5uIzGejesvMvXREziUPiB5KOLNY9zLCkiSU9Z17PkYBaIx/IxYmSXlv8no0 +IPAyqfV8Vv63W0ZWMTtaoiHthG2SaYXGXPeV1d+i6HBCJhY8WJXJd+ZzC64gQdf3XYu 7Kvqj45GMug8PRmnToVsQSROnT8j+NJQGLzTRdYgIuowSWf7Zs2R1prtDuUsL4Kvu2jJ UPfvfPE0Yg/L8giiaYNnlV2K1vP0me4v1iKSNYqO81iy8eepuGTq6LJ+T5YdamrafTdu hg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2hfvrbqt9u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Apr 2018 00:38:24 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3O0cNRL025511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Apr 2018 00:38:23 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3O0cN3b003072; Tue, 24 Apr 2018 00:38:23 GMT Received: from smazumda-Precision-T1600.us.oracle.com (/10.132.91.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Apr 2018 17:38:22 -0700 From: subhra mazumdar To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, daniel.lezcano@linaro.org, steven.sistare@oracle.com, dhaval.giani@oracle.com, rohit.k.jain@oracle.com, subhra.mazumdar@oracle.com Subject: [PATCH 2/3] sched: introduce per-cpu var next_cpu to track search limit Date: Mon, 23 Apr 2018 17:41:15 -0700 Message-Id: <20180424004116.28151-3-subhra.mazumdar@oracle.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20180424004116.28151-1-subhra.mazumdar@oracle.com> References: <20180424004116.28151-1-subhra.mazumdar@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8872 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=981 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804240003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a per-cpu variable to track the limit upto which idle cpu search was done in select_idle_cpu(). This will help to start the search next time from there. This is necessary for rotating the search window over entire LLC domain. Signed-off-by: subhra mazumdar --- kernel/sched/core.c | 2 ++ kernel/sched/sched.h | 1 + 2 files changed, 3 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5e10aae..cd5c08d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -17,6 +17,7 @@ #include DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); +DEFINE_PER_CPU_SHARED_ALIGNED(int, next_cpu); #if defined(CONFIG_SCHED_DEBUG) && defined(HAVE_JUMP_LABEL) /* @@ -6018,6 +6019,7 @@ void __init sched_init(void) struct rq *rq; rq = cpu_rq(i); + per_cpu(next_cpu, i) = -1; raw_spin_lock_init(&rq->lock); rq->nr_running = 0; rq->calc_load_active = 0; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 3f1874c..a2db041 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -902,6 +902,7 @@ extern struct static_key_false sched_smt_present; #endif DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); +DECLARE_PER_CPU_SHARED_ALIGNED(int, next_cpu); #define cpu_rq(cpu) (&per_cpu(runqueues, (cpu))) #define this_rq() this_cpu_ptr(&runqueues) -- 2.9.3