[lkml]   [2001]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Alan Cox quote? (was: Re: accounting for threads)

    Jonathan Lundell writes:
    > Sun (or at least SPARC) is a bit of a special case, though. SPARC's
    > register-window architecture makes thread-switching (not to mention
    > recursion) significantly more expensive than on most other
    > architectures.

    The register window flush is a relatively constant cost with a fixed
    upper bound, regardless of whether you are switching threads or
    processes, the process is the same.

    This cost is honestly lost in the noise during a context switch. The
    trap entry/exit in and out of userspace usually costs more cycles than
    the window flush at schedule() time.

    The worst case whole window flush to the stack can fit (several times
    over) in the store cache of UltraSPARC-III.

    So my basic point is that I don't want people to read what you said
    and believe "oh then the difference between threads vs. different
    processes under Solaris is due to Sparc hw architecture reasons
    instead of sw reasons" which simply isn't true.

    Solaris just simply bites it at context switching threads in the

    The same identical code flushes the register windows for processes and
    threads under Linux, and there is no reason this should not be the


    Don't believe me that Solaris sucks here? Run this experiment under
    Solaris-latest and Linux on a sparc64 system (using lmbench):

    Under Solaris: ./lat_proc fork
    Under Linux: strace -f ./lat_proc fork

    I bet the Linux case does better than the Solaris run by some orders
    of magnitude. That's how poor their fork/exit/switch code is.


    David S. Miller

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 12:55    [W:0.023 / U:45.156 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site