From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752964AbbJYK0D (ORCPT ); Sun, 25 Oct 2015 06:26:03 -0400 Received: from casper.infradead.org ([85.118.1.10]:57032 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbbJYK0B (ORCPT ); Sun, 25 Oct 2015 06:26:01 -0400 Date: Sun, 25 Oct 2015 11:26:10 +0100 From: Peter Zijlstra To: Joonwoo Park Cc: Ingo Molnar , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] sched: fix incorrect wait time and wait count statistics Message-ID: <20151025102610.GQ2508@worktop.programming.kicks-ass.net> References: <1445750594-14078-1-git-send-email-joonwoop@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445750594-14078-1-git-send-email-joonwoop@codeaurora.org> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 24, 2015 at 10:23:14PM -0700, Joonwoo Park wrote: > @@ -1069,7 +1069,7 @@ static struct rq *move_queued_task(struct rq *rq, struct task_struct *p, int new > { > lockdep_assert_held(&rq->lock); > > - dequeue_task(rq, p, 0); > + dequeue_task(rq, p, DEQUEUE_MIGRATING); > p->on_rq = TASK_ON_RQ_MIGRATING; > set_task_cpu(p, new_cpu); > raw_spin_unlock(&rq->lock); > @@ -5656,7 +5671,7 @@ static void detach_task(struct task_struct *p, struct lb_env *env) > { > lockdep_assert_held(&env->src_rq->lock); > > - deactivate_task(env->src_rq, p, 0); > + deactivate_task(env->src_rq, p, DEQUEUE_MIGRATING); > p->on_rq = TASK_ON_RQ_MIGRATING; > set_task_cpu(p, env->dst_cpu); > } Also note that on both sites we also set TASK_ON_RQ_MIGRATING -- albeit late. Can't you simply set that earlier (and back to QUEUED later) and test for task_on_rq_migrating() instead of blowing up the fastpath like you did?