• NeilBrown's avatar
    mm: improve cleanup when ->readpages doesn't process all pages · 9fd472af
    NeilBrown authored
    If ->readpages doesn't process all the pages, then it is best to act as
    though they weren't requested so that a subsequent readahead can try
    again.
    
    So:
    
      - remove any 'ahead' pages from the page cache so they can be loaded
        with ->readahead() rather then multiple ->read()s
    
      - update the file_ra_state to reflect the reads that were actually
        submitted.
    
    This allows ->readpages() to abort early due e.g.  to congestion, which
    will then allow us to remove the inode_read_congested() test from
    page_Cache_async_ra().
    
    Link: https://lkml.kernel.org/r/164549983736.9187.16755913785880819183.stgit@noble.brownSigned-off-by: default avatarNeilBrown <neilb@suse.de>
    Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
    Cc: Chao Yu <chao@kernel.org>
    Cc: Darrick J. Wong <djwong@kernel.org>
    Cc: Ilya Dryomov <idryomov@gmail.com>
    Cc: Jaegeuk Kim <jaegeuk@kernel.org>
    Cc: Jan Kara <jack@suse.cz>
    Cc: Jeff Layton <jlayton@kernel.org>
    Cc: Jens Axboe <axboe@kernel.dk>
    Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
    Cc: Miklos Szeredi <miklos@szeredi.hu>
    Cc: Paolo Valente <paolo.valente@linaro.org>
    Cc: Philipp Reisner <philipp.reisner@linbit.com>
    Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
    Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
    Cc: Wu Fengguang <fengguang.wu@intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    9fd472af
readahead.c 25 KB