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: <20190823181347.GD18880@lenoir>
Date:   Fri, 23 Aug 2019 20:13:48 +0200
From:   Frederic Weisbecker <frederic@...nel.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Oleg Nesterov <oleg@...hat.com>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        John Stultz <john.stultz@...aro.org>,
        Anna-Maria Behnsen <anna-maria@...utronix.de>,
        Christoph Hellwig <hch@....de>
Subject: Re: [patch V2 23/38] posix-cpu-timers: Switch check_*_timers() to
 array cache

On Wed, Aug 21, 2019 at 09:09:10PM +0200, Thomas Gleixner wrote:
> Use the array based expiry cache in check_thread_timers() and convert the
> store in check_process_timers() for consistency.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>  kernel/time/posix-cpu-timers.c |   26 +++++++++++---------------
>  1 file changed, 11 insertions(+), 15 deletions(-)
> 
> --- a/kernel/time/posix-cpu-timers.c
> +++ b/kernel/time/posix-cpu-timers.c
> @@ -778,8 +778,7 @@ static void check_thread_timers(struct t
>  				struct list_head *firing)
>  {
>  	struct list_head *timers = tsk->posix_cputimers.cpu_timers;
> -	struct task_cputime *tsk_expires = &tsk->posix_cputimers.cputime_expires;
> -	u64 expires, stime, utime;
> +	u64 stime, utime, *expires = tsk->posix_cputimers.expiries;
>  	unsigned long soft;
>  
>  	if (dl_task(tsk))
> @@ -789,19 +788,14 @@ static void check_thread_timers(struct t
>  	 * If cputime_expires is zero, then there are no active
>  	 * per thread CPU timers.
>  	 */
> -	if (task_cputime_zero(tsk_expires))
> +	if (task_cputime_zero(&tsk->posix_cputimers.cputime_expires))
>  		return;
>  
>  	task_cputime(tsk, &utime, &stime);
>  
> -	expires = check_timers_list(timers, firing, utime + stime);
> -	tsk_expires->prof_exp = expires;
> -
> -	expires = check_timers_list(++timers, firing, utime);
> -	tsk_expires->virt_exp = expires;
> -
> -	tsk_expires->sched_exp = check_timers_list(++timers, firing,
> -						   tsk->se.sum_exec_runtime);
> +	*expires++ = check_timers_list(timers, firing, utime + stime);
> +	*expires++ = check_timers_list(++timers, firing, utime);
> +	*expires = check_timers_list(++timers, firing, tsk->se.sum_exec_runtime);

What a nice reading for anyone learning the difference between pointers's
pre and post incrementation :-)

Reviewed-by: Frederic Weisbecker <frederic@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ