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] [day] [month] [year] [list]
Date:	Wed, 26 Aug 2015 10:31:01 -0700
From:	Jason Low <jason.low2@...com>
To:	George Spelvin <linux@...izon.com>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	jason.low2@...com
Subject: Re: [PATCH 1/3] timer: Optimize fastpath_timer_check()

On Wed, 2015-08-26 at 12:57 -0400, George Spelvin wrote:
> > 	if (!task_cputime_zero(&tsk->cputime_expires)) {
> >+		struct task_cputime task_sample;
> >+		cputime_t utime, stime;
> >+
> >+		task_cputime(tsk, &utime, &stime);
> >+		task_sample.utime = utime;
> >+		task_sample.stime = stime;
> >+		task_sample.sum_exec_runtime = tsk->se.sum_exec_runtime;
> 
> Er, task_sample.[us]time are already the correct types.
> Whay are the local variables necessary?  How about:
> 
>  	if (!task_cputime_zero(&tsk->cputime_expires)) {
> +		struct task_cputime task_sample;
> +
> +		task_cputime(tsk, &task_simple.utime, &task_simple.stime);
> +		task_sample.sum_exec_runtime = tsk->se.sum_exec_runtime;

Yes, good point. Now that we're moving the task_cputime() call to after
the task_sample structure is declared, the utime and stime local
variables are not required anymore.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ