Re: thread/process & memory management source code

From: David Schultz (das_at_FreeBSD.ORG)
Date: 11/30/03

  • Next message: Steven G. Kargl: "C99 implementations of <fenv.h> and <complex.h>"
    Date: Sun, 30 Nov 2003 03:04:41 -0800
    To: Jay Sern Liew <jay.liew@ml.freebsd.jaysern.org>
    
    

    [Redirected to threads@; please avoid spamming multiple lists.]

    On Sat, Nov 29, 2003, Jay Sern Liew wrote:
    > Can someone point to me the specific location in the FreeBSD kernel source
    > where the code for FreeBSD's thread/process & memory management are?
    >
    > Specifically, where the dispatcher and scheduler is implemented,
    > what kind of scheduling algorithms(short term, long term) are used,
    > where the dynamic storage allocation algorithm is implemented(I'll try
    > to figure the algorithm used from the code), etc.

    For short term scheduling, FreeBSD uses the standard Unix
    decay-usage priority scheduling. There is also an experimental
    scheduler called ULE, which is designed to work better on SMPs.
    ULE uses an ad hoc idea about how ``interactive'' a process is in
    order to make scheduling decisions. See kern_switch.c,
    sched_4bsd.c, sched_ule.c in src/sys/kern.

    Long term scheduling is less important than it used to be, but
    FreeBSD has a swapout daemon that kicks in when the system can't
    recover enough memory by paging alone. It will basically swap out
    every process it can that is idle and hasn't already been swapped
    out recently. Swapping in occurs according in the order of a
    priority that is based on the interactivity of the process, the
    time it has been swapped out, and its nice value. See
    src/sys/vm/vm_glue.c.

    The primary kernel memory allocator is a slab allocator. See
    src/sys/vm/uma_*.c, src/sys/kern/kern_malloc.c, and
    http://citeseer.nj.nec.com/bonwick94slab.html.
    _______________________________________________
    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: Steven G. Kargl: "C99 implementations of <fenv.h> and <complex.h>"