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]
Date:   Thu, 11 May 2017 15:01:16 +0100
From:   Juri Lelli <juri.lelli@....com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Luca Abeni <luca.abeni@...tannapisa.it>,
        Daniel Bristot de Oliveira <bristot@...hat.com>
Subject: Re: [RFC][PATCH] sched/deadline: Remove if statement before clearing
 throttle and yielded

Hi,

On 10/05/17 09:50, Steven Rostedt wrote:
> [
>   This is an RFC as I didn't run any benchmarks. It just seemed a bit 
>   weird to me that we would add such a check instead of just clearing
>   these variables out regardless.
> ]
> 
> The function replenish_dl_entity() clears dl_throttled and dl_yielded,
> but checks first if they are set before doing so. As these variables
> are in the same cache locale of other variables being modified, there's
> no advantage in checking if they are set before clearing them. But
> having the compare takes slots away from the branch prediction.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
> ---
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index a2ce590..9748d33 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -423,10 +423,8 @@ static void replenish_dl_entity(struct sched_dl_entity *dl_se,
>  		dl_se->runtime = pi_se->dl_runtime;
>  	}
>  
> -	if (dl_se->dl_yielded)
> -		dl_se->dl_yielded = 0;
> -	if (dl_se->dl_throttled)
> -		dl_se->dl_throttled = 0;
> +	dl_se->dl_yielded = 0;
> +	dl_se->dl_throttled = 0;
>  }

Looks good to me.

Peter, any particular reason why you wanted to first check the values?

Best,

- Juri

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ