Re: scheduler (sched_4bsd) questions

From: John Baldwin (jhb_at_FreeBSD.org)
Date: 09/20/04

  • Next message: Stephan Uphoff: "Re: scheduler (sched_4bsd) questions"
    To: freebsd-arch@FreeBSD.org
    Date: Mon, 20 Sep 2004 14:46:15 -0400
    
    

    On Sunday 19 September 2004 03:10 am, Julian Elischer wrote:
    > John Baldwin wrote:
    > > On Saturday 18 September 2004 01:42 pm, Stephan Uphoff wrote:
    > >>On Fri, 2004-09-17 at 21:20, Julian Elischer wrote:
    > >>>Stephan Uphoff wrote:
    > >>>>If this is true kernel threads can be preempted while holding
    > >>>>for example the root vnode lock (or other important kernel
    > >>>>resources) while not getting a chance to run until there are no more
    > >>>>user processes with better priority.
    > >>>
    > >>>This is also true, though it is a slightly more complicated thing than
    > >>>that.
    > >>>Preempting threads are usually interrupt threads and are thus usually
    > >>>short lived,.
    > >>
    > >>But interrupt threads often wake up other threads ...
    > >
    > > That are lower priority and thus won't be preempted to. Instead, they
    > > run when the interrupt thread goes back to sleep after it finishes.
    >
    > though that may still be before the original preempted thread gets run..
    >
    > that reminds me..
    > John, we should add a flag to setrunqueue to add a preempted thread back at
    > the FRONT of it's runqueue.. So that it gets a chance to use the rest of
    > its slot..

    The scheduler can already detect this by noting that curthread is being passed
    to sched_add() when it has quantum left and then put it at the head of the
    queue for its priority but only with the remaining quanta. This only really
    works for schedulers that actually track quanta, i.e., not 4BSD. Given that,
    I think the scheduler is free to implement this how it chooses and doesn't
    require another flag to setrunqueue().

    -- 
    John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
    "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Stephan Uphoff: "Re: scheduler (sched_4bsd) questions"

    Relevant Pages

    • Re: RELENG_7 jerky mouse and skipping sound
      ... Fiddling with X's rtprio ... If it were a scheduler issue, it would seem like the priority of ... spawned with the appropriate lower priority - but it happens with both ...
      (freebsd-stable)
    • Re: machdep.cpu_idle_hlt and SMP perf?
      ... >> John Baldwin writes: ... >>> scheduler tries to do IPIs to wakeup any sleeping CPUs when it ... >>> ithreads than just preempting directly to the ithread. ... One thing which really helps is disabling preemption. ...
      (freebsd-current)
    • Re: scheduler (sched_4bsd) questions
      ... John Baldwin wrote: ... >>But interrupt threads often wake up other threads ... ... > That are lower priority and thus won't be preempted to. ...
      (freebsd-arch)
    • Re: scheduler (sched_4bsd) questions
      ... John Baldwin wrote: ... >>But interrupt threads often wake up other threads ... ... > That are lower priority and thus won't be preempted to. ...
      (freebsd-arch)