From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755365AbcFQQCs (ORCPT ); Fri, 17 Jun 2016 12:02:48 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:44433 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbcFQQCr (ORCPT ); Fri, 17 Jun 2016 12:02:47 -0400 Date: Fri, 17 Jun 2016 18:02:39 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Yuyang Du , Ingo Molnar , linux-kernel , Mike Galbraith , Benjamin Segall , Paul Turner , Morten Rasmussen , Dietmar Eggemann , Matt Fleming Subject: Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Message-ID: <20160617160239.GL30927@twins.programming.kicks-ass.net> References: <20160617120136.064100812@infradead.org> <20160617120454.150630859@infradead.org> <20160617142814.GT30154@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160617142814.GT30154@twins.programming.kicks-ass.net> 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 Fri, Jun 17, 2016 at 04:28:14PM +0200, Peter Zijlstra wrote: > On Fri, Jun 17, 2016 at 04:09:01PM +0200, Vincent Guittot wrote: > > > > > > Scenario 1: switch to fair class > > > > > > p->sched_class = fair_class; > > > if (queued) > > > enqueue_task(p); > > > ... > > > enqueue_entity() > > > enqueue_entity_load_avg() > > > migrated = !sa->last_update_time (true) > > > if (migrated) > > > attach_entity_load_avg() > > > check_class_changed() > > > switched_from() (!fair) > > > switched_to() (fair) > > > switched_to_fair() > > > attach_entity_load_avg() > > > > @@ -733,18 +737,21 @@ void post_init_entity_util_avg(struct sc > > > } > > > sa->util_sum = sa->util_avg * LOAD_AVG_MAX; > > > } > > > + > > > + update_cfs_rq_load_avg(cfs_rq_clock_task(cfs_rq), cfs_rq, false); > > > + attach_entity_load_avg(cfs_rq, se); > > > > A new RT task will be attached and will contribute to the load until > > it decays to 0 > > Should we detach it for non cfs task ? Right, an attach + detach, which basically ends up being: > > We just want to update > > last_update_time of RT task to something different from 0 this. That's the same as starting as fair and then doing switched_from_fair(). So yes, ho-humm, how to go about doing that bestest. Lemme have a play.