Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935217AbcJ1Hwb (ORCPT ); Fri, 28 Oct 2016 03:52:31 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:57445 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755187AbcJ1Hw3 (ORCPT ); Fri, 28 Oct 2016 03:52:29 -0400 Date: Fri, 28 Oct 2016 09:52:25 +0200 From: Peter Zijlstra To: Vikram Mulukutla Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Srivatsa Vaddagiri , Steve Muckle , Olav Haugan , Syed Rameez Mustafa , Joonwoo Park , Pavankumar Kondeti , Saravana Kannan , Bryan Huntsman , Juri Lelli , Morten Rasmussen , Dietmar Eggemann , Chris Redpath , Robin Randhawa , Patrick Bellasi , Todd Kjos , Srinath Sridharan , Andres Oportus , Leo Yan , Vincent Guittot , Vikram Mulukutla Subject: Re: [RFC PATCH 2/3] sched: Introduce Window-Assisted CPU utilization Tracking Message-ID: <20161028075225.GV3102@twins.programming.kicks-ass.net> References: <1477638642-17428-1-git-send-email-markivx@codeaurora.org> <1477638642-17428-3-git-send-email-markivx@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477638642-17428-3-git-send-email-markivx@codeaurora.org> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 727 Lines: 25 On Fri, Oct 28, 2016 at 12:10:41AM -0700, Vikram Mulukutla wrote: > +static int account_cpu_busy_time(struct rq *rq, struct task_struct *p, > + u64 irqtime, int event) > +{ > + if (is_idle_task(p)) { > + /* TASK_WAKE && TASK_MIGRATE is not possible on idle task! */ > + if (event == PICK_NEXT_TASK) > + return 0; > + > + /* PUT_PREV_TASK, TASK_UPDATE && IRQ_UPDATE are left */ > + return irqtime || cpu_is_waiting_on_io(rq); > + } > + > + if (event == TASK_WAKE) > + return 0; > + > + if (event == PUT_PREV_TASK || event == IRQ_UPDATE || > + event == TASK_UPDATE) > + return 1; > + > + /* Only TASK_MIGRATE && PICK_NEXT_TASK left */ > + return walt_freq_account_wait_time; > +} switch() wasn't an option?