Re: PID entries in /proc sorted by number, not start time in 2.6.19

2007-02-28 Thread Albert Cahalan

On 2/28/07, Eric W. Biederman <[EMAIL PROTECTED]> wrote:

Chuck Ebbert <[EMAIL PROTECTED]> 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.


ps --sort=start_time

I've always just assumed the order to be random.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: PID entries in /proc sorted by number, not start time in 2.6.19

2007-02-28 Thread Eric W. Biederman
Chuck Ebbert <[EMAIL PROTECTED]> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


PID entries in /proc sorted by number, not start time in 2.6.19

2007-02-28 Thread Chuck Ebbert
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


PID entries in /proc sorted by number, not start time in 2.6.19

2007-02-28 Thread Chuck Ebbert
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

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: PID entries in /proc sorted by number, not start time in 2.6.19

2007-02-28 Thread Eric W. Biederman
Chuck Ebbert [EMAIL PROTECTED] 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
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: PID entries in /proc sorted by number, not start time in 2.6.19

2007-02-28 Thread Albert Cahalan

On 2/28/07, Eric W. Biederman [EMAIL PROTECTED] wrote:

Chuck Ebbert [EMAIL PROTECTED] 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.


ps --sort=start_time

I've always just assumed the order to be random.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/