OSDN Git Service

UPSTREAM: mm: don't cap request size based on read-ahead setting
authorJens Axboe <axboe@fb.com>
Tue, 13 Dec 2016 00:43:26 +0000 (16:43 -0800)
committerAlistair Strachan <astrachan@google.com>
Wed, 23 Jan 2019 21:46:19 +0000 (21:46 +0000)
commite7c8b35e486775af65636a2a2b2766c3def9a8e8
treea3ab7ed7a2c106aff08ec23df5c541d9900fd05c
parent24189101975d0efe8d75557f47f1406faa4dffaa
UPSTREAM: mm: don't cap request size based on read-ahead setting

We ran into a funky issue, where someone doing 256K buffered reads saw
128K requests at the device level.  Turns out it is read-ahead capping
the request size, since we use 128K as the default setting.  This
doesn't make a lot of sense - if someone is issuing 256K reads, they
should see 256K reads, regardless of the read-ahead setting, if the
underlying device can support a 256K read in a single command.

This patch introduces a bdi hint, io_pages.  This is the soft max IO
size for the lower level, I've hooked it up to the bdev settings here.
Read-ahead is modified to issue the maximum of the user request size,
and the read-ahead max size, but capped to the max request size on the
device side.  The latter is done to avoid reading ahead too much, if the
application asks for a huge read.  With this patch, the kernel behaves
like the application expects.

Change-Id: Ibe52ffac7a6e1ac86ed0c6a59a0f7a32d651ee5f
Link: http://lkml.kernel.org/r/1479498073-8657-1-git-send-email-axboe@fb.com
Signed-off-by: Jens Axboe <axboe@fb.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
block/blk-settings.c
block/blk-sysfs.c
include/linux/backing-dev-defs.h
mm/readahead.c