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/
This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:22 EST