10 Jul, 2006

1 commit

  • Several issues noticed/fixed:

    - We cannot reliably block in link_pipe() while holding both input and output
    mutexes. So do preparatory checks before locking down both mutexes and doing
    the link.

    - The ipipe->nrbufs vs i check was bad, because we could have dropped the
    ipipe lock in-between. This causes us to potentially look at unknown
    buffers if we were racing with someone else reading this pipe.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

23 Jun, 2006

1 commit


04 May, 2006

4 commits


02 May, 2006

8 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
     
  • We need to use the minium of {len, PAGE_SIZE-off}, not {len, PAGE_SIZE}-off.
    The latter doesn't make any sense, and could cause us to attempt negative
    length transfers...

    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
     
  • Notify the readahead logic of the missing page. Suggested by
    Oleg Nesterov.

    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
     

30 Apr, 2006

1 commit


27 Apr, 2006

2 commits


26 Apr, 2006

4 commits


20 Apr, 2006

1 commit


19 Apr, 2006

5 commits


11 Apr, 2006

8 commits


10 Apr, 2006

5 commits