Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp139415pxb; Tue, 2 Mar 2021 22:14:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyg1zUK2rXj9iYE4NfjjSG0YCm5UG6NtQQ5UASK0rtlEYtp72TL19M24g1TykLW8RSpoF+ X-Received: by 2002:a50:fc94:: with SMTP id f20mr12381886edq.370.1614752099663; Tue, 02 Mar 2021 22:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614752099; cv=none; d=google.com; s=arc-20160816; b=aua7yVKm5tTBy64rT6ppoQwoyFEItoPSjxfZg4ZXZV0Zd1d4MHOn8NxEH16zNAd9Ks NucMn8G/lmexkgf9hq52QbJqWChrkJeLBf7lT0zbLvq9v8B+U6UShOqS3aLqQ1G9/OWH 7BxKus41Ro0hwAj95muwRECnwzXsAmyONsfcM9SyaJZ0+6DYZEY0zYFResffFTd78XAT 9ko5Cj7UpCLj3/PLCVK+yA9iQSRQDn6T74fDtV0nVTAVvWTiJy8hNx8rXi0SeNkeozck ymHR7TQal4j73SY3MBuhCjE6QDO3ZigWrWfQ248lXXjIUPdG4MKFnKL9+ysl67JN8+lK IGUA== 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=xT2qPKUxc9qrmWCqgzYSCKwA7b6G94Lk7q1Hqm4dUJQ=; b=uRRF1UvDPadyt5NN7f3Dq3YilzP5qn3iaKmO9/EGM+usQZe1n2FkMayw6Vkf+kIR+B lvEsZK2lgv9yhfSmtpByayv3Ma+qTOJpkVRp5OP7ZW5g9f+7uQ8T7A23S+oELme3+Kne ocT5C3UDShzVjCD2QpqEk8qTlL/P3cmioZiPDzh0/Smz7RMEhHD6oRiP52HQdW4KYbsX yA2x9YBehCfqUwh30jrvJ7NB0DqDW0yUSe+B/8uRGrZVr5DQ+h6rubwX8y7RRvRkmZSX jLdnsUIsYt+wPL/mBr3HnjIUzEwDpXv73+RO72G6ZrUONN6z0uQrdfQ9uHAZP5Mxn3D5 sbVg== 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 l17si15344593ejx.485.2021.03.02.22.14.37; Tue, 02 Mar 2021 22:14:59 -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 S232488AbhCASLm (ORCPT + 99 others); Mon, 1 Mar 2021 13:11:42 -0500 Received: from foss.arm.com ([217.140.110.172]:33554 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234461AbhCAQfC (ORCPT ); Mon, 1 Mar 2021 11:35: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 200571063; Mon, 1 Mar 2021 08:34:13 -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 92B263F73C; Mon, 1 Mar 2021 08:34:11 -0800 (PST) Subject: Re: [PATCH v2] sched/pelt: Fix task util_est update filtering To: Peter Zijlstra , Vincent Donnefort Cc: mingo@readhat.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, patrick.bellasi@matbug.net, valentin.schneider@arm.com References: <20210225165820.1377125-1-vincent.donnefort@arm.com> From: Dietmar Eggemann Message-ID: Date: Mon, 1 Mar 2021 17:34:09 +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: 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 26/02/2021 09:41, Peter Zijlstra wrote: > On Thu, Feb 25, 2021 at 04:58:20PM +0000, Vincent Donnefort wrote: >> +#define UTIL_EST_MARGIN (SCHED_CAPACITY_SCALE / 100) >> + >> /* >> - * Check if a (signed) value is within a specified (unsigned) margin, >> + * Check if a (signed) value is within the (unsigned) util_est margin, >> * based on the observation that: >> * >> * abs(x) < y := (unsigned)(x + y - 1) < (2 * y - 1) >> * >> - * NOTE: this only works when value + maring < INT_MAX. >> + * NOTE: this only works when value + UTIL_EST_MARGIN < INT_MAX. >> */ >> -static inline bool within_margin(int value, int margin) >> +static inline bool util_est_within_margin(int value) >> { >> - return ((unsigned int)(value + margin - 1) < (2 * margin - 1)); >> + return ((unsigned int)(value + UTIL_EST_MARGIN - 1) < >> + (2 * UTIL_EST_MARGIN - 1)); >> } > >> - if (within_margin(last_ewma_diff, (SCHED_CAPACITY_SCALE / 100))) >> + if (util_est_within_margin(last_ewma_diff)) { > > What was the purpose of this change? What was a generic helper is now > super specific. I guess because it was only ever used in util_est for last_ewma_diff. It's now used for last_ewma_diff and last_enqueued_diff, still only for util_est though and both times with the same margin (SCHED_CAPACITY_SCALE / 100)). Vincent D. should be back on Wed from hols.