Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933211AbcDESA5 (ORCPT ); Tue, 5 Apr 2016 14:00:57 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:49479 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752071AbcDESA4 (ORCPT ); Tue, 5 Apr 2016 14:00:56 -0400 Date: Tue, 5 Apr 2016 20:00:50 +0200 From: Peter Zijlstra To: luca abeni Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli Subject: Re: [RFC v2 3/7] Improve the tracking of active utilisation Message-ID: <20160405180050.GO3408@twins.programming.kicks-ass.net> References: <1459523553-29089-1-git-send-email-luca.abeni@unitn.it> <1459523553-29089-4-git-send-email-luca.abeni@unitn.it> <20160405150036.GA3430@twins.programming.kicks-ass.net> <20160405195657.586e8c97@utopia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160405195657.586e8c97@utopia> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 844 Lines: 26 On Tue, Apr 05, 2016 at 07:56:57PM +0200, luca abeni wrote: > > > + if (rq != cpu_rq(cpu)) { > > > > I don't think this is right, you want: > > > > if (task_cpu(p) != cpu) { > > > > because @cpu does not need to be task_cpu(). > Uhm... I must have misunderstood something in the code, then :( > What I want to do here is to check if select_task_rq_dl() selected > a new CPU for this task... Since at the beginning of the function > rq is set as > rq = cpu_rq(cpu); > I was thinkint about checking if this is still true (if not, it > means that the value of "cpu" changed). > > I'll look at it again. Basically because: ac66f5477239 ("sched/numa: Introduce migrate_swap()") we cannot (in general) assume .cpu == task_cpu(p). Now it might still be true for deadline tasks, but I find it easier to simply not rely on such assumptions.