Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2652709imm; Fri, 24 Aug 2018 03:02:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbRg0ovC0NjINxS1J91Vw8fUX8UmlNxWnVd1Nrrd8HqI5nMhGMxBZGONhzouaLeZ5LxylqR X-Received: by 2002:a63:170e:: with SMTP id x14-v6mr991045pgl.364.1535104955428; Fri, 24 Aug 2018 03:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535104955; cv=none; d=google.com; s=arc-20160816; b=PhuWMC6wlF54FYaYKjooo0rHBUjX+ChMRb0c6zgqoyo8XFM0/83aTSKqWb+VZ9XgTD zUUO1pm3A0bhpSn7V2NckVLS2u3vjzQrx/gWF6+sE9YUqUcBJ94v3f1oZ77WyfoLFd4x 1WoR1o6ST9QZNS2uAqLg5scbPY80HKfXYLXaZTdOee5dsMHy2d56IH0GGVLr8yFARKjC vYoCEquTzFHeXUl4m0K5PfbJhqS24m32Oh+XrxeL5Wh11dD93jhmYXvG/MnwT1DQFJ81 koUHNnQWyR0hMXyIgO1wCchZcoc5HVE0sr4SfdNOJNHc+9/xVPneAThHq6Dz0H+vXz57 PgmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=3TnbEPHwO774Tc5/VhRj0iPFtlsqtIQ+PbmWzcc4MSg=; b=brkmANaVWlUsN2BNaP6ZSn5jMNPX40/vDHdxQWV8yCzPwqc19tA0fBZbjpwVmPlAM/ fuRgV7xuyrdvtOjUjmudC1DoykVa1sINnEdnt6cQBpDyT0Ht3en65i3FlAcpjdvnyH9q A1+lsr4XdRXWjNzJpt6EntNAUxkTtAVH2IfUVTBmowufe83MO6loEftja5c+CGHMtgI0 rpHqvp8gnLrkvm9w3X6Vi1NDsIdcbjKOr8KCO0hEJVaD8MQGima/UNh9TYm/N+cOo8DX Uji1HzFuW7TE1J1YsAkSoJQzqe0V5iOaSV5MYIEFuMvnCWu6BjtevzTtXyMLFZEMlLXp llBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=zc5WdXGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f34-v6si5304464pgf.488.2018.08.24.03.02.18; Fri, 24 Aug 2018 03:02:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=zc5WdXGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727043AbeHXNfH (ORCPT + 99 others); Fri, 24 Aug 2018 09:35:07 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38602 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbeHXNfH (ORCPT ); Fri, 24 Aug 2018 09:35:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3TnbEPHwO774Tc5/VhRj0iPFtlsqtIQ+PbmWzcc4MSg=; b=zc5WdXGHPeGibgebIQMRipGEf S+VCAUfXOHNK85U1Snd0ruc4hjQBJ7s+M5yeKiFkoDvC5P7onVCGLOx44bcBM7+hy23R14Yoki1FJ xCJPMJJwlGbvqvGGS4/0DatO1Z6tYcM3ZHkWkN86i1nWRs4vnQfaVm9ZNrlmmtTE1DtX0kX6asank aY38lunnu3EUy292/PdqBhU+DXMXXyaVV0v5obySqQdo+RgZChFGlYB29pxABshsV+JR8ACK5pBuN tIn3ijceAFklarNC2/BHl1NtEcULiTYBsP7eDjhP/doaGK8Yht1RV6Ktyz+EZ4wu+OqrG0bpaJ65Y VlOw0KDJg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ft8tt-0008FF-Qx; Fri, 24 Aug 2018 10:01:06 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 366872024D70A; Fri, 24 Aug 2018 11:47:42 +0200 (CEST) Date: Fri, 24 Aug 2018 11:47:42 +0200 From: Peter Zijlstra To: Miguel de Dios Cc: Steve Muckle , Ingo Molnar , linux-kernel@vger.kernel.org, kernel-team@android.com, Todd Kjos , Paul Turner , Quentin Perret , Patrick Bellasi , Chris Redpath , Morten Rasmussen , John Dias Subject: Re: [PATCH] sched/fair: vruntime should normalize when switching from fair Message-ID: <20180824094742.GJ24142@hirez.programming.kicks-ass.net> References: <20180817182728.76129-1-smuckle@google.com> <20180824093227.GN24124@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180824093227.GN24124@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > On 08/17/2018 11:27 AM, Steve Muckle wrote: > > > When rt_mutex_setprio changes a task's scheduling class to RT, > > > we're seeing cases where the task's vruntime is not updated > > > correctly upon return to the fair class. > > > Specifically, the following is being observed: > > > - task is deactivated while still in the fair class > > > - task is boosted to RT via rt_mutex_setprio, which changes > > > the task to RT and calls check_class_changed. > > > - check_class_changed leads to detach_task_cfs_rq, at which point > > > the vruntime_normalized check sees that the task's state is TASK_WAKING, > > > which results in skipping the subtraction of the rq's min_vruntime > > > from the task's vruntime > > > - later, when the prio is deboosted and the task is moved back > > > to the fair class, the fair rq's min_vruntime is added to > > > the task's vruntime, even though it wasn't subtracted earlier. I'm thinking that is an incomplete scenario; where do we get to TASK_WAKING.