• Andrew Morton's avatar
    [PATCH] truncate/invalidate_inode_pages rewrite · 735a2573
    Andrew Morton authored
    Rewrite these functions to use gang lookup.
    
    - This probably has similar performance to the old code in the common case.
    
    - It will be vastly quicker than current code for the worst case
      (single-page truncate).
    
    - invalidate_inode_pages() has been changed.  It used to use
      page_count(page) as the "is it mapped into pagetables" heuristic.  It
      now uses the (page->pte.direct != 0) heuristic.
    
    - Removes the worst cause of scheduling latency in the kernel.
    
    - It's a big code cleanup.
    
    - invalidate_inode_pages() has been changed to take an address_space
      *, not an inode *.
    
    - the maximum hold times for mapping->page_lock are enormously reduced,
      making it quite feasible to turn this into an irq-safe lock.  Which, it
      seems, is a requirement for sane AIO<->direct-io integration, as well
      as possibly other AIO things.
    
    (Thanks Hugh for fixing a bug in this one as well).
    
    (Christoph added some stuff too)
    735a2573
truncate.c 5.38 KB