10 Jan, 2011

1 commit


29 Nov, 2010

2 commits

  • This avoids some include-file hell, and the function isn't really
    important enough to be inlined anyway.

    Reported-by: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • And in particular, use it in 'pipe_fcntl()'.

    The other pipe functions do not need to use the 'careful' version, since
    they are only ever called for things that are already known to be pipes.

    The normal read/write/ioctl functions are called through the file
    operations structures, so if a file isn't a pipe, they'd never get
    called. But pipe_fcntl() is special, and called directly from the
    generic fcntl code, and needs to use the same careful function that the
    splice code is using.

    Cc: Jens Axboe
    Cc: Andrew Morton
    Cc: Al Viro
    Cc: Dave Jones
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

03 Jun, 2010

1 commit


22 May, 2010

2 commits


11 May, 2009

1 commit

  • If f_op->splice_read() is not implemented, fall back to a plain read.
    Use vfs_readv() to read into previously allocated pages.

    This will allow splice and functions using splice, such as the loop
    device, to work on all filesystems. This includes "direct_io" files
    in fuse which bypass the page cache.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Jens Axboe

    Miklos Szeredi
     

15 Apr, 2009

1 commit

  • There are lots of sequences like this, especially in splice code:

    if (pipe->inode)
    mutex_lock(&pipe->inode->i_mutex);
    /* do something */
    if (pipe->inode)
    mutex_unlock(&pipe->inode->i_mutex);

    so introduce helpers which do the conditional locking and unlocking.
    Also replace the inode_double_lock() call with a pipe_double_lock()
    helper to avoid spreading the use of this functionality beyond the
    pipe code.

    This patch is just a cleanup, and should cause no behavioral changes.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Jens Axboe

    Miklos Szeredi
     

10 Jul, 2007

7 commits


08 Jun, 2007

1 commit


27 Mar, 2007

1 commit

  • Ocfs2 wants to implement it's own splice write actor so that it can better
    manage cluster / page locks. This lets us re-use the rest of splice write
    while only providing our own code where it's actually important.

    Signed-off-by: Mark Fasheh
    Signed-off-by: Jens Axboe

    Mark Fasheh
     

14 Dec, 2006

2 commits

  • Fields of struct pipe_buf_operations have not a precise layout (ie not
    optimized to fit cache lines nor reduce cache line ping pongs)

    The bufs[] array is *large* and is placed near the beginning of the
    structure, so all following fields have a large offset. This is
    unfortunate because many archs have smaller instructions when using small
    offsets relative to a base register. On x86 for example, 7 bits offsets
    have smaller instruction lengths.

    Moving bufs[] at the end of pipe_buf_operations permits all fields to have
    small offsets, and reduce text size, and icache pressure.

    # size vmlinux.pre vmlinux
    text data bss dec hex filename
    3268989 664356 492196 4425541 438745 vmlinux.pre
    3268765 664356 492196 4425317 438665 vmlinux

    So this patch reduces text size by 224 bytes on my x86_64 machine. Similar
    results on ia32.

    Signed-off-by: Eric Dumazet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     
  • - pipe/splice should use const pipe_buf_operations and file_operations

    - struct pipe_inode_info has an unused field "start" : get rid of it.

    Signed-off-by: Eric Dumazet
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

04 May, 2006

1 commit

  • Nick says that the current construct isn't safe. This goes back to the
    original, but sets PIPE_BUF_FLAG_LRU on user pages as well as they all
    seem to be on the LRU in the first place.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

02 May, 2006

6 commits

  • Apply the same rules as the anon pipe pages, only allow stealing
    if no one else is using the page.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Currently we rely on the PIPE_BUF_FLAG_LRU flag being set correctly
    to know whether we need to fiddle with page LRU state after stealing it,
    however for some origins we just don't know if the page is on the LRU
    list or not.

    So remove PIPE_BUF_FLAG_LRU and do this check/add manually in pipe_to_file()
    instead.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • If SPLICE_F_GIFT is set, the user is basically giving this pages away to
    the kernel. That means we can steal them for eg page cache uses instead
    of copying it.

    The data must be properly page aligned and also a multiple of the page size
    in length.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • The pipe ->map() method uses kmap() to virtually map the pages, which
    is both slow and has known scalability issues on SMP. This patch enables
    atomic copying of pipe pages, by pre-faulting data and using kmap_atomic()
    instead.

    lmbench bw_pipe and lat_pipe measurements agree this is a Good Thing. Here
    are results from that on a UP machine with highmem (1.5GiB of RAM), running
    first a UP kernel, SMP kernel, and SMP kernel patched.

    Vanilla-UP:
    Pipe bandwidth: 1622.28 MB/sec
    Pipe bandwidth: 1610.59 MB/sec
    Pipe bandwidth: 1608.30 MB/sec
    Pipe latency: 7.3275 microseconds
    Pipe latency: 7.2995 microseconds
    Pipe latency: 7.3097 microseconds

    Vanilla-SMP:
    Pipe bandwidth: 1382.19 MB/sec
    Pipe bandwidth: 1317.27 MB/sec
    Pipe bandwidth: 1355.61 MB/sec
    Pipe latency: 9.6402 microseconds
    Pipe latency: 9.6696 microseconds
    Pipe latency: 9.6153 microseconds

    Patched-SMP:
    Pipe bandwidth: 1578.70 MB/sec
    Pipe bandwidth: 1579.95 MB/sec
    Pipe bandwidth: 1578.63 MB/sec
    Pipe latency: 9.1654 microseconds
    Pipe latency: 9.2266 microseconds
    Pipe latency: 9.1527 microseconds

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • The ->map() function is really expensive on highmem machines right now,
    since it has to use the slower kmap() instead of kmap_atomic(). Splice
    rarely needs to access the virtual address of a page, so it's a waste
    of time doing it.

    Introduce ->pin() to take over the responsibility of making sure the
    page data is valid. ->map() is then reduced to just kmap(). That way we
    can also share a most of the pipe buffer ops between pipe.c and splice.c

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Found by Oleg Nesterov , fixed by me.

    - Only allow full pages to go to the page cache.
    - Check page != buf->page instead of using PIPE_BUF_FLAG_STOLEN.
    - Remember to clear 'stolen' if add_to_page_cache() fails.

    And as a cleanup on that:

    - Make the bottom fall-through logic a little less convoluted. Also make
    the steal path hold an extra reference to the page, so we don't have
    to differentiate between stolen and non-stolen at the end.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

26 Apr, 2006

1 commit


11 Apr, 2006

3 commits

  • Basically an in-kernel implementation of tee, which uses splice and the
    pipe buffers as an intelligent way to pass data around by reference.

    Where the user space tee consumes the input and produces a stdout and
    file output, this syscall merely duplicates the data inside a pipe to
    another pipe. No data is copied, the output just grabs a reference to the
    input pipe data.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • get rid of the PIPE_*() macros. Scripted transformation.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Jens Axboe

    Ingo Molnar
     
  • It's more efficient for sendfile() emulation. Basically we cache an
    internal private pipe and just use that as the intermediate area for
    pages. Direct splicing is not available from sys_splice(), it is only
    meant to be used for sendfile() emulation.

    Additional patch from Ingo Molnar to avoid the PIPE_BUFFERS loop at
    exit for the normal fast path.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

10 Apr, 2006

1 commit

  • separate out the 'internal pipe object' abstraction, and make it
    usable to splice. This cleans up and fixes several aspects of the
    internal splice APIs and the pipe code:

    - pipes: the allocation and freeing of pipe_inode_info is now more symmetric
    and more streamlined with existing kernel practices.

    - splice: small micro-optimization: less pointer dereferencing in splice
    methods

    Signed-off-by: Ingo Molnar

    Update XFS for the ->splice_read/->splice_write changes.

    Signed-off-by: Jens Axboe

    Ingo Molnar
     

03 Apr, 2006

4 commits


31 Mar, 2006

1 commit


10 Jan, 2006

1 commit


08 Sep, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds