aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-05-01 14:02:05 -0400
committerJens Axboe <axboe@suse.de>2006-05-01 14:02:05 -0400
commitf6762b7ad8edd6abc802542ce845d3bc8adcb92f (patch)
treec941aaf7295f8efecaf42aa86112649b9b6f23a9 /fs/splice.c
parente27dedd84c119e2f7af54fcde3293be5ad812103 (diff)
[PATCH] pipe: enable atomic copying of pipe data to/from user space
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 <axboe@suse.de>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 0a6916423e7d..d4664a297bab 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -640,13 +640,13 @@ find_page:
640 /* 640 /*
641 * Careful, ->map() uses KM_USER0! 641 * Careful, ->map() uses KM_USER0!
642 */ 642 */
643 char *src = buf->ops->map(info, buf); 643 char *src = buf->ops->map(info, buf, 1);
644 char *dst = kmap_atomic(page, KM_USER1); 644 char *dst = kmap_atomic(page, KM_USER1);
645 645
646 memcpy(dst + offset, src + buf->offset, this_len); 646 memcpy(dst + offset, src + buf->offset, this_len);
647 flush_dcache_page(page); 647 flush_dcache_page(page);
648 kunmap_atomic(dst, KM_USER1); 648 kunmap_atomic(dst, KM_USER1);
649 buf->ops->unmap(info, buf); 649 buf->ops->unmap(info, buf, src);
650 } 650 }
651 651
652 ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len); 652 ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len);