aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2017-11-15 17:33:04 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-15 18:21:02 -0800
commit539a6fea7fdcade532bd3e77be2862a683f8f0c9 (patch)
treef3255c208ee4803cea857226b880a9838eccd2c8 /mm/swapfile.c
parentbdi: introduce BDI_CAP_SYNCHRONOUS_IO (diff)
downloadlinux-dev-539a6fea7fdcade532bd3e77be2862a683f8f0c9.tar.xz
linux-dev-539a6fea7fdcade532bd3e77be2862a683f8f0c9.zip
mm, swap: introduce SWP_SYNCHRONOUS_IO
If rw-page based fast storage is used for swap devices, we need to detect it to enhance swap IO operations. This patch is preparation for optimizing of swap-in operation with next patch. Link: http://lkml.kernel.org/r/1505886205-9671-4-git-send-email-minchan@kernel.org Signed-off-by: Minchan Kim <minchan@kernel.org> Cc: Hugh Dickins <hughd@google.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Ilya Dryomov <idryomov@gmail.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Huang Ying <ying.huang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index e47a21e64764..cb08fa65819f 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3169,6 +3169,9 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
if (bdi_cap_stable_pages_required(inode_to_bdi(inode)))
p->flags |= SWP_STABLE_WRITES;
+ if (bdi_cap_synchronous_io(inode_to_bdi(inode)))
+ p->flags |= SWP_SYNCHRONOUS_IO;
+
if (p->bdev && blk_queue_nonrot(bdev_get_queue(p->bdev))) {
int cpu;
unsigned long ci, nr_cluster;