lkml.org 
[lkml]   [2001]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Feedback for fastselect and one-copy-pipe
Date
From: <kuznet@ms2.inr.ac.ru>
> Hello!
>
> > * davem's patch breaks apps that assume that write(,PIPE_BUF) after
> > poll(POLLOUT) never blocks, even for blocking pipes.
>
> Pardon, but PIPE_BUF <= PAGE_SIZE yet, so that fears have no reasons.
>

The difference is the =

> <<<<< davem's patch
> + if (count >= PAGE_SIZE &&
> ^^
> + !(filp->f_flags & O_NONBLOCK)) {
> <<<<<<< my patch
> + if (count > PIPE_BUF && chars == PIPE_SIZE &&
^
> + (!(filp->f_flags & O_NONBLOCK))) {
> <<<<<<<

davem used >=, I used >. All other differences between our patches are
code cleanups.

Just try this on i386: (PIPE_BUF is defined to 4096 on i386 - I really
don't understand why, but now it's too late to reverse it back to 512)

<<<<
char buf[PIPE_BUF];
void main()
{
int pipes[2];
pipe(pipes);
write(pipes[1],buf,sizeof(buf));
}
<<<<<<<

It returns immediately on all unix platforms I tested, including all
linux versions, except with davem's patch.
It's not guaranteed in sus or posix, but I'm reluctant to change it.

--
Manfred


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

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:1.786 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site