• Andrew Morton's avatar
    [PATCH] tmpfs: shmem_getpage reading holes · 2671b00a
    Andrew Morton authored
    Patch from Hugh Dickins
    
    Here I intended a patch to remove the unsatisfactory shmem_recalc_inode
    (which tries to work out when vmscan has freed undirtied hole pages,
    to relax its blocks-in-use limit; but can only do so per-inode when it
    needs to be per-super).  I had hoped to use the releasepage method, but
    it looks like it can't quite be bent to this task, the page might still
    be rebusied after release.  2.4-ac uses a removepage method dedicated to
    this, but I'm reluctant to ask for such a minor address_space_operation.
    
    So, leave shmem_recalc_inode as is, but avoid the issue as much as
    possible, by letting shmem_getpage use the empty_zero_page instead of
    allocating when a hole is read (but this cannot be done when it's being
    mapped, nowadays the nopage doesn't know if page will be copied or not).
    Whereupon shmem_getpage(,,,SGP_READ) can do partial trunc's holdpage.
    2671b00a
shmem.c 45.2 KB