From: Dominik Brodowski <devel@brodo.de>
To: Gabriel Paubert <paubert@iram.es>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Yoann Vandoorselaere <yoann@prelude-ids.org>,
cpufreq@lists.arm.linux.org.uk, cpufreq@www.linux.org.uk,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: fix 32bits integer overflow in loops_per_jiffy calculation
Date: Thu, 22 Aug 2002 18:51:08 +0200 [thread overview]
Message-ID: <20020822185107.A1160@brodo.de> (raw)
In-Reply-To: <3D65020D.5070201@iram.es>; from paubert@iram.es on Thu, Aug 22, 2002 at 03:23:57PM +0000
Hi,
> > Well... it's clearly located inside kernel/cpufreq.c, so there is
> > little risk, though it may be worth a big bold comment
>
> Hmm, in my experience people hardly ever read detailed comments even
> when they are well-written. Perhaps if you called the function
> imprecise_scale or coarse_scale, it might ring a bell.
First of all, it's located in include/linux/cpufreq.h [to be accessible for
arch/i386/kernel/time.c, called cpufreq_scale() which should mean that it is
only meant for CPUFreq and nothing else.
> >>In this case a generic scaling function, while not a standard libgcc/C
> >>library feature has potentially more applications than this simple
> >>cpufreq approximation. But I don't see very much the need for scaling a
> >>long (64 bit on 64 bit archs) value, 32 bit would be sufficient.
> >
> >
> > Well... if you can write one, go on then ;) In my case, I'm happy
> > with Yoann implementation for cpufreq right now. Though I agree that
> > could ultimately be moved to arch code.
>
> Ok, I'll give it a try this week-end (PPC, i386 and all 64 bit should
> archs should be trivial).
IMHO per-arch functions are really not needed. The only architectures which
have CPUFreq drivers by now are ARM and i386. This will change, hopefully;
IMHO it should be enough to include some basic limit checking in
cpufreq_scale().
Dominik
next prev parent reply other threads:[~2002-08-22 17:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-22 13:02 [PATCH]: fix 32bits integer overflow in loops_per_jiffy calculation Benjamin Herrenschmidt
2002-08-22 12:12 ` Gabriel Paubert
2002-08-22 14:31 ` Benjamin Herrenschmidt
2002-08-22 15:23 ` Gabriel Paubert
2002-08-22 15:59 ` Yoann Vandoorselaere
2002-08-22 17:22 ` [PATCH]: fix 32bits integer overflow in loops_per_jiffycalculation george anzinger
2002-08-22 16:51 ` Dominik Brodowski [this message]
2002-08-22 19:35 ` [PATCH]: fix 32bits integer overflow in loops_per_jiffy calculation Benjamin Herrenschmidt
2002-08-22 17:46 ` Dominik Brodowski
2002-08-22 18:02 ` Yoann Vandoorselaere
2002-08-22 20:00 ` Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2002-08-22 9:50 Yoann Vandoorselaere
2002-08-22 10:21 ` Gabriel Paubert
2002-08-22 13:00 ` Benjamin Herrenschmidt
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=20020822185107.A1160@brodo.de \
--to=devel@brodo.de \
--cc=benh@kernel.crashing.org \
--cc=cpufreq@lists.arm.linux.org.uk \
--cc=cpufreq@www.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=paubert@iram.es \
--cc=yoann@prelude-ids.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