1. 10 7月, 2007 1 次提交
    • J
      splice: abstract out actor data · c66ab6fa
      Jens Axboe 提交于
      For direct splicing (or private splicing), the output may not be a file.
      So abstract out the handling into a specified actor function and put
      the data in the splice_desc structure earlier, so we can build on top
      of that.
      
      This is the first step in better splice handling for drivers, and also
      for implementing vmsplice _to_ user memory.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c66ab6fa
  2. 15 6月, 2007 3 次提交
  3. 08 6月, 2007 5 次提交
  4. 08 5月, 2007 2 次提交
    • J
      [PATCH] splice: always call into page_cache_readahead() · 86aa5ac5
      Jens Axboe 提交于
      Don't try to guess what the read-ahead logic will do, allow it
      to make its own decisions.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      86aa5ac5
    • F
      [PATCH] splice(): fix interaction with readahead · 9ae9d68c
      Fengguang Wu 提交于
      Eric Dumazet, thank you for disclosing this bug.
      
      Readahead logic somehow fails to populate the page range with data.
      It can be because
      
      1) the readahead routine is not always called in the following lines of
      
      fs/splice.c:
              if (!loff || nr_pages > 1)
                      page_cache_readahead(mapping, &in->f_ra, in, index, nr_pages);
      
      2) even called, page_cache_readahead() wont guarantee the pages are there.
      It wont submit readahead I/O for pages already in the radix tree, or when
      (ra_pages == 0), or after 256 cache hits.
      
      In your case, it should be because of the retried reads, which lead to
      excessive cache hits, and disables readahead at some time.
      
      And that _one_ failure of readahead blocks the whole read process.
      The application receives EAGAIN and retries the read, but
      __generic_file_splice_read() refuse to make progress:
      
      - in the previous invocation, it has allocated a blank page and inserted it
        into the radix tree, but never has the chance to start I/O for it: the test
        of SPLICE_F_NONBLOCK goes before that.
      
      - in the retried invocation, the readahead code will neither get out of the
        cache hit mode, nor will it submit I/O for an already existing page.
      
      Cc: Eric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      9ae9d68c
  5. 29 3月, 2007 1 次提交
  6. 27 3月, 2007 3 次提交
    • M
      Export __splice_from_pipe() · 40bee44e
      Mark Fasheh 提交于
      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: NMark Fasheh <mark.fasheh@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      40bee44e
    • N
      2/2 splice: dont readpage · 08c72591
      Nick Piggin 提交于
      Splice does not need to readpage to bring the page uptodate before writing
      to it, because prepare_write will take care of that for us.
      
      Splice is also wrong to SetPageUptodate before the page is actually uptodate.
      This results in the old uninitialised memory leak. This gets fixed as a
      matter of course when removing the readpage logic.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      08c72591
    • N
      1/2 splice: dont steal · 485ddb4b
      Nick Piggin 提交于
      Stealing pages with splice is problematic because we cannot just insert
      an uptodate page into the pagecache and hope the filesystem can take care
      of it later.
      
      We also cannot just ClearPageUptodate, then hope prepare_write does not
      write anything into the page, because I don't think prepare_write gives
      that guarantee.
      
      Remove support for SPLICE_F_MOVE for now. If we really want to bring it
      back, we might be able to do so with a the new filesystem buffered write
      aops APIs I'm working on. If we really don't want to bring it back, then
      we should decide that sooner rather than later, and remove the flag and
      all the stealing infrastructure before anybody starts using it.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      485ddb4b
  7. 14 12月, 2006 1 次提交
  8. 09 12月, 2006 1 次提交
  9. 05 11月, 2006 1 次提交
  10. 29 10月, 2006 1 次提交
  11. 20 10月, 2006 3 次提交
  12. 12 10月, 2006 1 次提交
  13. 01 10月, 2006 1 次提交
  14. 10 7月, 2006 1 次提交
    • J
      [PATCH] splice: fix problems with sys_tee() · aadd06e5
      Jens Axboe 提交于
      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: NJens Axboe <axboe@suse.de>
      aadd06e5
  15. 23 6月, 2006 1 次提交
  16. 04 5月, 2006 4 次提交
  17. 02 5月, 2006 8 次提交
    • J
      [PATCH] vmsplice: restrict stealing a little more · 330ab716
      Jens Axboe 提交于
      Apply the same rules as the anon pipe pages, only allow stealing
      if no one else is using the page.
      Signed-off-by: NJens Axboe <axboe@suse.de>
      330ab716
    • J
      [PATCH] splice: fix page LRU accounting · a893b99b
      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: NJens Axboe <axboe@suse.de>
      a893b99b
    • J
      [PATCH] vmsplice: fix badly placed end paranthesis · 7591489a
      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: NJens Axboe <axboe@suse.de>
      7591489a
    • J
      [PATCH] vmsplice: allow user to pass in gift pages · 7afa6fd0
      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: NJens Axboe <axboe@suse.de>
      7afa6fd0
    • J
      [PATCH] pipe: enable atomic copying of pipe data to/from user space · f6762b7a
      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: NJens Axboe <axboe@suse.de>
      f6762b7a
    • J
      [PATCH] splice: call handle_ra_miss() on failure to lookup page · e27dedd8
      Jens Axboe 提交于
      Notify the readahead logic of the missing page. Suggested by
      Oleg Nesterov.
      Signed-off-by: NJens Axboe <axboe@suse.de>
      e27dedd8
    • J
      [PATCH] pipe: introduce ->pin() buffer operation · f84d7519
      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: NJens Axboe <axboe@suse.de>
      f84d7519
    • J
      [PATCH] splice: fix bugs in pipe_to_file() · 0568b409
      Jens Axboe 提交于
      Found by Oleg Nesterov <oleg@tv-sign.ru>, 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: NJens Axboe <axboe@suse.de>
      0568b409
  18. 30 4月, 2006 1 次提交
  19. 27 4月, 2006 1 次提交