lkml.org 
[lkml]   [2022]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v3 7/7] sched/fair: Remove the energy margin in feec()
On 08/03/2022 19:19, Vincent Donnefort wrote:

[...]

> 1. The energy estimation is not a good absolute value:
>
> The function, compute_energy() used in feec() is a good estimation for

s/The function, compute_energy()/compute_energy() ... shorter

[...]

> util_avg represents integrates the near history for a CPU usage,

s/util_avg represents integrates/util_avg contains ?

[...]

> 2. The margin handicaps small tasks:
>
> On a system where the workload is composed mostly of small tasks (which is
> often the case on Android), the overall energy will be high enough to
> create a margin none of those tasks can cross. e.g. On a Pixel4, a small

s/e.g.// ?

[...]

> Without a margin, we could have feared bouncing between CPUs. But running
> LISA's eas_behaviour test coverage on three different platforms (Hikey960,
> RB-5 and DB-845) showed no issue and even fixed previously known failures.

Can you be more specific what those fixes are? I think you mention (some
of) them in the cover letter. It's just that when somebody will read
this patch, once it's in, this information is not there.

You could also add
https://developer.arm.com/tools-and-software/open-source-software/linux-kernel/energy-aware-scheduling/eas-mainline-development
to the cover letter so people can get more information about those EAS
behaviour tests.

[...]

> @@ -6736,7 +6736,6 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
> struct root_domain *rd = cpu_rq(smp_processor_id())->rd;
> int cpu, best_energy_cpu = prev_cpu, target = -1;

Nit-picking: IMHO, best_energy_cpu doesn't have to be initialized
anymore since we only use it now when `best_delta < prev_delta`,
hence best_energy_cpu has to be set at least once.

[...]

> @@ -6851,12 +6849,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
> }
> rcu_read_unlock();
>
> - /*
> - * Pick the best CPU if prev_cpu cannot be used, or if it saves at
> - * least 6% of the energy used by prev_cpu.
> - */
> - if ((prev_delta == ULONG_MAX) ||
> - (prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
> + if (best_delta < prev_delta)
> target = best_energy_cpu;
>
> return target;

Can we now move the `unlock:` before the first rcu_read_unlock()?
All error case have best_delta and prev_delta = ULONG_MAX so we return
`target = -1` or `target = prev_cpu` correctly.

@@ -6960,17 +6960,13 @@ static int find_energy_efficient_cpu(struct
task_struct *p, int prev_cpu)
}
}
}
+unlock:
rcu_read_unlock();
if (best_delta < prev_delta)
target = best_energy_cpu;
return target;
-
-unlock:
- rcu_read_unlock();
-
- return target;

\
 
 \ /
  Last update: 2022-03-22 10:38    [W:0.087 / U:5.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site