Skip to content
  • Wu Fengguang's avatar
    writeback: the kupdate expire timestamp should be a moving target · ba9aa839
    Wu Fengguang authored
    
    
    Dynamically compute the dirty expire timestamp at queue_io() time.
    
    writeback_control.older_than_this used to be determined at entrance to
    the kupdate writeback work. This _static_ timestamp may go stale if the
    kupdate work runs on and on. The flusher may then stuck with some old
    busy inodes, never considering newly expired inodes thereafter.
    
    This has two possible problems:
    
    - It is unfair for a large dirty inode to delay (for a long time) the
      writeback of small dirty inodes.
    
    - As time goes by, the large and busy dirty inode may contain only
      _freshly_ dirtied pages. Ignoring newly expired dirty inodes risks
      delaying the expired dirty pages to the end of LRU lists, triggering
      the evil pageout(). Nevertheless this patch merely addresses part
      of the problem.
    
    v2: keep policy changes inside wb_writeback() and keep the
    wbc.older_than_this visibility as suggested by Dave.
    
    CC: Dave Chinner <david@fromorbit.com>
    Acked-by: default avatarJan Kara <jack@suse.cz>
    Acked-by: default avatarMel Gorman <mel@csn.ul.ie>
    Signed-off-by: default avatarItaru Kitayama <kitayama@cl.bb4u.ne.jp>
    Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
    ba9aa839