Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1751469yba; Thu, 9 May 2019 23:57:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzZEWWEgcV5d6jN4coxuug9JHX6E9j5n7gFjE3KwvIsDpN72Vbwe9yp3URd+roko6EPRWV X-Received: by 2002:a17:902:8b8a:: with SMTP id ay10mr2479679plb.74.1557471443996; Thu, 09 May 2019 23:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557471443; cv=none; d=google.com; s=arc-20160816; b=OdnPDjEFkxA8A2vsjg5IvzI6ssXTCAQ4gorhuy6TsGJ6zh18izcIcIrkt1dVsoRN4x QpOaMs/6OaVAuXehhjMBt7MHVwlyt+xK7xcut/mc7yP40Dz1/sEum9agbQRl4n5fsL6a Q+dP3bb5RIYgInVo4nmkMbtwP2RFf2UfGwwZuKXB6MTR0A/qUh5ocJEn+sqffxp7h0ic wAyvUXAXLoAqDJnoOMVNblYTHzuZli2D12Y6rUyQ60+9ZbMlfTxdJo7ieWaPqN6gdljk AGpoApurZmCxssm1wL2sAKLZatBsqka7JwjUzXk7Oj/EeY43UjARGS05fZ/40xMyrrku kbMA== 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; bh=nSJVr7DrkLGkqkdyFPqIgwXShT1bf00nOpHzyaCw/7U=; b=IDySsKSMQuT4zRWuXhsVIicak5o78oDjlnUe2t8zXQumLMUHuL2fwzSMtZMA13e8FI qLktuvb9z58GWq7LNHLVHynS4NXaUU0alMCVHXIR/PzgvaAtq8Vy2D90yD3KnZyMHGh8 HM5r0HZqBgcvLP3iIJEpVwjOotkYWVDfU+hspAR0RStBw2NWmdKKQYzMTW7iEH48sgaj k2uCC7efczvRYQnZhvzBj4sEM3KrDUlV/jjAKKO3oX97IL/rh7njuLNNlAVUTW9InjK3 YX0WYkFE2maLqohouHV7UUEUemijGNTtiNtFlPup4h92Bbf1PAbZXW+4ecBDXzaJ0Lk4 mOiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=SYf4bR9d; 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 a9si6172067pgw.14.2019.05.09.23.57.07; Thu, 09 May 2019 23:57:23 -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=merlin.20170209 header.b=SYf4bR9d; 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 S1727061AbfEJGzq (ORCPT + 99 others); Fri, 10 May 2019 02:55:46 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36380 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726816AbfEJGzq (ORCPT ); Fri, 10 May 2019 02:55:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=nSJVr7DrkLGkqkdyFPqIgwXShT1bf00nOpHzyaCw/7U=; b=SYf4bR9dfob6NlrLLsymleQ3f nnMQiemLD3tn4CgeWx6Tcs8cEyzkIMlj5sjW0FlS5tnamx0cDEh6GQ7eCUb1/E6XbD/2VGecWSU55 7Szp4sRjKhWJZ+Mc+D1XE50CuCOzU6pNMewQ1XLmb+m0MfmmRtUpnDpF8lzBhNZ35PbAEf72UtvZI RsxG/XU4gLscOTWQ3pUkRIHT/dYhEc8Kae9TOnmeLBWsus22ylKwHNHBRRiRnCJVGNJKzGdCQINMn LwyEh7/wyXNGt0iw5sOpj4r5RX5wd7G9Qw5VDJbb8xdYP39jMWGqchWPM7V7wqMiyOgavKW5gmkXv tcBxcb/iA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOzRO-00039O-RV; Fri, 10 May 2019 06:55:35 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 03E262023AD97; Fri, 10 May 2019 08:55:31 +0200 (CEST) Date: Fri, 10 May 2019 08:55:31 +0200 From: Peter Zijlstra To: Viresh Kumar Cc: Ingo Molnar , Vincent Guittot , tkjos@google.com, Daniel Lezcano , quentin.perret@linaro.org, chris.redpath@arm.com, Dietmar.Eggemann@arm.com, linux-kernel@vger.kernel.org Subject: Re: [RFC V2 1/2] sched: Start tracking SCHED_IDLE tasks count in cfs_rq Message-ID: <20190510065531.GF2623@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 03:07:39PM +0530, Viresh Kumar wrote: > @@ -5166,6 +5170,7 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags) > { > struct cfs_rq *cfs_rq; > struct sched_entity *se = &p->se; > + int idle_h_nr_running = unlikely(task_has_idle_policy(p)) ? 1 : 0; > > /* > * The code below (indirectly) updates schedutil which looks at > @@ -5266,6 +5273,7 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) > struct cfs_rq *cfs_rq; > struct sched_entity *se = &p->se; > int task_sleep = flags & DEQUEUE_SLEEP; > + int idle_h_nr_running = unlikely(task_has_idle_policy(p)) ? 1 : 0; > > for_each_sched_entity(se) { > cfs_rq = cfs_rq_of(se); That's a completely pointless branch there (and I suspect the compiler will see that too), just write: int idle_h_nr_running = task_has_idle_policy(p);