lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0g=uyPA1QH-gQbTZBim7EB8Fn+8Q_7Bc+eOmPqGaDQh0A@mail.gmail.com>
Date: Wed, 23 Oct 2024 12:09:44 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: ZhengShaobo <zhengshaobo1@...omi.com>
Cc: Lukasz Luba <lukasz.luba@....com>, "Rafael J . Wysocki" <rafael@...nel.org>, 
	Daniel Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>, 
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	zhuzhangwei <chuci@...omi.com>, dingchongchong <dingchongchong@...omi.com>, 
	chendejun <chendejun@...omi.com>
Subject: Re: [PATCH] thermal: gov_power_allocator: Granted power set to max
 when nobody request power

On Mon, Oct 21, 2024 at 2:12 PM ZhengShaobo <zhengshaobo1@...omi.com> wrote:
>
> From: zhengshaobo1 <zhengshaobo1@...omi.com>
>
> When total_req_power is 0, divvy_up_power() will set granted_power to 0,
> and cdev will be limited to the lowest performance. If our polling delay
> is set to 200ms, it means that cdev cannot perform better within 200ms
> even if cdev has a sudden load. This will affect the performance of cdev
> and is not as expected.
>
> For this reason, if nobody requests power, then set the granted power to
> the max_power.
>
> Signed-off-by: zhengshaobo1 <zhengshaobo1@...omi.com>

I would have applied this, but your S-o-b above needs to be fixed.
Why don't you use your real name there?

If it can be changed to "ZhengShaobo <zhengshaobo1@...omi.com>",
please let me know, and I will fix it for you when applying the patch.

> ---
>  drivers/thermal/gov_power_allocator.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
> index 1b2345a697c5..4301516c0938 100644
> --- a/drivers/thermal/gov_power_allocator.c
> +++ b/drivers/thermal/gov_power_allocator.c
> @@ -356,11 +356,19 @@ static void divvy_up_power(struct power_actor *power, int num_actors,
>         u32 extra_power = 0;
>         int i;
>
> -       /*
> -        * Prevent division by 0 if none of the actors request power.
> -        */
> -       if (!total_req_power)
> -               total_req_power = 1;
> +       if (!total_req_power) {
> +               /*
> +                * Nobody requested anything, just give everybody
> +                * the maximum power
> +                */
> +               for (i = 0; i < num_actors; i++) {
> +                       struct power_actor *pa = &power[i];
> +
> +                       pa->granted_power = pa->max_power;
> +               }
> +
> +               return;
> +       }
>
>         for (i = 0; i < num_actors; i++) {
>                 struct power_actor *pa = &power[i];
> --
> 2.43.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ