Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp415455imm; Thu, 28 Jun 2018 23:26:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKdX7F9lgh1ziFaXb9J6UmCjTWqISBrmNXytfMzjP05VXu98UB/T15/xFqTw5i7zSfOoHc+ X-Received: by 2002:a63:9c02:: with SMTP id f2-v6mr11454019pge.16.1530253615126; Thu, 28 Jun 2018 23:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530253615; cv=none; d=google.com; s=arc-20160816; b=efVfEFkitTUAgE8SaJPrTOb3dguczjKp3JqsCDp7suRf8G2CKUVn9fmF1xo99INBuf 3tJyOaSLnG/XBZ+166lp55Aj15FOiZi81JIYV+ySspKNkq32v7cYjQFcgtur3AkpSEqP kWs002ucUM+fq/3pARizs/195rkvoy3JfQtfdW66Z/J2aPl4nsXwN4ab/xi+4P65P7pz k+wEHLoPJK9Vl6Pi5xfCZ7/d4IBTcTCMQFZ/XoukaFqLsXDPIpZmpHoDMJ0lk0khsE0D vnAMkmJwgVMGvW8A0iKtW4KUp1zsH/7K888zWM33CsNQsFmQfq1FGRKzm8U4Vj6Yu0dL Z5zQ== 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=K9ZSVOQ8SugAfSuitLQCsDiSfn6LgnA7XgIEQ83c51E=; b=Hj2V6tOhpbNX86ykA5s4STaJctqpOvAIeSfIipcAm7rePu/PdWLtis0Z2lbwR7vQaN GbtCN11HFoe5EAdsm6hvI27dkhh9+0hQltqIZFr/c+Ce/0UiqI7BEAn+2Bk+sGiKvy2V h5ZBJCpzlEwuj8OhWeHaMcG737Ht9vgzSkuip0+cyFnpKhQyAaPJAz3RUbkrjJdrf1MO Sm15FHXG4GCvG1GhctyTANbJIv/UlxdR4fFbYkjPKOTtKXg25WGBEub57A1VrJTJizXr unFCU3omzg5w3qqlB33/+mxIx4yBKDI/5xpgdzMOTVazOPW66nFWob0MYBflSmkfV4Vn yeOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=EerG797E; 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 78-v6si8900009pfb.204.2018.06.28.23.26.41; Thu, 28 Jun 2018 23:26:55 -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=EerG797E; 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 S967429AbeF1Woo (ORCPT + 99 others); Thu, 28 Jun 2018 18:44:44 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:47394 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964881AbeF1Wn5 (ORCPT ); Thu, 28 Jun 2018 18:43:57 -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 w5SMcuZH035321; Thu, 28 Jun 2018 22:43:23 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=K9ZSVOQ8SugAfSuitLQCsDiSfn6LgnA7XgIEQ83c51E=; b=EerG797Eog9Q2jUBlQBHQjtVTzn9DZF6/ZWS+0pJQsz87dNQABPj0x9UWCCMt/wOL5xP PS0iK+j+qMve+MS7A1M/GLrwS1lqLQ2GsX253Z2vI8sIi/Rj4MEx+gvtNf9vbpa/7QX8 tu7Z2PcZjZLIzi4RBVT1F8o3Teae/rKHBqs+ff49O2SKj5zdfUf7dZ7naXoVksN3WEaJ E0FLRgFW6v23ObOlt7YOV78GAx6lfs468DWeJVjB0JQvDpjodSgY73KBdrfA/qwEmdkz LVFnyS2pfU0FWnklNs5sHnF6/lK0Yk6+Pe3rHgJ/F9mhCWiWsUaqbwdDpVuATvMhjy0s ew== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2jum5844ya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Jun 2018 22:43:23 +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 w5SMhM8q018699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Jun 2018 22:43:22 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5SMhLs9001735; Thu, 28 Jun 2018 22:43:22 GMT Received: from smazumda-Precision-T1600.us.oracle.com (/10.132.91.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 28 Jun 2018 15:43:21 -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, rohit.k.jain@oracle.com, daniel.lezcano@linaro.org Subject: [PATCH 2/5] sched: introduce per-cpu var next_cpu to track search limit Date: Thu, 28 Jun 2018 15:44:53 -0700 Message-Id: <20180628224456.13548-3-subhra.mazumdar@oracle.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20180628224456.13548-1-subhra.mazumdar@oracle.com> References: <20180628224456.13548-1-subhra.mazumdar@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8938 signatures=668703 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=909 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806280249 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 8d59b25..b3e4ec1 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -20,6 +20,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) /* @@ -5996,6 +5997,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 67702b4..eb12b50 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -912,6 +912,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