From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C80E1C433E6 for ; Tue, 16 Mar 2021 13:16:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9845565037 for ; Tue, 16 Mar 2021 13:16:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232132AbhCPNPr (ORCPT ); Tue, 16 Mar 2021 09:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231806AbhCPNPT (ORCPT ); Tue, 16 Mar 2021 09:15:19 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59B4DC061756 for ; Tue, 16 Mar 2021 06:15:18 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id l12so10441013wry.2 for ; Tue, 16 Mar 2021 06:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qTk5N1IpkxIibwyn9bbhUralfnLiAzs7yG7ASyyW9kw=; b=qtreXu9j7BKmXxpIigSADC5KNdGIlXWAKszx/c0u4zPrR9zyY9zOGtI+Y5bXQMGRBP cBi0R3nLKr5TfYoE1mUtRCPd2096OqUq5XCJGSJx/jB1E3gk0eHA/AMbmPzuSMUdyKeR G4g+0uHqQVw8rIiJBpypv7hV2Vhmg6go60jfSLZrqXrk3Fn63K4TxiOSIewak0PuqTOB ZOwdCVyMMnEg43K0vUqUsh15YQxaGr27ivuaEO++SQN4Igv1dTUVgdaqSqVGWKw7Hex2 pqCern2i6er1fqkMoY1y+bRziHDG0KTvyhBhjFuSPEniJyVRBwOIJ/mIhKpxCR+1WeRn adyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qTk5N1IpkxIibwyn9bbhUralfnLiAzs7yG7ASyyW9kw=; b=R6kg5VhB4Ek4/S4MJOvY9fVSMREt/e94trGoprHIAiQwYS8sQBRPQugmtfI0SyUGid Xej8xLw0ZMWUAJESoBsPLY6NKpZSuw+EfnwAYGlxOijQ4+v6YHJz5buFY0mRp/35dz0g H5MpcwhZyB/yKL40TJeHVZvMCtTRE0MICdLYF99aUyTeC5S+g1Un4zJq8xrmLJR3IyaS 2591BgwiWff8uHHpQxjQV5D5rBnDlMIcSe01uLkaaVtwEpGnBv7S05A0GL/eMQ86c2eL A0WVg2vyFmT+cCft1AqAzfZXwOCy59I65mR4gsfk+t8153t0FctWujSJwsLwYZyxjIti YSZQ== X-Gm-Message-State: AOAM532Ue8Limb7ZLOVvanNrm9GEL4mfmm36vvdWoqLpaD+vrvVkQAXX swR+a/6zyUB2nITVt2EOafnHeg== X-Google-Smtp-Source: ABdhPJyFQrQrzmwwosnMOODesI33pDMMRoLEdk6wRm8zQLVhwcWbbIhZCHARhvxNy6Om9VPt1Bud0g== X-Received: by 2002:adf:e94a:: with SMTP id m10mr4847478wrn.55.1615900516782; Tue, 16 Mar 2021 06:15:16 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:fcf7:1d46:a8c5:fa1b? ([2a01:e34:ed2f:f020:fcf7:1d46:a8c5:fa1b]) by smtp.googlemail.com with ESMTPSA id m17sm22591275wrx.92.2021.03.16.06.15.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Mar 2021 06:15:16 -0700 (PDT) Subject: Re: [PATCH] thermal: power_allocator: using round the division when re-divvying up power To: Lukasz Luba , gao.yunxiao6@gmail.com Cc: rui.zhang@intel.com, amitk@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, orsonzhai@gmail.com, zhang.lyra@gmail.com, "jeson.gao" References: <1615796737-4688-1-git-send-email-gao.yunxiao6@gmail.com> <9c14451e-be6f-0713-4c26-8b67e1fa51a5@arm.com> From: Daniel Lezcano Message-ID: <381a12bf-c917-c2c4-1915-f129221d6475@linaro.org> Date: Tue, 16 Mar 2021 14:15:15 +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: <9c14451e-be6f-0713-4c26-8b67e1fa51a5@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/03/2021 10:51, Lukasz Luba wrote: > > > On 3/15/21 8:25 AM, gao.yunxiao6@gmail.com wrote: >> From: "jeson.gao" >> >> The division is used directly in re-divvying up power, the decimal >> part will >> be discarded, devices will get less than the extra_actor_power - 1. >> if using round the division to make the calculation more accurate. >> >> For example: >> actor0 received more than it's max_power, it has the extra_power 759 >> actor1 received less than it's max_power, it require extra_actor_power >> 395 >> actor2 received less than it's max_power, it require extra_actor_power >> 365 >> actor1 and actor2 require the total capped_extra_power 760 >> >> using division in re-divvying up power >> actor1 would actually get the extra_actor_power 394 >> actor2 would actually get the extra_actor_power 364 >> >> if using round the division in re-divvying up power >> actor1 would actually get the extra_actor_power 394 >> actor2 would actually get the extra_actor_power 365 >> >> Signed-off-by: Jeson Gao >> --- Applied, thanks -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog