Re: /proc/nzombies

From: Paul Menage (
Date: Tue Feb 29 2000 - 05:31:10 EST

In article <>, 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.


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

This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:22 EST