On 5/24/18 2:53 PM, Jens Axboe wrote: > On 5/24/18 2:47 PM, Theodore Y. Ts'o wrote: >> On Thu, May 24, 2018 at 10:02:54AM -0600, Jens Axboe wrote: >>> a_ops->readpages() is only ever used for read-ahead. Ensure that we >>> pass this information down to the block layer. >>> >>> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> >>> --- >>> fs/ext4/readpage.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c >>> index 9ffa6fad18db..92b28273b223 100644 >>> --- a/fs/ext4/readpage.c >>> +++ b/fs/ext4/readpage.c >>> @@ -259,7 +259,7 @@ int ext4_mpage_readpages(struct address_space *mapping, >>> bio->bi_iter.bi_sector = blocks[0] << (blkbits - 9); >>> bio->bi_end_io = mpage_end_io; >>> bio->bi_private = ctx; >>> - bio_set_op_attrs(bio, REQ_OP_READ, 0); >>> + bio_set_op_attrs(bio, REQ_OP_READ, REQ_RAHEAD); >>> } >> >> The problem is that ext4_readpage() also calls ext4_mpage_readpages(). >> So you can't set REQ_RAHEAD unconditionally here. > > Oh shoot, yeah I did miss that. I'll update it, thanks Ted. Updated version: http://git.kernel.dk/cgit/linux-block/commit/?h=readpages-ahead&id=288b12ed3180530fac7d6598afd3449ec9cdfdb8 -- Jens Axboe