• Andrew Morton's avatar
    [PATCH] reduced overheads in fget/fput · 6a414e64
    Andrew Morton authored
    From: Dipankar Sarma <dipankar@in.ibm.com>
    
    
    fget() shows up on profiles, especially on SMP.  Dipankar's patch
    special-cases the situation wherein there are no sharers of current->files.
    
    In this situation we know that no other process can close this file, so it
    is not necessary to increment the file's refcount.
    
    It's ugly as sin, but makes a substantial difference.
    
    The test is
    
    	dd if=/dev/zero of=foo bs=1 count=1M
    
    On 4CPU P3 xeon with 1MB L2 cache and 512MB ram:
    
    	kernel           sys time     std-dev
    	------------     --------     -------
    
    	UP - vanilla     2.104        0.028
    	UP - file        1.867        0.019
    
    	SMP - vanilla    2.976        0.023
    	SMP - file       2.719        0.026
    6a414e64
file_table.c 6.74 KB