public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Low <jason.low2@hp.com>
To: George Spelvin <linux@horizon.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	jason.low2@hp.com
Subject: Re: [PATCH 1/3] timer: Optimize fastpath_timer_check()
Date: Wed, 26 Aug 2015 10:31:01 -0700	[thread overview]
Message-ID: <1440610261.23728.91.camel@j-VirtualBox> (raw)
In-Reply-To: <20150826165757.3001.qmail@ns.horizon.com>

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.


  reply	other threads:[~2015-08-26 17:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 16:57 [PATCH 1/3] timer: Optimize fastpath_timer_check() George Spelvin
2015-08-26 17:31 ` Jason Low [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-08-26  3:17 [PATCH 0/3] timer: Improve itimers scalability Jason Low
2015-08-26  3:17 ` [PATCH 1/3] timer: Optimize fastpath_timer_check() Jason Low
2015-08-26 21:57   ` Frederic Weisbecker
2015-08-31 15:15   ` Davidlohr Bueso
2015-08-31 19:40     ` Jason Low

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440610261.23728.91.camel@j-VirtualBox \
    --to=jason.low2@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox