Subject: Re: Further works on yamt-idlelwp
To: Mindaugas R. <rmind@netbsd.org>
From: Daniel Sieger <dsieger@TechFak.Uni-Bielefeld.DE>
List: tech-kern
Date: 03/05/2007 16:06:30
Hi all,

On Mon, Mar 05, 2007 at 02:27:16AM +0200, Mindaugas R. wrote:
> Hello,
> I have made a small patch for further scheduler works. Shortly what it does:
> 
> 1) Add sched_rq, sched_proc_sd, sched_lwp_sd in struct cpu_data, proc, lwp.
> These would be a pointers for dynamically allocated scheduler-specific data.
> Currently, not used for SCHED_4BSD (yet).

Fine thing, we'll definetly need those. I'm not sure if I really like
the naming, though. I'd suggest something like the following:

cpu_sd_data for struct cpu_data
p_sd_data for struct proc
l_sd_data for struct lwp

The "sd" in the above obviously denotes "scheduler dependent".

> 4) Move old LWP enqueue from mi_switch() to sched_nextlwp(). Other
> implementations of scheduler could (and will) do that differently. In this
> case, maybe it would worth changing the name, eg, to sched_switch()?

If we gonna use sched_nextlwp() in this manner we should definetly
change this to sched_switch(), IMO.

> Next, we need to solve few issues. In essence:
...
> 2. As already discussed, currently, there is a problem with p_estcpu and
> p_pctcpu, which should be scheduler-independent. As mentioned, there is also
> a ccpu value, which is SCHED_4BSD specific. These are used in ps(1), top(1),
> etc. It would be good to find a solution what and how to deal with these. All
> suggestions are welcome.

I'm not really sure if we should touch these at all. Removing p_estcpu
would break libkvm. p_pctcpu is needed anyway. Even though it would be
more clean to get rid of p_estcpu, I think it would not hurt too much
to just leave it in place.

Regards,
Daniel

-- 
Daniel Sieger
Faculty of Technology
Bielefeld University
wwwhomes.uni-bielefeld.de/dsieger