Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214068

Re: [PATCH 1/3] timer: Optimize fastpath_timer_check()

From Jason Low <jason.low2@hp.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] timer: Optimize fastpath_timer_check()
Date 2015-08-26 19:40 +0200
Message-ID <q1MQ2-46E-21@gated-at.bofh.it> (permalink)
References <q1Mdj-38r-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/3] timer: Optimize fastpath_timer_check() "George Spelvin" <linux@horizon.com> - 2015-08-26 19:00 +0200
  Re: [PATCH 1/3] timer: Optimize fastpath_timer_check() Jason Low <jason.low2@hp.com> - 2015-08-26 19:40 +0200

csiph-web