From: Phil Carmody <ext-phil.2.carmody@nokia.com>
To: mingo@elte.hu, gregkh@suse.de
Cc: linux-kernel@vger.kernel.org, travis@sgi.com, akataria@vmware.com
Subject: [RFC 0/3] Improve fallback LPJ calculation
Date: Fri, 10 Sep 2010 12:54:25 +0300 [thread overview]
Message-ID: <1284112468-18498-1-git-send-email-ext-phil.2.carmody@nokia.com> (raw)
The motivation for patch 2/3 is that currently our OMAP calibrates
itself using the trial-and-error binary chop fallback that some other
architectures no longer need to perform. This is a lengthy process,
taking 0.2s in an environment where boot time is of great interest.
The patch has two optimisations. Firstly, it replaces the initial
repeated-doubling to find the relevant power of 2 with a tight loop
that just does as much as it can in a jiffy. Secondly, it doesn't
binary chop over an entire power of 2 range, it choses a much smaller
range based on how much it squeezed in, and failed to squeeze in,
during the first stage. Both are significant optimisations, and
bring our calibration down from 23 jiffies to 6, and, in the process,
arrive at a more accurate lpj value.
The 'bands' and 'sub-logarithmic' growth may look over-engineered,
but they cost a small level of in inaccuracy of the initial guess
(for all architectures) in order to avoid the very large inaccuracies
that appeared during testing (on x86_64 architectures, and presumably
others with less metronomic operation). Note that due to the existence
of the TSC and other timers, the x86_64 doesn't use this fallback
routine, but I wanted to code defensively, able to cope with all kinds
of processor behaviours.
1/3 is simply cosmetic to prepare for 2/3.
3/3 is simply to assist testing and not intended for integration.
I would appreciate it if people with exotic or unusual architectures
could help test this.
Cheers,
Phil
next reply other threads:[~2010-09-10 10:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 9:54 Phil Carmody [this message]
2010-09-10 9:54 ` [PATCH 1/3] calibrate: extract fall-back calculation into own helper Phil Carmody
2010-09-10 9:54 ` [PATCH 2/3] calibrate: home in on correct lpj bounds more quickly Phil Carmody
2010-09-10 9:54 ` [PATCH 3/3] DO NOT INTEGRATE: test-only timing Phil Carmody
2010-09-22 9:22 ` [RFC 0/3] Improve fallback LPJ calculation Phil Carmody
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=1284112468-18498-1-git-send-email-ext-phil.2.carmody@nokia.com \
--to=ext-phil.2.carmody@nokia.com \
--cc=akataria@vmware.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=travis@sgi.com \
/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
all inboxes | Powered by JetHome®