• D. Wythe's avatar
    net/smc: llc_conf_mutex refactor, replace it with rw_semaphore · b5dd4d69
    D. Wythe authored
    llc_conf_mutex was used to protect links and link related configurations
    in the same link group, for example, add or delete links. However,
    in most cases, the protected critical area has only read semantics and
    with no write semantics at all, such as obtaining a usable link or an
    available rmb_desc.
    
    This patch do simply code refactoring, replace mutex with rw_semaphore,
    replace mutex_lock with down_write and replace mutex_unlock with
    up_write.
    
    Theoretically, this replacement is equivalent, but after this patch,
    we can distinguish lock granularity according to different semantics
    of critical areas.
    Signed-off-by: default avatarD. Wythe <alibuda@linux.alibaba.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b5dd4d69
smc_core.h 18.1 KB