On Sat, Sep 2, 2017 at 8:39 PM, Jonathan Matthew <jonat...@d14n.org> wrote:

> Having looked through various parts of the context switching code this
> week,
> I noticed that mi_switch() has a man page, and it's quite out of date.
>
> tsleep() isn't the only sleep function, but I don't think there's much
> point
> listing them all.  Additionally, yield() and preempt() also exist, but
> aren't
> documented.
>
> The 'renice after 10 minutes of cpu time' thing was removed in 2003
> (r1.47 of kern_synch.c).
>
> It's more useful to mention the scheduler lock rather than a specific
> (wrong?)
> spl here, since mi_switch() does a SCHED_ASSERT_LOCKED().
>
> ok?
>

ok guenther@



> Alternatively, I'm not sure what the audience for this page is.  It's
> mostly
> a list of reasons you don't need to call mi_switch() because either it
> happens to you automatically or it's used to implement part of some other
> function.  Maybe we should just remove it and document the more useful
> kernel
> functions like yield()/preempt() better?
>

I think we should keep it.  Adding a preempt(9) page, or perhaps a
sched_pause(9) page that covers both itself, preempt(), and yield(), would
be a fine addition, but they don't obviate the utility of a page covering
the function that underlies them, IMO.

Reply via email to