lkml.org 
[lkml]   [2000]   [Feb]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: /proc/nzombies
    Date
    In article <20000229011707.A9049@frodo.rrze.uni-erlangen.de>, you write:
    >
    >The process exit path is critical--it is called often and every cycle is
    >important. Take a webserver: It can fork a process per request. Consider
    >an SMP system: If you write to the same counter repeatedly with all CPUs
    >you will get cache ping-pong effects which slow you down severely. All
    >these things have to be considered.

    So have a per-CPU (signed) zombie count, and a global zombie count.
    When a process calls exit(), its current CPU increments its own zombie
    count; when a process is reaped, the reaping CPU decrements its own
    zombie count. Every so often, and whenever someone reads
    /proc/nzombies, we pass over all the counts, doing
    xchg(&cpu_nzombies[i].val, 0) and adding the returned values to the
    global nzombies count.

    Paul




    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:56    [W:5.230 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site