Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7904424pxb; Fri, 19 Feb 2021 02:21:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbgItactrOAvLFXrcFK/s/nP52xNuHdgoO0kpeWaUkaTfHpj1hzrT2KpliY6W2uZzcmMzi X-Received: by 2002:a17:906:b214:: with SMTP id p20mr147304ejz.22.1613730066445; Fri, 19 Feb 2021 02:21:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613730066; cv=none; d=google.com; s=arc-20160816; b=EgeiFggU0Od1a0PEFRL7f1m8V9xwMqb8NPxV+PnAGtl/Es3/lWGI1cN/pg/LHUPfDF r6cwPORamD1UuXrelSGZWnBh88bw05h3t9HFVW6Jzf0/cun3WixmG5/2zJyiesfsBIqt CTRMpQtqm0VhFwPic4Nhc3b3+OiFZzlntNF5EPUbqC6DK6WqnOVKc1vYY9eryIuYQvNO r1BwbfaQquOamXIqC61R6/gefBp4z/tBJt3eHxZaP1eNVHftLJFY+5RVBsfhJKa6Jlme fDiM72O2S40phPuiTqP55IOzpcbvgIF9RrV7uq0Nv99St+7c0kvLYH8PwhCKjD4sQXju 5VNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=54EmDfFIWsX9ybfd8Rik1wSDLd8sX3nLofxAPel4QGs=; b=O6j3wIupSGq32mb+fRHEEeJ8IgLWtauW02MdU+nVRMnG2OYGH0QehZCKpmRPunwOKM mswT3hB/1G47pmz3atvJQNuchNm9xwpxME6dOFUkPRyFAL+/dUwl/XLTWwHSntH3vkIU cttMEuM0axZ21JqUb3aOeVaPcChJV1bd6bhEVZEk+xAgcuACvZZR645bgA+X1jtLfDrQ 8Y96xfi+Y0IIQy4sVYTZN+ooW10oE14gu/Wx2f8cUr/9Pj4QwQ4b0PGQlN+QAdt9JOod fo3knhsn6UWtRmRON1Q70FnD2NDkSj+qTGqUlrdBIuAzMvD4kv/dph6kV7onYRLO2Qo+ ahkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ko1si5987074ejc.48.2021.02.19.02.20.39; Fri, 19 Feb 2021 02:21:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230305AbhBSKUE (ORCPT + 99 others); Fri, 19 Feb 2021 05:20:04 -0500 Received: from foss.arm.com ([217.140.110.172]:32838 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbhBSKUC (ORCPT ); Fri, 19 Feb 2021 05:20:02 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A5F79D6E; Fri, 19 Feb 2021 02:19:16 -0800 (PST) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C73F3F694; Fri, 19 Feb 2021 02:19:15 -0800 (PST) Subject: Re: [PATCH] sched/pelt: Fix task util_est update filtering To: vincent.donnefort@arm.com, peterz@infradead.org, tglx@linutronix.de, vincent.guittot@linaro.org Cc: linux-kernel@vger.kernel.org, patrick.bellasi@matbug.net, valentin.schneider@arm.com References: <20210216163921.572228-1-vincent.donnefort@arm.com> From: Dietmar Eggemann Message-ID: <16e1de11-d221-c572-aec7-4e9a638105a9@arm.com> Date: Fri, 19 Feb 2021 11:19:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210216163921.572228-1-vincent.donnefort@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/02/2021 17:39, vincent.donnefort@arm.com wrote: > From: Vincent Donnefort > > Being called for each dequeue, util_est reduces the number of its updates > by filtering out when the EWMA signal is different from the task util_avg > by less than 1%. It is a problem for a sudden util_avg ramp-up. Due to the > decay from a previous high util_avg, EWMA might now be close enough to > the new util_avg. No update would then happen while it would leave > ue.enqueued with an out-of-date value. (1) enqueued[x-1] < ewma[x-1] (2) diff(enqueued[x], ewma[x]) < 1024/100 && enqueued[x] < ewma[x] (*) with ewma[x-1] == ewma[x] (*) enqueued[x] must still be less than ewma[x] w/ default UTIL_EST_FASTUP. Otherwise we would already 'goto done' (write the new util_est) via the previous if condition. > > Taking into consideration the two util_est members, EWMA and enqueued for > the filtering, ensures, for both, an up-to-date value. > > This is for now an issue only for the trace probe that might return the > stale value. Functional-wise, it isn't (yet) a problem, as the value is > always accessed through max(enqueued, ewma). Yeah, I remember that the ue.enqueued plots looked weird in these sections with stale ue.enqueued values. > This problem has been observed using LISA's UtilConvergence:test_means on > the sd845c board. I ran the test a couple of times on my juno board and I never hit this path (util_est_within_margin(last_ewma_diff) && !util_est_within_margin(last_enqueued_diff)) for a test task. I can't see how this issue can be board specific? Does it happen reliably on sd845c or is it just that it happens very, very occasionally? I saw it a couple of times but always with a (non-test) tasks migrating from one CPU to another. > Signed-off-by: Vincent Donnefort Reviewed-by: Dietmar Eggemann [...]