pipe/fifo code merged.

Giovanni Trematerra gianni at freebsd.org
Thu Jan 12 08:55:46 UTC 2012


On Wed, Jan 11, 2012 at 12:04 AM, Giovanni Trematerra
<gianni at freebsd.org> wrote:
> On Tue, Jan 10, 2012 at 10:41 AM, Bruce Evans <brde at optusnet.com.au> wrote:
>> On Mon, 9 Jan 2012, Giovanni Trematerra wrote:
>>
>>> On Mon, Jan 9, 2012 at 3:34 PM, Bruce Evans <brde at optusnet.com.au> wrote:
>>>>
>>>>

[skip]

>
>>
>> In this file, I have most experience fixing this function (and open
>> and close so that select and poll work).  The above looks simple, but
>> has a complex interaction with layers above and below it.  Most of the
>> details are in the socket layer.  You had to reimplement these in the
>> pipe layer.  The most delicate point involving fs_wgen seems to be
>> reimplemented correctly in fifo_iseof().  Before I fixed this for
>> fifos, poll and select on pipes (especially for EOF) was less broken
>> than for fifos, partly because pipes are simpler -- they can't be
>> reopened.  My tests in /usr/src/tools/regression/poll/ are hopefully
>> enough to detect any regressions.  Some of the tests are intentionally
>> left broken and/or expected to fail, to be bug for bug compatible with
>> old kernel bugs.
>>
>
> ok. I'll try that regression test
>

Hi Bruce,
thanks again to point me out those regression tests I missed in first place.
I ran those tests and results were identical with patched and non
patched kernel.
So at least in that regard the patch doesn't introduce more regressions.
There are some tests that fail. If you and others think it's worth to
fix them I can
take this on.

--
Gianni

10.0-CURRENT PATCHED
[gianni at devbox: poll]% ./pipepoll
1..20
ok 1      Pipe state 4: expected 0; got 0
ok 2      Pipe state 5: expected POLLIN; got POLLIN
ok 3      Pipe state 6: expected POLLIN | POLLHUP; got POLLIN | POLLHUP
not ok 4  Pipe state 6a: expected POLLHUP; got POLLIN | POLLHUP
ok 5      Sock state 4: expected 0; got 0
ok 6      Sock state 5: expected POLLIN; got POLLIN
ok 7      Sock state 6: expected POLLIN | POLLHUP; got POLLIN | POLLHUP
not ok 8  Sock state 6a: expected POLLHUP; got POLLIN | POLLHUP
ok 9      FIFO state 0: expected 0; got 0
ok 10     FIFO state 1: expected 0; got 0
ok 11     FIFO state 2: expected POLLIN; got POLLIN
ok 12     FIFO state 2a: expected 0; got 0
not ok 13 FIFO state 3: expected POLLHUP; got POLLIN | POLLHUP
ok 14     FIFO state 4: expected 0; got 0
ok 15     FIFO state 5: expected POLLIN; got POLLIN
ok 16     FIFO state 6: expected POLLIN | POLLHUP; got POLLIN | POLLHUP
not ok 17 FIFO state 6a: expected POLLHUP; got POLLIN | POLLHUP
not ok 18 FIFO state 6b: poll result 0 expected 1. expected POLLHUP; got 0
not ok 19 FIFO state 6c: expected POLLHUP; got POLLIN | POLLHUP
not ok 20 FIFO state 6d: expected POLLHUP; got POLLIN | POLLHUP

[gianni at devbox: poll]% ./pipeselect
1..20
ok 1      Pipe state 4: expected clear; got clear
ok 2      Pipe state 5: expected set; got set
ok 3      Pipe state 6: expected set; got set
ok 4      Pipe state 6a: expected set; got set
ok 5      Sock state 4: expected clear; got clear
ok 6      Sock state 5: expected set; got set
ok 7      Sock state 6: expected set; got set
ok 8      Sock state 6a: expected set; got set
not ok 9  FIFO state 0: expected set; got clear
ok 10     FIFO state 1: expected clear; got clear
ok 11     FIFO state 2: expected set; got set
ok 12     FIFO state 2a: expected clear; got clear
ok 13     FIFO state 3: expected set; got set
ok 14     FIFO state 4: expected clear; got clear
ok 15     FIFO state 5: expected set; got set
ok 16     FIFO state 6: expected set; got set
ok 17     FIFO state 6a: expected set; got set
not ok 18 FIFO state 6b: expected set; got clear
ok 19     FIFO state 6c: expected set; got set
ok 20     FIFO state 6d: expected set; got set

STOCK KERNEL 10.0-CURRENT

[gianni at devbox: poll]% ./pipepoll
1..20
ok 1      Pipe state 4: expected 0; got 0
ok 2      Pipe state 5: expected POLLIN; got POLLIN
ok 3      Pipe state 6: expected POLLIN | POLLHUP; got POLLIN | POLLHUP
not ok 4  Pipe state 6a: expected POLLHUP; got POLLIN | POLLHUP
ok 5      Sock state 4: expected 0; got 0
ok 6      Sock state 5: expected POLLIN; got POLLIN
ok 7      Sock state 6: expected POLLIN | POLLHUP; got POLLIN | POLLHUP
not ok 8  Sock state 6a: expected POLLHUP; got POLLIN | POLLHUP
ok 9      FIFO state 0: expected 0; got 0
ok 10     FIFO state 1: expected 0; got 0
ok 11     FIFO state 2: expected POLLIN; got POLLIN
ok 12     FIFO state 2a: expected 0; got 0
not ok 13 FIFO state 3: expected POLLHUP; got POLLIN | POLLHUP
ok 14     FIFO state 4: expected 0; got 0
ok 15     FIFO state 5: expected POLLIN; got POLLIN
ok 16     FIFO state 6: expected POLLIN | POLLHUP; got POLLIN | POLLHUP
not ok 17 FIFO state 6a: expected POLLHUP; got POLLIN | POLLHUP
not ok 18 FIFO state 6b: poll result 0 expected 1. expected POLLHUP; got 0
not ok 19 FIFO state 6c: expected POLLHUP; got POLLIN | POLLHUP
not ok 20 FIFO state 6d: expected POLLHUP; got POLLIN | POLLHUP

[gianni at devbox: poll]% ./pipeselect
1..20
ok 1      Pipe state 4: expected clear; got clear
ok 2      Pipe state 5: expected set; got set
ok 3      Pipe state 6: expected set; got set
ok 4      Pipe state 6a: expected set; got set
ok 5      Sock state 4: expected clear; got clear
ok 6      Sock state 5: expected set; got set
ok 7      Sock state 6: expected set; got set
ok 8      Sock state 6a: expected set; got set
not ok 9  FIFO state 0: expected set; got clear
ok 10     FIFO state 1: expected clear; got clear
ok 11     FIFO state 2: expected set; got set
ok 12     FIFO state 2a: expected clear; got clear
ok 13     FIFO state 3: expected set; got set
ok 14     FIFO state 4: expected clear; got clear
ok 15     FIFO state 5: expected set; got set
ok 16     FIFO state 6: expected set; got set
ok 17     FIFO state 6a: expected set; got set
not ok 18 FIFO state 6b: expected set; got clear
ok 19     FIFO state 6c: expected set; got set
ok 20     FIFO state 6d: expected set; got set


More information about the freebsd-arch mailing list