Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758386AbcJ1HqY (ORCPT ); Fri, 28 Oct 2016 03:46:24 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:57004 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbcJ1HqV (ORCPT ); Fri, 28 Oct 2016 03:46:21 -0400 Date: Fri, 28 Oct 2016 09:46:16 +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: <20161028074616.GT3102@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: 880 Lines: 36 On Fri, Oct 28, 2016 at 12:10:41AM -0700, Vikram Mulukutla wrote: > +void walt_finish_migrate(struct task_struct *p, struct rq *dest_rq, bool locked) > +{ > + u64 wallclock; > + unsigned long flags; > + > + if (!p->on_rq && p->state != TASK_WAKING) > + return; > + > + if (locked == false) > + raw_spin_lock_irqsave(&dest_rq->lock, flags); > + > + > + if (locked == false) > + raw_spin_unlock_irqrestore(&dest_rq->lock, flags); > +} > + > +void walt_prepare_migrate(struct task_struct *p, struct rq *src_rq, bool locked) > +{ > + u64 wallclock; > + unsigned long flags; > + > + if (!p->on_rq && p->state != TASK_WAKING) > + return; > + > + if (locked == false) > + raw_spin_lock_irqsave(&src_rq->lock, flags); > + > + > + if (locked == false) > + raw_spin_unlock_irqrestore(&src_rq->lock, flags); > +} Seriously bad style that. Please, less bonghits before writing code.