LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Chuck Ebbert <cebbert@redhat.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Albert Cahalan <acahalan@gmail.com>
Subject: Re: PID entries in /proc sorted by number, not start time in 2.6.19
Date: Wed, 28 Feb 2007 16:39:43 -0700 [thread overview]
Message-ID: <m1irdlg8cg.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <45E601D9.1050503@redhat.com> (Chuck Ebbert's message of "Wed, 28 Feb 2007 17:27:37 -0500")
Chuck Ebbert <cebbert@redhat.com> writes:
> Starting with kernel 2.6.19, the process directories in
> /proc are sorted by number. They were sorted by process
> start time in 2.6.18 and earlier. This makes the output
> of procps come out in that order too, pissing off users
> who are used to the old way.
>
> To reproduce:
> 1. Wrap your PID numbers.
> 2. Do ls -fl /proc
> 3. Look at output of ps command.
>
> Compare 2.6.18 to 2.6.19.
>
> See also:
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230227
Apologies, but this was a bug fix for a more serious issue. The code
to report the directory entries by start time was fundamentally broken.
In particular the sequence:
opendir
readdir
readdir
readdir
....
closedir
can miss processes that exist for the entire duration of that
sequence. Which is non-posix, non-intuitive, and has no reasonable
work around.
The sorting by pid happened as a side effect of finding a stable token
we can come back to so we can at least guarantee normal readdir
semantics. That objects that exist for the entire readdir are
guaranteed to be displayed. That objects that come into existence or
are deleted during the readdir may be missed. That isn't perfect but
it is a useable semantic.
Eric
next prev parent reply other threads:[~2007-02-28 23:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-28 22:27 Chuck Ebbert
2007-02-28 23:39 ` Eric W. Biederman [this message]
2007-03-01 1:16 ` Albert Cahalan
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=m1irdlg8cg.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=acahalan@gmail.com \
--cc=cebbert@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: PID entries in /proc sorted by number, not start time in 2.6.19' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).