• Manfred Spraul's avatar
    [PATCH] pipe bugfix /cleanup · c33585c5
    Manfred Spraul authored
    pipe_write contains a wakeup storm, 2 writers that write into the same
    fifo can wake each other up, and spend 100% cpu time with
    wakeup/schedule, without making any progress.
    
    The only regression I'm aware of is that
    
      $ dd if=/dev/zero | grep not_there
    
    will fail due to OOM, because grep does something like
    
    	for(;;) {
    		rlen = read(fd, buf, len);
    		if (rlen == len) {
    			len *= 2;
    			buf = realloc(buf, len);
    		}
    	}
    
    if it operates on pipes, and due to the improved syscall merging, read
    will always return the maximum possible amount of data. But that's a grep
    bug, not a kernel problem.
    c33585c5
pipe.c 14.2 KB