public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Phil Carmody <ext-phil.2.carmody@nokia.com>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org, sboyd@codeaurora.org
Subject: Re: [PATCHv3 0/4] Improve fallback LPJ calculation
Date: Fri, 11 Mar 2011 15:26:40 -0800	[thread overview]
Message-ID: <20110311152640.47d06e9d.akpm@linux-foundation.org> (raw)
In-Reply-To: <1299768487-13200-1-git-send-email-ext-phil.2.carmody@nokia.com>

On Thu, 10 Mar 2011 16:48:03 +0200
Phil Carmody <ext-phil.2.carmody@nokia.com> wrote:

> 
> Apologies for picking on you, Andrew, and sending this out of the blue,

Someone has to do it.  This code hasn't really been touched for half a
decade or more.

> but I didn't have much luck with my previous attempt, and I quite like
> this patchset, so thought it was worth trying again.
> (http://lkml.org/lkml/2010/9/28/121)
> 
> The guts of this patchset are in patch 2/4. The motivation for that patch
> 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.
> 
> Patch 2/4 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 5, and, in the process, often arrive at a more accurate lpj 
> value.

A worthwhile benefit.

> The 'bands' and 'sub-logarithmic' growth may look over-engineered, but 
> they only cost a small level of inaccuracy in 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 will not typically use this fallback routine, 
> but I wanted to code defensively, able to cope with all kinds of processor 
> behaviours and kernel command line options.
> 
> Patch 3/4 is an additional trap for the nightmare scenario where the
> initial estimate is very inaccurate, possibly due to things like SMIs.
> It simply retries with a larger bound.
> 
> 1/4 is simply cosmetic to prepare for 2/4. 
> 4/4 is simply to assist testing and not intended for integration.
> 
> 
> Changes since initial RFC:
>  - More informational commit messages
>  - Inserted patch 3/4 after discovering that x86_64 had a failure case.

OK, I guess we'll toss it in there and see how it goes.

  parent reply	other threads:[~2011-03-11 23:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 14:48 [PATCHv3 0/4] Improve fallback LPJ calculation Phil Carmody
2011-03-10 14:48 ` [PATCH 1/4] calibrate: extract fall-back calculation into own helper Phil Carmody
2011-03-10 14:48   ` [PATCH 2/4] calibrate: home in on correct lpj value more quickly Phil Carmody
2011-03-10 14:48     ` [PATCH 3/4] calibrate: retry with wider bounds when converge seems to fail Phil Carmody
2011-03-10 14:48       ` [PATCH 4/4] DO NOT INTEGRATE: test-only timing Phil Carmody
2011-03-11 23:27       ` [PATCH 3/4] calibrate: retry with wider bounds when converge seems to fail Andrew Morton
2011-03-12  2:10         ` Phil Carmody
2011-03-11 23:26 ` Andrew Morton [this message]
2011-03-18 22:40 ` [PATCHv3 0/4] Improve fallback LPJ calculation Stephen Boyd
2011-03-22  9:41   ` 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=20110311152640.47d06e9d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ext-phil.2.carmody@nokia.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    /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