• Andrew Morton's avatar
    [PATCH] Fix writev atomicity on pipe/fifo · 1af764e1
    Andrew Morton authored
    From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    
    Current writev() of pipe/fifo can be interleaved with data from other
    processes doing writes even when the requests size is <= PIPE_BUF.  These
    writes should in fact be atomic.
    
    The readv() side is also supported for same behavior with read().  And it
    is faster.
    
    readv/writev version of bw_pipe in LMbench
    
    2.6.0-test9-bk12
    hirofumi@devron (i686-pc-linux-gnu)[1010]$ ./bw_pipe -m 4096 -M 5
    Pipe bandwidth: 45.53 MB/sec
    hirofumi@devron (i686-pc-linux-gnu)[1009]$ ./bw_pipe -m 1024 -M 5
    Pipe bandwidth: 20.08 MB/sec
    
    2.6.0-test9-bk12 + patch
    hirofumi@devron (i686-pc-linux-gnu)[1001]$ ./bw_pipe -m 4096 -M 5
    Pipe bandwidth: 65.98 MB/sec
    hirofumi@devron (i686-pc-linux-gnu)[1002]$ ./bw_pipe -m 1024 -M 5
    Pipe bandwidth: 32.19 MB/sec
    1af764e1
pipe.c 15.8 KB