linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [PATCHSET v3 0/4] Submit ->readpages() IO as read-ahead
Date: Tue, 19 Jun 2018 16:56:40 -0700	[thread overview]
Message-ID: <20180619165640.0c36473a33e20ea6c0fda463@linux-foundation.org> (raw)
In-Reply-To: <1527691329-2371-1-git-send-email-axboe@kernel.dk>

On Wed, 30 May 2018 08:42:05 -0600 Jens Axboe <axboe@kernel.dk> wrote:

> The only caller of ->readpages() is from read-ahead, yet we don't
> submit IO flagged with REQ_RAHEAD. This means we don't see it in
> blktrace, for instance, which is a shame. We already make assumptions
> about ->readpages() just being for read-ahead in the mpage
> implementation, using readahead_gfp_mask(mapping) as out GFP mask of
> choice.
> 
> This small series fixes up mpage_readpages() to submit with
> REQ_RAHEAD, which takes care of file systems using mpage_readpages().
> The first patch is a prep patch, that makes do_mpage_readpage() take
> an argument structure.

Well gee.  That sounds like a total fluke and I don't see anything
which prevents future code from using readpages for something other
than readahead.

For example, f2fs_mpage_readpages().  Which, being f2fs, has decided to
copy-paste-modify mpage_readpages() and to then use it for
non-readahead purposes.  If that code ever gets its act together then
we have a problem.

A proper approach might be to add a new
address_space_operations.readahead which sets REQ_RAHEAD but after
doing all that, nothing would use address_space_operations.readpages,
which is a bit weird.

And what's happening with the individual ->readpage() calls which
read_pages() does?  Do they still not get REQ_RAHEAD treatment?


This is kinda dirty, but we could add a readahead flag to blk_plug, set
it in read_pages(), test it down in the block layer somewhere....
That's grubby, but at least it wouldn't increase sizeof(task_struct)?

  parent reply	other threads:[~2018-06-19 23:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 14:42 [PATCHSET v3 0/4] Submit ->readpages() IO as read-ahead Jens Axboe
2018-05-30 14:42 ` [PATCH 1/4] mpage: add argument structure for do_mpage_readpage() Jens Axboe
2018-05-30 14:42 ` [PATCH 2/4] mpage: mpage_readpages() should submit IO as read-ahead Jens Axboe
2018-05-30 14:42 ` [PATCH 3/4] btrfs: readpages() " Jens Axboe
2018-05-30 14:42 ` [PATCH 4/4] ext4: " Jens Axboe
2018-06-19 23:56 ` Andrew Morton [this message]
2018-06-20 14:07   ` [PATCHSET v3 0/4] Submit ->readpages() " Jens Axboe
2018-06-20 19:58     ` Andrew Morton
2018-06-20 20:15       ` Chris Mason
2018-06-20 22:28       ` Jens Axboe
2018-06-20 23:23         ` Andrew Morton
2018-06-20 23:33           ` Jens Axboe
2018-06-20 23:45             ` Andrew Morton
2018-06-21  0:06               ` Jens Axboe
2018-06-21 12:21         ` Christoph Hellwig
2018-06-21 13:52           ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180619165640.0c36473a33e20ea6c0fda463@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).