2002-10-19 18:06:24

by Manfred Spraul

[permalink] [raw]
Subject: [PATCH] use correct wakeups in fs/pipe.c

--- 2.5/fs/pipe.c Sat Oct 19 11:40:14 2002
+++ build-2.5/fs/pipe.c Sat Oct 19 19:44:04 2002
@@ -109,7 +109,7 @@
break;
}
if (do_wakeup) {
- wake_up_interruptible(PIPE_WAIT(*inode));
+ wake_up_interruptible_sync(PIPE_WAIT(*inode));
kill_fasync(PIPE_FASYNC_WRITERS(*inode), SIGIO, POLL_OUT);
}
pipe_wait(inode);
@@ -117,7 +117,7 @@
up(PIPE_SEM(*inode));
/* Signal writers asynchronously that there is more room. */
if (do_wakeup) {
- wake_up_interruptible_sync(PIPE_WAIT(*inode));
+ wake_up_interruptible(PIPE_WAIT(*inode));
kill_fasync(PIPE_FASYNC_WRITERS(*inode), SIGIO, POLL_OUT);
}
if (ret > 0)


Attachments:
patch-pipefix (638.00 B)

2002-10-20 23:25:02

by Hanna Linder

[permalink] [raw]
Subject: Re: [PATCH] use correct wakeups in fs/pipe.c

--On Saturday, October 19, 2002 20:12:42 +0200 Manfred Spraul <[email protected]> wrote:

> wake_up_interruptible() and _sync() calls are reversed in pipe_read().
>
> The attached patches only calls _sync if a schedule() call follows.
>

FYI. This patch fixes a hang on pipetest.c with the --epoll option.

Thanks!

Hanna

2002-10-20 23:34:43

by Davide Libenzi

[permalink] [raw]
Subject: Re: [PATCH] use correct wakeups in fs/pipe.c

On Sun, 20 Oct 2002, Hanna Linder wrote:

> --On Saturday, October 19, 2002 20:12:42 +0200 Manfred Spraul <[email protected]> wrote:
>
> > wake_up_interruptible() and _sync() calls are reversed in pipe_read().
> >
> > The attached patches only calls _sync if a schedule() call follows.
> >
>
> FYI. This patch fixes a hang on pipetest.c with the --epoll option.

Hanna, I'm not sure if your port of the epoll pipe code on 2.5.44 is
correct. That fix shouldn't affect epoll. Try the code I sent you
yesterday or today, it working fine on my machine without the fix.



- Davide


2002-10-20 23:44:00

by Hanna Linder

[permalink] [raw]
Subject: Re: [PATCH] use correct wakeups in fs/pipe.c

--On Sunday, October 20, 2002 16:49:24 -0700 Davide Libenzi <[email protected]> wrote:

> On Sun, 20 Oct 2002, Hanna Linder wrote:
>
>> --On Saturday, October 19, 2002 20:12:42 +0200 Manfred Spraul <[email protected]> wrote:
>>
>> > wake_up_interruptible() and _sync() calls are reversed in pipe_read().
>> >
>> > The attached patches only calls _sync if a schedule() call follows.
>> >
>>
>> FYI. This patch fixes a hang on pipetest.c with the --epoll option.
>
> Hanna, I'm not sure if your port of the epoll pipe code on 2.5.44 is
> correct. That fix shouldn't affect epoll. Try the code I sent you
> yesterday or today, it working fine on my machine without the fix.

You are right. I had changed pipetest.c in all my debugging earlier
and used the original version of pipetest.c with your new patch and
Manfreds, which worked. I will be more carefull in the future.

Thanks.

Hanna