From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753474AbdJaPBS (ORCPT ); Tue, 31 Oct 2017 11:01:18 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:45716 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751807AbdJaPBQ (ORCPT ); Tue, 31 Oct 2017 11:01:16 -0400 Date: Tue, 31 Oct 2017 16:01:08 +0100 From: Peter Zijlstra To: Vincent Guittot Cc: Ingo Molnar , linux-kernel , Tejun Heo , Josef Bacik , Linus Torvalds , Mike Galbraith , Paul Turner , Chris Mason , Dietmar Eggemann , Morten Rasmussen , Ben Segall , Yuyang Du Subject: Re: [PATCH -v2 12/18] sched/fair: Rewrite PELT migration propagation Message-ID: <20171031150108.mxihmewrugufwulq@hirez.programming.kicks-ass.net> References: <20171010072945.rjeuripvfksfpdcf@hirez.programming.kicks-ass.net> <20171013152254.GA7393@linaro.org> <20171013204111.GB6524@worktop.programming.kicks-ass.net> <20171016135501.GA11688@linaro.org> <20171019150442.GA25025@linaro.org> <20171030172035.2edzqvth7v5zki75@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 31, 2017 at 12:14:11PM +0100, Vincent Guittot wrote: > > + if (runnable_sum >= 0) { > > + /* > > + * Add runnable; clip at LOAD_AVG_MAX. Reflects that until > > + * the CPU is saturated running == runnable. > > + */ > > + runnable_sum += se->avg.load_sum; > > + runnable_sum = min(runnable_sum, (long)LOAD_AVG_MAX); > > + } else { > > + /* > > + * Estimate the departing task's runnable by assuming all tasks > > + * are equally runnable. > > + * > > + * XXX: doesn't deal with multiple departures? > > Why this would not deal with multiple departures ? > we are using gcfs_rq->avg.load_sum that reflects the new state of the > gcfs_rq to evaluate the runnable_sum Ah, I figured the load_sum thing below reflected one average task worth of runnable. > > + /* runnable_sum can't be lower than running_sum */ > > + running_sum = se->avg.util_sum >> SCHED_CAPACITY_SHIFT; /* XXX ? */ > > running_sum is scaled by cpu's capacity but not load_sum > > I have made the shortcut of using SCHED_CAPACITY_SHIFT for capacity > but we might better use arch_scale_cpu_capacity(NULL, cpu) instead Ah, right. We should improve the comments thereabouts, I got totally lost trying to track that yesterday. Also; we should look at doing that invariant patch you're still sitting on.