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


Groups > linux.kernel > #1680829

Re: [tip:sched/core] sched/cputime: Refactor the cputime_adjust() code

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [tip:sched/core] sched/cputime: Refactor the cputime_adjust() code
Date 2017-07-04 12:10 +0200
Message-ID <tZsWl-6Q1-1@gated-at.bofh.it> (permalink)
References <tXMFQ-2IU-13@gated-at.bofh.it> <tY402-5YH-5@gated-at.bofh.it> <tZs9Y-6kT-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Peter Zijlstra <peterz@infradead.org> wrote:

> Argh, no... That code was perfectly fine. The new code otoh is
> convoluted crap.
> 
> It had the form:
> 
> 	if (exception1)
> 	  deal with exception1
> 
> 	if (execption2)
> 	  deal with exception2
> 
> 	do normal stuff
> 
> Which is as simple and straight forward as it gets.
> 
> The new code otoh reads like:
> 
> 	if (!exception1) {
> 		if (exception2)
> 		  deal with exception 2
> 		else
> 		  do normal stuff
> 	}
> 
> which is absolute shit.
> 
> So NAK on this.

Agreed - I've queued up a revert.

Note that I fixed the old comment, which was arguably wrong:

	/*
	 * If either stime or both stime and utime are 0, assume all runtime is
	 * userspace. Once a task gets some ticks, the monotonicy code at
	 * 'update' will ensure things converge to the observed ratio.
	 */

The correct comment is something like:

	/*
	 * If either stime or utime are 0, assume all runtime is userspace.
	 * Once a task gets some ticks, the monotonicy code at 'update:'
	 * will ensure things converge to the observed ratio.
	 */

Thanks,

	Ingo

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


Thread

Re: [tip:sched/core] sched/cputime: Refactor the cputime_adjust()  code Peter Zijlstra <peterz@infradead.org> - 2017-07-04 11:20 +0200
  Re: [tip:sched/core] sched/cputime: Refactor the cputime_adjust()  code Ingo Molnar <mingo@kernel.org> - 2017-07-04 12:10 +0200

csiph-web