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


Groups > linux.kernel > #1322253

Re: [PATCH 1/2] sched,time: remove pointless divides from __acct_update_integrals

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Rik van Riel <riel@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] sched,time: remove pointless divides from __acct_update_integrals
Date Sat, 30 Jan 2016 04:50:01 +0100
Message-ID <qWuHT-56u-5@gated-at.bofh.it> (permalink)
References <qWq1z-1yb-3@gated-at.bofh.it> <qWq1B-1yb-39@gated-at.bofh.it> <qWquB-20H-5@gated-at.bofh.it> <qWuyd-51K-5@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Scanned-By MIMEDefang 2.68 on 10.5.11.22
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, luto@amacapital.net
X-Original-Date Fri, 29 Jan 2016 22:47:41 -0500
X-Original-Message-ID <56AC325D.7040100@redhat.com>
X-Original-References <1454106180-20918-1-git-send-email-riel@redhat.com> <1454106180-20918-2-git-send-email-riel@redhat.com> <20160129231018.GK6357@twins.programming.kicks-ass.net> <20160130033632.GA14020@lerouge>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1322253

Show key headers only | View raw


On 01/29/2016 10:36 PM, Frederic Weisbecker wrote:
> On Sat, Jan 30, 2016 at 12:10:18AM +0100, Peter Zijlstra wrote:
>> On Fri, Jan 29, 2016 at 05:22:59PM -0500, riel@redhat.com wrote:
>>> From: Rik van Riel <riel@redhat.com>
>>>
>>> When running a microbenchmark calling an invalid syscall number
>>> in a loop, on a nohz_full CPU, we spend a full 9% of our CPU
>>> time in __acct_update_integrals.
>>>
>>> This function converts cputime_t to jiffies, to a timeval, only to
>>> convert the timeval back to microseconds before discarding it.
>>>
>>> This patch leaves __acct_update_integrals functionally equivalent,
>>> but speeds things up by about 11%, with 10 million calls to an
>>> invalid syscall number dropping from 3.7 to 3.3 seconds.
>>
>> WTH is this taskstat crap anyway? Who uses it and can't we kill it?
> 
> I have no idea what it's used for, it seems to be related to taskstats
> over netlink. I'm not even sure if it's actually used. There don't seem
> to be a runtime offcase and I bet distros enable it. So that stuff does
> some work every millisecond on millions of machines while it probably
> has very few users.
> 
> SGI introduced it in 2006 and it seems that their last contribution there is
> in 2008. The rest is kernel maintainance and fixes.
> 
> If there are still users of it, then at least we should disable it on runtime by
> default.

With all the non-power-of-2 divides removed, __acct_update_integrals
disappears from the profile, even running many times per millisecond.

At that point, native_sched_clock takes over the top of the profile,
and the only way I can think of getting rid of that one is making
sure it is not called twice for every syscall, irq, and kvm guest
entry/exit.

-- 
All rights reversed

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


Thread

[PATCH 0/2] sched,time: reduce nohz_full syscall overhead 40% riel@redhat.com - 2016-01-29 23:50 +0100
  [PATCH 1/2] sched,time: remove pointless divides from __acct_update_integrals riel@redhat.com - 2016-01-29 23:50 +0100
    Re: [PATCH 1/2] sched,time: remove pointless divides from  __acct_update_integrals Peter Zijlstra <peterz@infradead.org> - 2016-01-30 00:20 +0100
      Re: [PATCH 1/2] sched,time: remove pointless divides from  __acct_update_integrals Frederic Weisbecker <fweisbec@gmail.com> - 2016-01-30 04:40 +0100
        Re: [PATCH 1/2] sched,time: remove pointless divides from  __acct_update_integrals Rik van Riel <riel@redhat.com> - 2016-01-30 04:50 +0100

csiph-web