Received: by 10.223.185.116 with SMTP id b49csp5293748wrg; Wed, 7 Mar 2018 09:20:29 -0800 (PST) X-Google-Smtp-Source: AG47ELsih+AoS4trVVGCPakzdPdgzXLXoYV4/mgNDfn1rFo543RiCFXNF+YRV0bH3iRLrW/s4zEX X-Received: by 10.99.123.80 with SMTP id k16mr19355371pgn.134.1520443229705; Wed, 07 Mar 2018 09:20:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520443229; cv=none; d=google.com; s=arc-20160816; b=XGdHcoMdaRqgvCVtmOjJFIzBfTC+E7vmSKGZrF/YJQRnZFDReupl1Ell/wjjd7+aH5 Y3hg2NkUFB80EHtoT/jd2wtJ9znxaw9X92yaHlLnZ3Lr1Qj1AsF9/R6f4wTWp9Wq8kaK shnu3WsOr/Dz9RlIGC9lsTsKTx9DOaA0xBD1y/kZsnfzwz6+hqkWtuabNv1/TEOtLf6N jNPoV+Twf78kMlZ/hzmIiBEPLOFFzTs1IqAdg1KEOzHPZQfAoRHetHk/mxjKlNGA5Aeo dcyv+YGQGVA+teZSgC0s8msL6gZxxBGwN7v8kC625IdG2sgPMMXQJM5JlSfEK1MpF25g k8AA== 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:arc-authentication-results; bh=xJZZu+C/q82kuBaD8eXM4q+L4tQJ4f/3E8bTlB3j4xc=; b=HXn1iH/LXg35hCUndY5Eos0ri6nsIBvBBYlYor4cowjCboEuP8FG5G6TnUwvXscdUn HFZiqY3ykUovB0GjFv6iuU1veBPw7nNZv7Xj54n9sD4gDwAgkWzJvuu3S0471UTNSj93 /6oKDae/ODlK8KkyzMYIJ0lBosy5dH9xxUFDeYORWShNPnTjMOnMn3ti2ND2oL3EnSgb f0It1FAe9sE+PED16wkLjsVOIZJmNvCmj3YQJZs/CbwcaZXhj6C+Dkp6XYw9fsuDV4tl EeDDBbGVRLRpxi/t77XBmjmGnNZfvwI/UKXHPlTd+R7f9f+yRE2dfETZNox2h8RnexTz hrcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 r3-v6si13358766plb.197.2018.03.07.09.20.15; Wed, 07 Mar 2018 09:20:29 -0800 (PST) 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; 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 S933825AbeCGPZF (ORCPT + 99 others); Wed, 7 Mar 2018 10:25:05 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52780 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933335AbeCGPZD (ORCPT ); Wed, 7 Mar 2018 10:25:03 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 221D51435; Wed, 7 Mar 2018 07:25:03 -0800 (PST) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB6623F53D; Wed, 7 Mar 2018 07:25:00 -0800 (PST) Date: Wed, 7 Mar 2018 15:24:58 +0000 From: Patrick Bellasi To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle Subject: Re: [PATCH v5 1/4] sched/fair: add util_est on top of PELT Message-ID: <20180307152458.GE2211@e110439-lin> References: <20180222170153.673-1-patrick.bellasi@arm.com> <20180222170153.673-2-patrick.bellasi@arm.com> <20180306185851.GG25201@hirez.programming.kicks-ass.net> <20180307113149.GA2211@e110439-lin> <20180307122437.GM25181@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180307122437.GM25181@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07-Mar 13:24, Peter Zijlstra wrote: > On Wed, Mar 07, 2018 at 11:31:49AM +0000, Patrick Bellasi wrote: > > > It appears to me this isn't a stable situation and completely relies on > > > the !nr_running case to recalibrate. If we ensure that doesn't happen > > > for a significant while the sum can run-away, right? > > > > By away you mean go over 1024 or overflow the unsigned int storage? > > the later, I think you can make it arbitrarily large. Have a busy task > on CPU0, this ensure !nr_running never happens. > > Start a busy task on CPU1, wait for it to hit u=1, then migrate it to > CPU0, At this point util_est(CPU0) = 2048, which is: +1024 for the busy running task assuming it has been enqueued with the utilization since the beginning +1024 for the newly migrated task from CPU1 which is enqueued with the value he reached at dequeued time from CPU1 > then wait for it to hit u=.5 then kill it, ... but when we kill it, the task is dequeued, and thus we remove 1024. Maybe that's the tricky bit: we remove the value we enqueued, _not_ the current util_avg. Notice we use _task_util_est(p)... with the leading "_". > this effectively adds > .5 to the enqueued value, repeat indefinitely. Thus this should not happen. Basically, the RQ's util_est is the sum of the RUNNABLE tasks's util_est at their enqueue time... which has been update at their last dequeue time, hence the usage of name "dequeued" for both tasks and rqs. Does it make sense now? -- #include Patrick Bellasi