Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1467989ybd; Wed, 26 Jun 2019 18:35:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbEP0/SQsy9zqmEwmqENgSSozrEmFIBxC8Pbu14byv7/YgBAOEfoytv6jUyME8XvqYFVZd X-Received: by 2002:a63:a1f:: with SMTP id 31mr1044694pgk.66.1561599342613; Wed, 26 Jun 2019 18:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561599342; cv=none; d=google.com; s=arc-20160816; b=0O1ouGzXE4xwcvCVCj1MqJuUoKpKZ3WhKvP++NMa7Haa+CF3Dp7HrrdDchFJq2jGoB WeDzKVKBYgBmHmT9CF/ObvPIAyiRwygVMmPBEkOwBNibWYmoyMERe9m4dhgc3u1iw3Ge mlAeoAs5GyIgEqPBZZryVDH2htm6RtZ7fHfrfOzt99Yn21BjrZUoZ4zBT7YUxsLI/gVz iK/28ssGF6dfJR1sLGAqo4s4XHzIJDYhIzjU3/hknEkwGR3b6FzRrR2IDRaPAMWtmsaN 5t81qJ1q3BavBI+oSfxLSnVvW6GONLkSmJ0J8A3R4tLgWRRqbldTcWPDIMsNRXUwkx/L W6iA== 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=kBin+FNZ/REqKH+KorOLNtdqT/GK3cxZQostjMK1c5dwo9QqVQOjxv6UWr2oLmQ6a8 mkWsQpU8RuCYGE7ECp0Ns99GzYBzGHZ13y+DMCdrnW23Bni/QZJOSOjE9IbDf75kJ8Pu T1Y55qjUIMszSqS265ZoBKZdNqZZD/QwvXZf92c4Lt6sGqUAQqOPRJP3yV6SMS8ojJgZ rG26KaS5Dvt7sFUBOpIfvs8Tu22+ytqbNbo1z7v0XR/H6fJpYJDr+cFOwAjY/fFLOXbE 96gV3lDsEjo/C47SgvoaFjPPj60VKibMUabSj5f07Ark79gdPAuK2dqTnSNfcdHgglKf MdGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=r5eThZKJ; 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 e10si881578pfi.187.2019.06.26.18.35.26; Wed, 26 Jun 2019 18:35:42 -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=r5eThZKJ; 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 S1727022AbfF0BfQ (ORCPT + 99 others); Wed, 26 Jun 2019 21:35:16 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:56444 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbfF0BfQ (ORCPT ); Wed, 26 Jun 2019 21:35:16 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5R1Y7f9126686; Thu, 27 Jun 2019 01:34:31 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=r5eThZKJiCb2FqA1NijJ4sdwbkeLoMrSLtV/3ZYr+7junX54Jf75FdKxfkWZdEbXQud9 B/yzr7OZ/zkiydLAJ+NNFUXog6nMmi7VyC+FuzYb+8ETuLnumqzBHCGE/fqRiwFz+rHt XecyNtmPlSzRmNMpgxATTvKuedxEo07UVbuy3Wd0DVuuV8S/ci0g9WUzPZQ3Va6WyoAF DvvagwUOBwgkg+xZt9q1SCXVArbGwQYzF/ZMH7a7Wa6xjQ6V6cdgAs3MK7mBW4bWYK/r BMjdxHYckLAeA/zqUF0p3AIFtfE99iA7OX39+ImNuHu+Dwtx7ha/KgLPwdH7K0Qz2Shh qA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2t9c9pwdky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2019 01:34:30 +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 x5R1Xuru160444; Thu, 27 Jun 2019 01:34:30 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 2t99f4rpma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2019 01:34:30 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5R1YR5r005643; Thu, 27 Jun 2019 01:34:27 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:27 -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 2/7] sched: introduce per-cpu var next_cpu to track search limit Date: Wed, 26 Jun 2019 18:29:14 -0700 Message-Id: <20190627012919.4341-3-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=999 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=999 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 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