From owner-freebsd-arch@FreeBSD.ORG Thu Jan 12 08:55:46 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 733871065670; Thu, 12 Jan 2012 08:55:46 +0000 (UTC) (envelope-from giovanni.trematerra@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id C3FFE8FC0C; Thu, 12 Jan 2012 08:55:45 +0000 (UTC) Received: by qcse13 with SMTP id e13so1277302qcs.13 for ; Thu, 12 Jan 2012 00:55:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=n+OQo2VNsIkQy/CcF9k3a/VosCP5iFbu6Uhh5fA+6NE=; b=FsC4phZxbjPthv3RkeSKW3hCDqvTmuU8RBrzxS81QNOKbomTC3x9YnQfRCYAS+J9p1 W0ARv+lO2izWdeCpTTGQfdy4V/r4APmRP6fbYT7XXmpYZEVObxiLG32jT6qEKKtEOrbu OyptcPza5M1JIl/afo6C8C9YwTlsE+croLqpI= MIME-Version: 1.0 Received: by 10.224.186.130 with SMTP id cs2mr4189855qab.82.1326358544906; Thu, 12 Jan 2012 00:55:44 -0800 (PST) Sender: giovanni.trematerra@gmail.com Received: by 10.229.237.130 with HTTP; Thu, 12 Jan 2012 00:55:44 -0800 (PST) In-Reply-To: References: <20120110005155.S2378@besplex.bde.org> <20120110153807.H943@besplex.bde.org> Date: Thu, 12 Jan 2012 09:55:44 +0100 X-Google-Sender-Auth: xmwzNoA13NMrqV68bBGV1Pe7vLw Message-ID: From: Giovanni Trematerra To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: jilles@freebsd.org, Attilio Rao , flo@freebsd.org, Konstantin Belousov , freebsd-arch@freebsd.org Subject: Re: pipe/fifo code merged. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 08:55:46 -0000 On Wed, Jan 11, 2012 at 12:04 AM, Giovanni Trematerra wrote: > On Tue, Jan 10, 2012 at 10:41 AM, Bruce Evans wrot= e: >> On Mon, 9 Jan 2012, Giovanni Trematerra wrote: >> >>> On Mon, Jan 9, 2012 at 3:34 PM, Bruce Evans wrot= e: >>>> >>>> [skip] > >> >> In this file, I have most experience fixing this function (and open >> and close so that select and poll work). =A0The above looks simple, but >> has a complex interaction with layers above and below it. =A0Most of the >> details are in the socket layer. =A0You had to reimplement these in the >> pipe layer. =A0The most delicate point involving fs_wgen seems to be >> reimplemented correctly in fifo_iseof(). =A0Before 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. =A0My tests in /usr/src/tools/regression/poll/ are hopefully >> enough to detect any regressions. =A0Some 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@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@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@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@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