Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1174134
| From | Jason Low <jason.low2@hp.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime. |
| Date | 2015-06-30 00:20 +0200 |
| Message-ID | <pGPzb-7Xn-11@gated-at.bofh.it> (permalink) |
| References | (4 earlier) <pBEEq-7Aj-9@gated-at.bofh.it> <pGIHo-683-11@gated-at.bofh.it> <pGJaq-6Wg-23@gated-at.bofh.it> <pGMrE-34O-7@gated-at.bofh.it> <pGMBk-3vk-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 2015-06-29 at 21:08 +0200, Fredrik Markström wrote:
> I don't think that is good enough. I believe the reason the
> max()-stuff was initially put there to make sure the returned stime
> and utime components are increasing monotonically. The scaling code
> can cause either or to decrease from one call to the other even i
> rtime increases.
>
> The purpose of my patch is to also make sure that the sum of utime and
> stime is rtime.
>
> I lost the last part of the patch in my previous email:
>
>
> - cputime_advance(&prev->stime, stime);
> - cputime_advance(&prev->utime, utime);
> + if (stime < prev->stime) {
> + stime = prev->stime;
> + utime = rtime - stime;
> + } else if (utime < prev->utime) {
> + utime = prev->utime;
> + stime = rtime - utime;
> + }
> -out:
> + if (prev->stime + prev->utime < rtime) {
> + prev->stime = stime;
> + prev->utime = utime;
> + }
> *ut = prev->utime;
> *st = prev->stime;
In this case, we might want to avoid the extra stime and utime
computations if prev->stime + prev->utime >= rtime, since they wouldn't
get used.
--
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 | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime. Peter Zijlstra <peterz@infradead.org> - 2015-06-29 17:00 +0200
Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime. Fredrik Markström <fredrik.markstrom@gmail.com> - 2015-06-29 17:30 +0200
Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime. Jason Low <jason.low2@hp.com> - 2015-06-30 00:20 +0200
Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime. Peter Zijlstra <peterz@infradead.org> - 2015-06-30 11:40 +0200
Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime. Peter Zijlstra <peterz@infradead.org> - 2015-07-02 15:10 +0200
Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime. Frederic Weisbecker <fweisbec@gmail.com> - 2015-07-07 18:30 +0200
csiph-web