mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gerald Britton <gbritton@alum.mit.edu>
To: Dominik Brodowski <linux@brodo.de>
Cc: Gerald Britton <gbritton@alum.mit.edu>,
	linux-kernel@vger.kernel.org, cpufreq@www.linux.org.uk
Subject: Re: [PATCH] Re: [2.5.39] (3/5) CPUfreq i386 drivers
Date: Sun, 29 Sep 2002 21:01:13 -0400	[thread overview]
Message-ID: <20020929210113.A22311@light-brigade.mit.edu> (raw)
In-Reply-To: <20020930013926.A11768@brodo.de>; from linux@brodo.de on Mon, Sep 30, 2002 at 01:39:26AM +0200

> > [rounding] 
> > There probably isn't a lot that can be done about these unfortunately, but
> > they won't necessarily converge to a stable value so things may eventually
> > start to fail.
> Yes, that's a problem; but as cpufreq doesn't change speed dynamically yet
> (and thus the number of transitions is somewhat limited) it shouldn't cause
> too much trouble _yet_. But I'll try to think of a better solution _soon_.

One thought here might be.. for each variable which needs to be scaled, save
off the boot value and boot frequency and always scale from that value so that
we don't accumulate errors.  Fairly simple implementation (i doubt there are
very many things which will need scaling, so it doesn't bloat much).  simply
do something like this:

static unsigned int orig_freq;
statid unsigned long orig_scalable;
...
if (type == CPUFREQ_PRECHANGE) {
	if (!orig_freq) {
		orig_freq = freqs->old;
		orig_scalable = scalable;
	}
	if (scale_on_pre)
		scalable = cpufreq_scale(orig_scalable, orig_freq, freqs->new);
} else if (type == CPUFREQ_POSTCHANGE) {
	BUG_ON(!orig_freq);
	if (scale_on_post)
		scalable = cpufreq_scale(orig_scalable, orig_freq, freqs->new);
}

It seems to be working ok on my system adding saved boot values for
loops_per_jiffy in cpufreq.c and cpu_khz, fast_gettimeoffset_quotient, and
the per cpu loops_per_jiffy values in time.c.

				-- Gerald


  reply	other threads:[~2002-09-30  0:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-28  9:25 Dominik Brodowski
2002-09-28 11:44 ` [PATCH] " Dominik Brodowski
2002-09-28 17:47   ` Gerald Britton
2002-09-29  9:16     ` Dominik Brodowski
2002-09-29 10:10       ` Dominik Brodowski
2002-09-29 19:56         ` Gerald Britton
2002-09-29 23:39           ` Dominik Brodowski
2002-09-30  1:01             ` Gerald Britton [this message]
2002-09-30  0:59           ` Horst von Brand
2002-09-28 22:03   ` Toon van der Pas
2002-09-29  8:38     ` Dominik Brodowski
2002-09-29 14:44       ` Toon van der Pas

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=20020929210113.A22311@light-brigade.mit.edu \
    --to=gbritton@alum.mit.edu \
    --cc=cpufreq@www.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@brodo.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

all inboxes | Powered by JetHome®