Re: [patch] sched-cleanup-2.5.69-A0

Werner Almesberger (wa@almesberger.net)
Mon, 19 May 2003 13:51:44 -0300


Ingo Molnar wrote:
> hm, it should in fact have been dead code from 2.5.68 on and upwards.
> Before that it was called quite often.

Ah, that makes sense: I hit it in 2.5.66 and haven't tried more
recent kernels yet.

> but doing stuff out of the idle thread is not nice i think, there's a fair
> amount of code that does not work out of the idle task.

Yes, that's what I'm a bit worried about. Not calling anything
that may sleep sounds fair enough to me. At least networking
(that is, ARP and TCP) seems to be okay (I'm calling netif_rx,
plus a few simple helper functions, such as flow control, and
dev_alloc_skb), but it would of course be nice to avoid future
pitfalls.

A bit of background: umlsim (http://umlsim.sourceforge.net/)
turns UML into an event-driven simulator. It sits in the idle
thread to handle timeouts (simulation time doesn't move while
there is any pending work). All this is controlled by a master
process that works as a script-driven debugger. What those
scripts do is up to the user, but there's a (currently very
small) set of "library" functions that handle some of the more
common tasks, such as moving packets from one UML to the next.

> Any reason you
> dont start some really-low-prio thread instead? (i could suggest
> SCHED_BATCH but the scheduler doesnt have it :-)

Yes, I could do that, as long as this thread gets only run if there
is really nothing else left to do, but then only this thread runs.
Which is, of course, exactly what the idle thread does.

I could make it yield if anything else is runnable (I already check
for this, but just to panic). I suppose if I just set p->static_prio
to MAX_PRIO-1, this thread that would give me only very few
activations while other processes are runnable ?

Thanks,
- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/