Re: CPU usage (Read by `top`)

From: Pavel Machek (pavel@suse.cz)
Date: Fri Jan 21 2000 - 09:27:16 EST


Hi!

> > > > > Now sched_yield(), itself, works well. The problem is that the task
> > > > > that gave up the CPU is still being 'Charged' for it!
> > > >
> > > > Well, I used to had worse case: software that sleeps "just before" it
> > > > would be charged is charged 0% even if it eats 80% or so.
> > > >
> > > > Clearly, cpu metering is broken. There's no easy way to fix it.
> > >
> > > Just wanted to get it into the queue of things that should be fixed
> > > before the next big leap into some future improvement project that
> > > sometimes leaves old bugs unfixed.
> >
> > Well - it is not quite clear if this bug should be fixed.
> >
> > Current method is very_low_overhead and wrong.
> >
> > Is it worth to add overhead?
> > Pavel
>
> Well I don't know. Certainly when some task wants to give up the
> CPU because it's waiting for an event, as long as the overhead gets
> charged to that task only, it's not really overhead at all because
> it doesn't affect other tasks.

> I think that it probably is not a real big fix. If sched_yield() was
> handled like usleep() on entry and return. The overhead affects only
> the task that called sched_yield().

So do usleep(20) instead of sched_yield() in your apps.

> But, some junk hardware has to be handled that doesn't use interrupts
> and only signals its state with some bits in a port. Such hardware
> wouldn't even run on an Alpha or a Sun. But with Linux on Intel, we
> can currently do "anything". This poll stuff can run from user-space.
> I don't even need a driver. Just iopl(3) and away we go. It would be
> nice if it looked as good as it works!

Well, this is what I'm doing with ltmodem ;-).
                                                                Pavel

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents me at discuss@linmodems.org

- 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/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:25 EST