Performance oriented customized Linux kernel based on the mainline kernel.
Find a file
Martin Wilck 17d51b10d7 block: bio_iov_iter_get_pages: pin more pages for multi-segment IOs
bio_iov_iter_get_pages() currently only adds pages for the next non-zero
segment from the iov_iter to the bio. That's suboptimal for callers,
which typically try to pin as many pages as fit into the bio. This patch
converts the current bio_iov_iter_get_pages() into a static helper, and
introduces a new helper that allocates as many pages as

 1) fit into the bio,
 2) are present in the iov_iter,
 3) and can be pinned by MM.

Error is returned only if zero pages could be pinned. Because of 3), a
zero return value doesn't necessarily mean all pages have been pinned.
Callers that have to pin every page in the iov_iter must still call this
function in a loop (this is currently the case).

This change matters most for __blkdev_direct_IO_simple(), which calls
bio_iov_iter_get_pages() only once. If it obtains less pages than
requested, it returns a "short write" or "short read", and
__generic_file_write_iter() falls back to buffered writes, which may
lead to data corruption.

Fixes: 72ecad22d9 ("block: support a full bio worth of IO for simplified bdev direct-io")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-07-26 11:52:36 -06:00
arch Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-06-10 19:25:23 -07:00
block block: bio_iov_iter_get_pages: pin more pages for multi-segment IOs 2018-07-26 11:52:36 -06:00
certs
crypto
Documentation block: remov blk_queue_invalidate_tags 2018-06-15 08:13:35 -06:00
drivers Merge branch 'nvme-4.18' of git://git.infradead.org/nvme into for-linus 2018-07-26 11:48:44 -06:00
firmware
fs blkdev: __blkdev_direct_IO_simple: fix leak in error case 2018-07-26 11:52:33 -06:00
include blk-mq: export setting request completion state 2018-07-24 14:41:50 -06:00
init Merge branch 'core-rseq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-10 10:17:09 -07:00
ipc
kernel Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-06-10 19:25:23 -07:00
lib sg: remove ->sg_magic member 2018-06-29 08:48:06 -06:00
LICENSES
mm bdi: Fix another oops in wb_workfn() 2018-06-22 12:08:07 -06:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-06-10 19:25:23 -07:00
samples
scripts Staging/IIO patches for 4.18-rc1 2018-06-09 10:32:39 -07:00
security
sound
tools sg: remove ->sg_magic member 2018-06-29 08:48:06 -06:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS SCSI misc on 20180610 2018-06-10 13:01:12 -07:00
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.