From: Rik van Riel <riel@redhat.com>
To: Frederic Weisbecker <fweisbec@gmail.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
mingo@kernel.org, luto@amacapital.net
Subject: Re: [PATCH 1/2] sched,time: remove pointless divides from __acct_update_integrals
Date: Fri, 29 Jan 2016 22:47:41 -0500 [thread overview]
Message-ID: <56AC325D.7040100@redhat.com> (raw)
In-Reply-To: <20160130033632.GA14020@lerouge>
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
next prev parent reply other threads:[~2016-01-30 3:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 22:22 [PATCH 0/2] sched,time: reduce nohz_full syscall overhead 40% riel
2016-01-29 22:22 ` [PATCH 1/2] sched,time: remove pointless divides from __acct_update_integrals riel
2016-01-29 23:10 ` Peter Zijlstra
2016-01-30 3:36 ` Frederic Weisbecker
2016-01-30 3:47 ` Rik van Riel [this message]
2016-01-29 22:23 ` [PATCH 2/2] sched,time: call __acct_update_integrals once a jiffy riel
2016-01-29 22:43 ` Rik van Riel
2016-01-30 14:20 ` Frederic Weisbecker
2016-01-30 17:53 ` Mike Galbraith
2016-01-30 20:36 ` Frederic Weisbecker
2016-01-31 2:52 ` Mike Galbraith
2016-01-31 5:37 ` Mike Galbraith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56AC325D.7040100@redhat.com \
--to=riel@redhat.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).