Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752161AbdGDKBf (ORCPT ); Tue, 4 Jul 2017 06:01:35 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35750 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbdGDKBd (ORCPT ); Tue, 4 Jul 2017 06:01:33 -0400 Date: Tue, 4 Jul 2017 12:01:29 +0200 From: Ingo Molnar To: Peter Zijlstra Cc: fransklaver@gmail.com, hpa@zytor.com, fweisbec@gmail.com, torvalds@linux-foundation.org, riel@redhat.com, tglx@linutronix.de, wanpeng.li@hotmail.com, linux-kernel@vger.kernel.org, garsilva@embeddedor.com, sgruszka@redhat.com, linux-tip-commits@vger.kernel.org Subject: Re: [tip:sched/core] sched/cputime: Refactor the cputime_adjust() code Message-ID: <20170704100129.5kkzn24awk3uzdtk@gmail.com> References: <20170629184128.GA5271@embeddedgus> <20170704091731.oux3ejxhgspgrlqb@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170704091731.oux3ejxhgspgrlqb@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1091 Lines: 52 * Peter Zijlstra 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