I've noticed discrepancy in the number of processes
returned by sysinfo() syscall versus the number of processes
listed by 'ps'. The problem traced down to the following line
of code in kernel/info.c:
val.proc = nr_task-1;
as if the idle task is taken into account in 'nr_tasks',
However, since kernel 2.2 the comment to (and the usage of)
'nr_task' explicitly states that the idle task is not anymore
counted in this variable. From kernel/fork.c:
/* The idle tasks do not count.. */
int nr_tasks = 0;
As a matter of fact, prior to kernel 2.2 the initial value of
'nr_tasks' was 1, and the idle task 0 was counted, so the
correction by -1 was really necessary. But it was forgotten
to undo this subtraction when the 'nr_tasks' had changed its
meaning since then.
Best regards,
Anton Lavrentiev
NCBI/NLM/NIH
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/