• Andrew Morton's avatar
    [PATCH] turn i_shared_lock into a semaphore · d9be9136
    Andrew Morton authored
    i_shared_lock is held for a very long time during vmtruncate() and causes
    high scheduling latencies when truncating a file which is mmapped.  I've seen
    100 milliseconds.
    
    So turn it into a semaphore.  It nests inside mmap_sem.
    
    This change is also needed by the shared pagetable patch, which needs to
    unshare pte's on the vmtruncate path - lots of pagetable pages need to
    be allocated and they are using __GFP_WAIT.
    
    The patch also makes unmap_vma() static.
    d9be9136
mmap.c 33.5 KB