Received: by 10.192.165.148 with SMTP id m20csp4732907imm; Tue, 24 Apr 2018 07:35:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48TeTdgpW8iVm2CoCUqqqCXdB1n7KUZ5qt0Wmg1LPjGDL+ohgFFs+ss4/cWszWqLr58tgcu X-Received: by 2002:a17:902:380c:: with SMTP id l12-v6mr23250506plc.19.1524580505076; Tue, 24 Apr 2018 07:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524580505; cv=none; d=google.com; s=arc-20160816; b=FpYIbUDx6AGpva5GphvP9Fs9BHajwMWoby86pTw5D3V9WypKvVaw6OD9Apuyp6+z5k QmRaP2KMn8wd08LLlS+jD5/sOQSnSPKvx0lcWUPNZTR2BLVdSwtgni0KouAWh0k9vM7C 7L9CiQaAYVQ00P+8s9YrcisYlJM0Tsv+QVfdemyy32oxXAizgantnvrzGszZMYXZDuwX lzgFb8/kyB8PmTcspy20pSXsrTeJRAM8eJTgwkDSR+JoLdA7KSYyiRb+yotE2FViNaV9 hT7AYmuR8JYSzG+jLzSdWbKWT0tP04i60Vi+5wRT7LU8MmrfQ71cK/a9eZFv9dKp8ihC 0MIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=jQGK31iPRMCYlzIQ569OXReSala86fWdA/aHDZq+SUc=; b=OH7ywcvZTw3kM1PnNrSZo4rm6MZoWIWZoY9o6jOzDFbz0HjvH/ZNxPNAZ8hlbsZDJr Cx/nM4/DKY0/Hd7wGlKEAu5Y+FFMVtvCec/4ZGf4xfZfe8DIF+0/Glm1ZDTRm7Uzac1S fsfZ2iJNopvMxoCRiBkGVM3Vh+2iOs31wlncS2RU8D8LPen3yDMSX/EhYS843+TjerWd z2Fg5BSMJI88EIASx+thZIWcCO1BdABZHK3qPIMmkxH8Vo3umT/yUkyjfDGjeFreR8qp nW1DUm+yxKQqpias9Rd/zZxM9hvy6pG/MnmV9AiD5xG+flHDwbMVPCFfJXEubkaxRCaX r8ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mdm6Hq/t; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v40-v6si14197687plg.84.2018.04.24.07.34.46; Tue, 24 Apr 2018 07:35: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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mdm6Hq/t; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933171AbeDXMrW (ORCPT + 99 others); Tue, 24 Apr 2018 08:47:22 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60726 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933161AbeDXMrR (ORCPT ); Tue, 24 Apr 2018 08:47:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jQGK31iPRMCYlzIQ569OXReSala86fWdA/aHDZq+SUc=; b=mdm6Hq/t+Bg4DoS8jG26pOtEH 1o/AW26S4cf0MsDYphvv1djPx5wfvKtMgVTBIa0svfbDfLau+3XToLGHWcgGLiYyPWVycObfkdT/m 6QLN5HsNAgg6gxT3wexyW1Snq/K+Z1wO2kJ8Ki/k8IRlQQIE3UEgB4QqL8fIKsF/Rq0Et1BFAXXK+ hRHDU9kKrTtiGitvo6v49nj0o9cZFYWCzx+riaPYooJ39UdpxtM3mPFDud1N3MrJbFJOdzJz7wlr6 w3xNwVjB/N3UZXGGcBj0RmZ0akIFXqml+0vDJAlBPnhRthVxCthu90/uuDA/PAAPDlbcKf+1gWSCv NretjDDnQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAxLl-0001NT-Hp; Tue, 24 Apr 2018 12:47:13 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 163C9203BFAF3; Tue, 24 Apr 2018 14:47:12 +0200 (CEST) Date: Tue, 24 Apr 2018 14:47:12 +0200 From: Peter Zijlstra To: subhra mazumdar Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, daniel.lezcano@linaro.org, steven.sistare@oracle.com, dhaval.giani@oracle.com, rohit.k.jain@oracle.com Subject: Re: [PATCH 2/3] sched: introduce per-cpu var next_cpu to track search limit Message-ID: <20180424124712.GR4082@hirez.programming.kicks-ass.net> References: <20180424004116.28151-1-subhra.mazumdar@oracle.com> <20180424004116.28151-3-subhra.mazumdar@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180424004116.28151-3-subhra.mazumdar@oracle.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 05:41:15PM -0700, subhra mazumdar wrote: > @@ -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; If you leave it uninitialized it'll be 0, and we can avoid that extra branch in the next patch, no?