Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751729AbcJ1IDw (ORCPT ); Fri, 28 Oct 2016 04:03:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44956 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754368AbcJ1IDK (ORCPT ); Fri, 28 Oct 2016 04:03:10 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 28 Oct 2016 01:03:09 -0700 From: Vikram Mulukutla To: Peter Zijlstra 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 In-Reply-To: <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> <20161028074616.GT3102@twins.programming.kicks-ass.net> Message-ID: <1841a9f1d3f56c38a71812b4a7b4e43e@codeaurora.org> User-Agent: Roundcube Webmail/1.2.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 45 On 2016-10-28 00:46, Peter Zijlstra wrote: > 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. This was my bad personal attempt at eliminating double-locking from the original code. This was pointed out earlier and shall go away once I can come up with a way to merge this into enqeue/dequeue sans bonghits :-)