Re: What I suspect

Linus Torvalds (torvalds@transmeta.com)
Wed, 8 Dec 1999 11:00:09 -0800 (PST)


On Wed, 8 Dec 1999, Rogier Wolff wrote:
> Linus Torvalds wrote:
> > So I think it's a great notion, but it just sucks in real life. And it
> > wouldn't allow the interesting things like gettimeofday() that really only
> > the kernel can do: you can calibrate the clock in user space, but you
> > cannot do things like automatically re-calibrate after a suspend event
> > etc, which is critical on laptops and will be even more so with the new
> > dual-frequency coppermine CPU's from Intel... (were not only the base time
> > changes, but the frequency of the clock changes too).
> >
> > There _are_ a lot of issues like this where the kernel really knows things
> > that user space can not easily know.
>
> Wouldn't you specify
>
> struct fast_time {
> volatile int jiffies;
> volatile int CPUspeed;
> volatile int time_base;
> };
>
> such that the kernel can adjust these values whenever the "resume"
> event comes in?

But where would the kernel adjust them?

This is truly _trivial_ to do when we have a fixed mapping: we not only
have the code (that the kernel controls and can change depending on
features like a broken TSC or newfangled TSC's like the Coppermine one
that changes frequency), but we'd also have the above kind of embedded
structure that is NOT exported to user space explicitly.

It's impossible to do sanely if we have a generic notion of MAP_INHERIT
which can be used by user space in an uncontrolled manner. And that's the
problem.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/