From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753874AbcBALaP (ORCPT ); Mon, 1 Feb 2016 06:30:15 -0500 Received: from casper.infradead.org ([85.118.1.10]:36486 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753726AbcBALaN (ORCPT ); Mon, 1 Feb 2016 06:30:13 -0500 Date: Mon, 1 Feb 2016 12:30:10 +0100 From: Peter Zijlstra To: Rik van Riel Cc: Frederic Weisbecker , linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, luto@amacapital.net, clark@redhat.com Subject: Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from __acct_update_integrals Message-ID: <20160201113010.GR6357@twins.programming.kicks-ass.net> References: <1454124965-13974-1-git-send-email-riel@redhat.com> <1454124965-13974-2-git-send-email-riel@redhat.com> <20160130144403.GB32581@lerouge> <56ACF885.8070203@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56ACF885.8070203@redhat.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 30, 2016 at 12:53:09PM -0500, Rik van Riel wrote: > >> + delta = cputime_to_nsecs(dtime); > > > > You might want to add a comment specifying why we don't call cputime_to_usecs() > > directly (because we optimize if delta < TICK_NSEC). > > > > Although this has a good impact on nohz_full, it might have a tiny bad one on !nohz_full > > because now we first convert jiffies to nsecs (which implies a multiplication by 1000) > > that we later divide again by 1000. Now this is ok because I plan to convert tsk->utime/stime > > to nsecs and thus remove most of the cputime_t use and conversions everywhere. > > Isn't cputime_t in nanoseconds even on !nohz_full systems nowadays, > due to sched_clock? Don't think so, we still use jiffy accounting for !NOHZ_FULL. > Also, a multiplication is essentially instantaneous compared to > a division, which is why Peter suggested going this way around. Yep.