Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661AbdF3QRW (ORCPT ); Fri, 30 Jun 2017 12:17:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38346 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751922AbdF3QRU (ORCPT ); Fri, 30 Jun 2017 12:17:20 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 62CD844BD5 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sgruszka@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 62CD844BD5 Date: Fri, 30 Jun 2017 18:17:17 +0200 From: Stanislaw Gruszka To: mingo@kernel.org, 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, peterz@infradead.org Cc: linux-tip-commits@vger.kernel.org Subject: Re: [tip:sched/core] sched/cputime: Refactor the cputime_adjust() code Message-ID: <20170630161716.GA16132@redhat.com> References: <20170629184128.GA5271@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 30 Jun 2017 16:17:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 989 Lines: 34 On Fri, Jun 30, 2017 at 06:10:35AM -0700, tip-bot for Gustavo A. R. Silva wrote: > diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c > index aea3135..67c70e2 100644 > --- a/kernel/sched/cputime.c > +++ b/kernel/sched/cputime.c > @@ -615,19 +615,13 @@ static void cputime_adjust(struct task_cputime *curr, > * userspace. Once a task gets some ticks, the monotonicy code at > * 'update' will ensure things converge to the observed ratio. ^^^^^^ > */ > - if (stime == 0) { > - utime = rtime; > - goto update; > + if (stime != 0) { > + if (utime == 0) > + stime = rtime; > + else > + stime = scale_stime(stime, rtime, stime + utime); > } > > - if (utime == 0) { > - stime = rtime; > - goto update; > - } > - > - stime = scale_stime(stime, rtime, stime + utime); > - > -update: Since 'update' label is removed, I think above comment should be corrected too. Eventually patch could just remove 'utime = rtime;' line to shut up coverity. Stanislaw