If we enable CONFIG_SCHED_TUNE without CONFIG_CGROUPS we get the following
errors:
kernel/sched/fair.c: In function 'energy_diff_evaluate':
kernel/sched/fair.c:4795:2: error: implicit declaration of function 'schedtune_normalize_energy' [-Werror=implicit-function-declaration]
nrg_delta = schedtune_normalize_energy(eenv->nrg.diff);
^
kernel/sched/fair.c:4798:2: error: implicit declaration of function 'schedtune_accept_deltas' [-Werror=implicit-function-declaration]
eenv->payoff = schedtune_accept_deltas(
^
Fix this by making sure the dummy version of these functions are
defined if the real ones aren't.
Signed-off-by: Jon Medhurst <tixy(a)linaro.org>
---
This is another build fix for the 3.18 backport of EAS [1] but I'm not
sure if the missing functions are actually meant to do something in the
case when we have SCHED_TUNE without CGROUPS?
[1] http://git.linaro.org/arm/eas/kernel.git/shortlog/refs/heads/linux-3.18-eas…
kernel/sched/tune.h | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/kernel/sched/tune.h b/kernel/sched/tune.h
index da1f7b2..3410a1d 100644
--- a/kernel/sched/tune.h
+++ b/kernel/sched/tune.h
@@ -1,6 +1,3 @@
-
-#ifdef CONFIG_SCHED_TUNE
-
#ifdef CONFIG_CGROUP_SCHEDTUNE
int schedtune_cpu_boost(int cpu);
@@ -13,14 +10,7 @@ int schedtune_normalize_energy(int energy);
int schedtune_accept_deltas(int nrg_delta, int cap_delta,
struct task_struct *task);
-#else /* CONFIG_CGROUP_SCHEDTUNE */
-
-#define schedtune_enqueue_task(task, cpu) do { } while (0)
-#define schedtune_dequeue_task(task, cpu) do { } while (0)
-
-#endif /* CONFIG_CGROUP_SCHEDTUNE */
-
-#else /* CONFIG_SCHED_TUNE */
+#else
#define schedtune_enqueue_task(task, cpu) do { } while (0)
#define schedtune_dequeue_task(task, cpu) do { } while (0)
@@ -28,4 +18,4 @@ int schedtune_accept_deltas(int nrg_delta, int cap_delta,
#define schedtune_normalize_energy(energy) energy
#define schedtune_accept_deltas(nrg_delta, cap_delta, task) nrg_delta
-#endif /* CONFIG_SCHED_TUNE */
+#endif
--
2.1.4
Dear Dev,
This is to confirm that one or more of your parcels has been shipped.
You can review complete details of your order in the find attached.
Regards,
Francis Alexander,
FedEx Station Agent.
Hi
I found some bugs when integrating the 3.18 EAS backport [1] into
the LSK 3.18 based kernel I look after for ARM's Juno and Versatile
Express boards. These patches are my fixes for those bugs, I don't know
whether they are useful or relevent to other versions of EAS. If they
are OK, I guess I should at least add them to [1] ?
----------------------------------------------------------------
Jon Medhurst (3):
arm: Fix build error "conflicting types for 'scale_cpu_capacity'"
arm: Fix #if/#ifdef mixup in topology.c
sched/tune: Avoid null pointer dereference in schedtune_add_cluster_nrg
arch/arm/include/asm/topology.h | 1 +
arch/arm/kernel/topology.c | 2 +-
kernel/sched/tune.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
[1] http://git.linaro.org/arm/eas/kernel.git/shortlog/refs/heads/linux-3.18-eas…
On 2016年05月26日 17:44, eas-dev-request(a)lists.linaro.org wrote:
> Send eas-dev mailing list submissions to
> eas-dev(a)lists.linaro.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.linaro.org/mailman/listinfo/eas-dev
> or, via email, send a message with subject or body 'help' to
> eas-dev-request(a)lists.linaro.org
>
> You can reach the person managing the list at
> eas-dev-owner(a)lists.linaro.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of eas-dev digest..."
>
>
> Today's Topics:
>
> 1. Re: [PATCH] sched/tune: fix payoff calculation for
> performance constraint region (Patrick Bellasi)
> 2. Re: [PATCH] sched/tune: fix payoff calculation for
> performance constraint region (Leo Yan)
> 3. Re: [PATCH] sched/tune: fix payoff calculation for
> performance constraint region (Patrick Bellasi)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 25 May 2016 18:53:28 +0100
> From: Patrick Bellasi <patrick.bellasi(a)arm.com>
> To: Leo Yan <leo.yan(a)linaro.org>
> Cc: eas-dev(a)lists.linaro.org
> Subject: Re: [Eas-dev] [PATCH] sched/tune: fix payoff calculation for
> performance constraint region
> Message-ID: <20160525175328.GA15730@e105326-lin>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Leo,
> thanks a lot for reviewing SchedTune and pointing out this issue.
>
> Actually going through the code I've noticed another big issue
> related to the definition of the acceptable regions, following
> commented inline. Basically, with the current implementation
> we was getting a correct "by chance" C region, while the acceptance
> for the B region was completely wrong.
>
> In attachment a new version of the patch, please have a look and let
> me know if you have any doubt and/or suggestions.
> If the patch is ok for you, lemme also know if it's ok for you to add
> your sign-off.
>
> Cheers Patrick
>
> On 23-May 21:47, Leo Yan wrote:
>> On Fri, May 20, 2016 at 12:24:49AM +0800, Leo Yan wrote:
>>> When calculate payoff criteria for performance constraint region,
>>> the inequality formula is wrong:
>>>
>>> cap_delta / nrg_delta > cap_gain / nrg_gain
>>>
>>> Here nrg_delta < 0, so when multiply it both side then should then
>>> multiplying nrg_delta inverts the inequality:
>>>
>>> nrg_delta * cap_gain > cap_delta * nrg_gain
>>>
>>> So finally we can get unified formula for both performance constraint
>>> region and performance boost region. So this patch unified these the
>>> calculation after fixed inequality formula.
>>>
>>> Signed-off-by: Leo Yan <leo.yan(a)linaro.org>
>>> ---
>>> kernel/sched/tune.c | 54 ++++++++++++++++++++++++++++-------------------------
>>> 1 file changed, 29 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/kernel/sched/tune.c b/kernel/sched/tune.c
>>> index 9d8eeb4..1da85a8 100644
>>> --- a/kernel/sched/tune.c
>>> +++ b/kernel/sched/tune.c
>>> @@ -58,36 +58,40 @@ __schedtune_accept_deltas(int nrg_delta, int cap_delta,
>>> int perf_boost_idx, int perf_constrain_idx)
>>> {
>>> int payoff = -INT_MAX;
>>> + int idx = -1;
>>>
>>> /* Performance Boost (B) region */
>>> - if (nrg_delta > 0 && cap_delta > 0) {
>>> - /*
>>> - * Evaluate "Performance Boost" vs "Energy Increase"
>>> - * payoff criteria:
>>> - * cap_delta / nrg_delta < cap_gain / nrg_gain
>>> - * which is:
>>> - * nrg_delta * cap_gain > cap_delta * nrg_gain
>>> - */
>>> - payoff = nrg_delta * threshold_gains[perf_boost_idx].cap_gain;
>>> - payoff -= cap_delta * threshold_gains[perf_boost_idx].nrg_gain;
>>> - return payoff;
>>> - }
>>> -
>>> + if (nrg_delta > 0 && cap_delta > 0)
>
> Looking better at the called, I think it's worth con accept also
> points in the P axis, thus:
>
> if (nrg_delta >= 0 && cap_delta > 0)
>
>
>>> + idx = perf_boost_idx;
>>> /* Performance Constraint (C) region */
>>> - if (nrg_delta < 0 && cap_delta < 0) {
>>> - /*
>>> - * Evaluate "Performance Boost" vs "Energy Increase"
>>> - * payoff criteria:
>>> - * cap_delta / nrg_delta > cap_gain / nrg_gain
>>> - * which is:
>>> - * cap_delta * nrg_gain > nrg_delta * cap_gain
>>> - */
>>> - payoff = cap_delta * threshold_gains[perf_constrain_idx].nrg_gain;
>>> - payoff -= nrg_delta * threshold_gains[perf_constrain_idx].cap_gain;
>>> - return payoff;
>>> - }
>>> + else if (nrg_delta < 0 && cap_delta < 0)
>
> For the same considerations we should better accept points in the E
> axis, thus:
>
> else if (nrg_delta < 0 && cap_delta <= 0)
>
>>> + idx = perf_constrain_idx;
>>>
>>> /* Default: reject schedule candidate */
>>> + if (idx == -1)
>>> + return payoff;
>>> +
>>> + /*
>>> + * Evaluate "Performance Boost" vs "Energy Increase"
>>> + *
>>> + * - Performance Boost (B) region
>>> + *
>>> + * Condition: nrg_delta > 0 && cap_delta > 0
>>> + * Payoff criteria:
>>> + * cap_delta / nrg_delta < cap_gain / nrg_gain =
>
Looking better to put the condition "nrg_delta == 0" or "cap_delta == 0"
in function "accept_deltas", to avoid fetch rcu lock and more functions
called, thus:
/* Optimal (O) region */
if ((nrg_delta < 0 && cap_delta >= 0) || (nrg_delta <=0 && cap_delta >
0)) {
trace_sched_tune_filter(nrg_delta, cap_delta, 0, 0, 1, 0);
return INT_MAX;
}
> Here the inequality has a wrong direction.
> The schedule candidate acceptable in the B region are those for which:
>
> cap_gain / nrg_gain < cap_delta / nrg_delta
>
> which represents points in the "upper cut".
>
> Thus:
>>> + * nrg_delta * cap_gain > cap_delta * nrg_gain
>
> has to be:
> cap_gain * nrg_delta < cap_delta * nrg_gain
>
> Which results into a "positive accept" payoff defined as:
>
> payoff = (cap_delta * nrg_gain) - (cap_gain * nrg_delta)
>
>>> + * (note: nrg_delta > 0, nrg_gain > 0)
>>> + *
>>> + * - Performance Constraint (C) region
>>> + *
>>> + * Condition: nrg_delta < 0 && cap_delta < 0
>>> + * payoff criteria:
>>> + * cap_delta / nrg_delta > cap_gain / nrg_gain =
>>> + * nrg_delta * cap_gain > cap_delta * nrg_gain
>
>
> In the C region we have both a wrong definition and the sign error you
> reported, which turned out to provide a "by change" correct
> implementation, which is:
>
> cap_gain / nrg_gain > cap_delta / nrg_delta =
> cap_gain * nrg_delta < cap_delta * nrg_gain
>
> Which results into a "positive accept" payoff defined as:
>
> payoff = (cap_delta * nrg_gain) - (cap_gain * nrg_delta)
>
> The same as for the B region...
>
>>> + * (note: nrg_delta < 0, nrg_gain > 0)
>>> + */
>>> + payoff = nrg_delta * threshold_gains[perf_boost_idx].cap_gain;
>>> + payoff -= cap_delta * threshold_gains[perf_boost_idx].nrg_gain;
>>
>> Sorry, here should be:
>> + payoff = nrg_delta * threshold_gains[idx].cap_gain;
>> + payoff -= cap_delta * threshold_gains[idx].nrg_gain;
>
> ... which means that this two operations have to be inverted:
>
> payoff = cap_delta * threshold_gains[gain_idx].nrg_gain;
> payoff -= nrg_delta * threshold_gains[gain_idx].cap_gain;
>
>>
>>> return payoff;
>>> }
>>>
>>> --
>>> 1.9.1
>>>
>>
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Dear Dev,
Your parcel has arrived at May 28. Courier was unable to deliver the parcel to you.
Shipment Label is attached to email.
Yours trully,
Warren Carney,
Sr. Support Manager.
Dear Dev,
We could not deliver your item.
You can review complete details of your order in the find attached.
Yours faithfully,
Dwight Mccall,
Sr. Delivery Manager.