Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1789426ybi; Sat, 8 Jun 2019 18:57:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCrIxthoh4M1LzXIXg+9FU3FVO93uhoATSPAYQr5IE3poMEMo1rbkWw90Aqc0UTEwInQXh X-Received: by 2002:a65:5787:: with SMTP id b7mr9819806pgr.148.1560045422291; Sat, 08 Jun 2019 18:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560045422; cv=none; d=google.com; s=arc-20160816; b=d/23jEP5GQwmLizMPQb/A8qC2xTnIGaIquKMoD452CJcfRypV1S0jsLMRB6LpL90nC L5oOQY7k5LuDkcbRRkoqHqqlgGSneu4Dp5YeXl9Y3cop7PTatOLmahacrfE28N+GInPp Gmx9vJZr1xn6m59nCMhF8YaCWg3OoKoBzIHYoU/GfnVq8llAkrgRW91RJYUeGRpUyQtm ygVPZeDx8v0Gb4I17TfV3cDMl9uVNDw0oxrlQlue/NRg22HncgI6dj5OEHKD+P8I6m7H Mcf0hJnajFYKDjYfwjV4GMWDfkhVoSDVMvyCHrm4Mud4mYqvFB3FEXN9s1Y7Y9sxnT/2 023Q== 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=a9xr0ftUygGbe17n4LV66UNhDktetQVNmeRiOg3colM=; b=D1Uk3MQSb5KK99xxamK/K9hsXJ2eO3E825cA/90+8brFaK5dE2gbCknIzp6PsTeUWy icaz4XmUoiLHw2ZysqE3H09OQ4dZd1hih6zYc1eskMaKULuSJkIgCPoA6XBGnENsTV3T BcL4YQ3u260Wwt3+Z0I9TRMH54YBoJZYUtMjX1k+f55B8AjjBNldoLtxnkk6BZlDOKeX uyJevs19o3Y2bcbWupYk1pH9QmSm7+5gxQ8uTO8RBIW301WDJ01SGLS3Lau9yR4PVk4T GyJ6BqOowj0w1eSVKbrMB0OEPk/eRc6F/EwBhIBKwROaZbGMsg7ik28YH361qDd8baaV HADQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=Ah0T2vhG; 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 b38si2818547pla.137.2019.06.08.18.56.46; Sat, 08 Jun 2019 18:57: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=@oracle.com header.s=corp-2018-07-02 header.b=Ah0T2vhG; 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 S1728202AbfFIBzZ (ORCPT + 99 others); Sat, 8 Jun 2019 21:55:25 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:46522 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728088AbfFIBzW (ORCPT ); Sat, 8 Jun 2019 21:55:22 -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 x591sPBO022907; Sun, 9 Jun 2019 01:54:45 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=a9xr0ftUygGbe17n4LV66UNhDktetQVNmeRiOg3colM=; b=Ah0T2vhGXa9zgTbrmAjvdtjnBZ83Zh7/mlYE2UipD1SBZwHTBSbG5qyW5+/A40Pjsyge +IrtEVq8gFp8AsHjd6UiyUFDcJO+QyByXcv2HQDZh2Cp0z6AH+r6EQIzXI65/e0oK2ci iLu17e9RTZtr7oa28VAHTloyXVIi5XHjPixDeauI3MCafYV1XY4LxsU6SVsJfcEwkf5j jvYG7fv/5uQiAedN9MqIicNV3G5Xixh+YJbyUVGTWZJ1PF3y1jNCJ3soqptGhukknQEa qe4xrFmvEXbmVTZ1PP9AU9QEJemZrnQofJKD3xzEAxBTuEysdSE5GVl+64i3s+F9237x sg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2t04eta46u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 09 Jun 2019 01:54:45 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x591rSVS026593; Sun, 9 Jun 2019 01:54:44 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2t024tcfmn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 09 Jun 2019 01:54:44 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x591sdLl009408; Sun, 9 Jun 2019 01:54:40 GMT Received: from smazumda-Precision-T1600.us.oracle.com (/10.132.91.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 08 Jun 2019 18:54:39 -0700 From: subhra mazumdar To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, 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 2/7] sched: introduce per-cpu var next_cpu to track search limit Date: Sat, 8 Jun 2019 18:49:49 -0700 Message-Id: <20190609014954.1033-3-subhra.mazumdar@oracle.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20190609014954.1033-1-subhra.mazumdar@oracle.com> References: <20190609014954.1033-1-subhra.mazumdar@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9282 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906090012 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9282 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906090013 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 874c427..80657fc 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -24,6 +24,7 @@ #include DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); +DEFINE_PER_CPU_SHARED_ALIGNED(int, next_cpu); #if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_JUMP_LABEL) /* @@ -5966,6 +5967,7 @@ void __init sched_init(void) for_each_possible_cpu(i) { struct rq *rq; + per_cpu(next_cpu, i) = -1; rq = cpu_rq(i); raw_spin_lock_init(&rq->lock); rq->nr_running = 0; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index b52ed1a..4cecfa2 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -994,6 +994,7 @@ static inline void update_idle_core(struct rq *rq) { } #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