• D. Wythe's avatar
    net/smc: reduce unnecessary blocking in smcr_lgr_reg_rmbs() · 4da68744
    D. Wythe authored
    Unlike smc_buf_create() and smcr_buf_unuse(), smcr_lgr_reg_rmbs() is
    exclusive when assigned rmb_desc was not registered, although it can be
    executed in parallel when assigned rmb_desc was registered already
    and only performs read semtamics on it. Hence, we can not simply replace
    it with read semaphore.
    
    The idea here is that if the assigned rmb_desc was registered already,
    use read semaphore to protect the critical section, once the assigned
    rmb_desc was not registered, keep using keep write semaphore still
    to keep its exclusivity.
    
    Thanks to the reusable features of rmb_desc, which allows us to execute
    in parallel in most cases.
    Signed-off-by: default avatarD. Wythe <alibuda@linux.alibaba.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4da68744
af_smc.c 89 KB