From: Anton Lavrentiev <lavr@ncbi.nlm.nih.gov>
To: linux-kernel@vger.kernel.org
Subject: sys_sysinfo()'s bug in reporting the number of processes
Date: Tue, 26 Feb 2002 17:06:29 -0500 [thread overview]
Message-ID: <3C7C06E5.907F536E@ncbi.nlm.nih.gov> (raw)
Dear Linux Developers:
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
reply other threads:[~2002-02-26 22:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C7C06E5.907F536E@ncbi.nlm.nih.gov \
--to=lavr@ncbi.nlm.nih.gov \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®