• Andrew Morton's avatar
    [PATCH] remove PF_SYNC · 577c516f
    Andrew Morton authored
    current->flags:PF_SYNC was a hack I added because I didn't want to
    change all ->writepage implementations.
    
    It's foul.  And it means that if someone happens to run direct page
    reclaim within the context of (say) sys_sync, the writepage invokations
    from the VM will be treated as "data integrity" operations, not "memory
    cleansing" operations, which would cause latency.
    
    So the patch removes PF_SYNC and adds an extra arg to a_ops->writepage.
     It is the `writeback_control' structure which contains the full context
    information about why writepage was called.
    
    The initial version of this patch just passed in a bare `int sync', but
    the XFS team need more info so they can perform writearound from within
    page reclaim.
    
    The patch also adds writeback_control.for_reclaim, so writepage
    implementations can inspect that to work out the call context rather
    than peeking at current->flags:PF_MEMALLOC.
    577c516f
itree.c 10.9 KB