On Fri, Nov 11, 2016 at 10:11:25PM -0700, Jens Axboe wrote: > From: Christoph Hellwig <hch@xxxxxx> > > This patch adds a small and simple fast patch for small direct I/O > requests on block devices that don't use AIO. Between the neat > bio_iov_iter_get_pages helper that avoids allocating a page array > for get_user_pages and the on-stack bio and biovec this avoid memory > allocations and atomic operations entirely in the direct I/O code > (lower levels might still do memory allocations and will usually > have at least some atomic operations, though). > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > Signed-off-by: Jens Axboe <axboe@xxxxxx> > --- > fs/block_dev.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 80 insertions(+) > [snip] > static ssize_t > blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter) > { > struct file *file = iocb->ki_filp; > struct inode *inode = bdev_file_inode(file); > + int nr_pages; > > + nr_pages = iov_iter_npages(iter, BIO_MAX_PAGES); > + if (!nr_pages) > + return 0; > + if (is_sync_kiocb(iocb) && nr_pages <= DIO_INLINE_BIO_VECS) > + return __blkdev_direct_IO_simple(iocb, iter, nr_pages); > return __blockdev_direct_IO(iocb, inode, I_BDEV(inode), iter, > blkdev_get_block, NULL, NULL, > DIO_SKIP_DIO_COUNT); __blockdev_direct_IO() does a few cache prefetches that we're now bypassing, do we want to do the same in __blkdev_direct_IO_simple()? That's the stuff added in 65dd2aa90aa1 ("dio: optimize cache misses in the submission path"). > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-block" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Omar -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html