From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbdBWJuv (ORCPT ); Thu, 23 Feb 2017 04:50:51 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:38319 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbdBWJuu (ORCPT ); Thu, 23 Feb 2017 04:50:50 -0500 Date: Thu, 23 Feb 2017 10:50:50 +0100 From: Peter Zijlstra To: Pavan Kondeti Cc: linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: min_vruntime update when a task is sleeping/migrating Message-ID: <20170223095050.GA6515@twins.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Thu, Feb 23, 2017 at 11:45:26AM +0530, Pavan Kondeti wrote: > Hi Peter, > > The comment and the code around 2nd update_min_vruntime() call in > dequeue_entity() are not matching. If I understand commit b60205c7c558 > ("sched/fair: Fix min_vruntime tracking") correctly, the check is > inverted there. We want to update min_vruntime when a task is > sleeping/migrating. is my understanding right? Hurm, yes that comment and the code are not in agreement :/ Having gone over the code again, I think the comment is right and the code is wrong, but it would be good to double check that. > static void > dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) > { > > > /* > * Now advance min_vruntime if @se was the entity holding it back, > * except when: DEQUEUE_SAVE && !DEQUEUE_MOVE, in this case we'll be > * put back on, and if we advance min_vruntime, we'll be placed back > * further than we started -- ie. we'll be penalized. > */ > if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) == DEQUEUE_SAVE) > update_min_vruntime(cfs_rq); > }