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: <5549acc0-c5d6-a263-d995-edfeba467915@arm.com>
Date:   Tue, 10 Dec 2019 18:07:06 +0100
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Valentin Schneider <valentin.schneider@....com>,
        linux-kernel@...r.kernel.org
Cc:     peterz@...radead.org, mingo@...nel.org, vincent.guittot@...aro.org,
        patrick.bellasi@...bug.net, qperret@...gle.com,
        qais.yousef@....com, morten.rasmussen@....com
Subject: Re: [PATCH v2 3/4] sched/fair: Make task_fits_capacity() consider
 uclamp restrictions

On 03/12/2019 16:59, Valentin Schneider wrote:

[...]

> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 08a233e97a01..dc3e86cb2b2e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3711,6 +3711,22 @@ static inline unsigned long task_util_est(struct task_struct *p)
>  	return max(task_util(p), _task_util_est(p));
>  }
>  
> +#ifdef CONFIG_UCLAMP_TASK
> +static inline
> +unsigned long uclamp_task_util(struct task_struct *p)
> +{
> +	return clamp(task_util_est(p),
> +		     (unsigned long)uclamp_eff_value(p, UCLAMP_MIN),
> +		     (unsigned long)uclamp_eff_value(p, UCLAMP_MAX));
> +}
> +#else
> +static inline
> +unsigned long uclamp_task_util(struct task_struct *p)

[...]

Save some lines?

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index cc659a3944f1..ab921ee356a9 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3712,16 +3712,14 @@ static inline unsigned long task_util_est(struct
task_struct *p)
 }

 #ifdef CONFIG_UCLAMP_TASK
-static inline
-unsigned long uclamp_task_util(struct task_struct *p)
+static inline unsigned long uclamp_task_util(struct task_struct *p)
 {
        return clamp(task_util_est(p),
                     (unsigned long)uclamp_eff_value(p, UCLAMP_MIN),
                     (unsigned long)uclamp_eff_value(p, UCLAMP_MAX));
 }
 #else
-static inline
-unsigned long uclamp_task_util(struct task_struct *p)
+static inline unsigned long uclamp_task_util(struct task_struct *p)
 {
        return task_util_est(p);
 }

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ