• Waiman Long's avatar
    proc: change proc_subdir_lock to a rwlock · ecf1a3df
    Waiman Long authored
    The proc_subdir_lock spinlock is used to allow only one task to make
    change to the proc directory structure as well as looking up information
    in it.  However, the information lookup part can actually be entered by
    more than one task as the pde_get() and pde_put() reference count update
    calls in the critical sections are atomic increment and decrement
    respectively and so are safe with concurrent updates.
    
    The x86 architecture has already used qrwlock which is fair and other
    architectures like ARM are in the process of switching to qrwlock.  So
    unfairness shouldn't be a concern in that conversion.
    
    This patch changed the proc_subdir_lock to a rwlock in order to enable
    concurrent lookup. The following functions were modified to take a
    write lock:
     - proc_register()
     - remove_proc_entry()
     - remove_proc_subtree()
    
    The following functions were modified to take a read lock:
     - xlate_proc_name()
     - proc_lookup_de()
     - proc_readdir_de()
    
    A parallel /proc filesystem search...
    ecf1a3df
generic.c 13.9 KB