aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ocrdma/ocrdma_main.c
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2018-09-21 11:30:12 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-09-25 15:19:06 -0600
commit3312d1c6bdee6aa912c099c0ac0662d197c52842 (patch)
tree97a27e26c26602a973a30d6c964eb0c17319873a /drivers/infiniband/hw/ocrdma/ocrdma_main.c
parentiw_cxgb4: Use proper enumerated type in c4iw_bar2_addrs (diff)
downloadlinux-dev-3312d1c6bdee6aa912c099c0ac0662d197c52842.tar.xz
linux-dev-3312d1c6bdee6aa912c099c0ac0662d197c52842.zip
RDMA/umem: Minor optimizations
Noticed while reviewing commit d4b4dd1b9706 ("RDMA/umem: Do not use current->tgid to track the mm_struct") patch. Why would we take a lock, adjust a protected variable, drop the lock, and *then* check the input into our protected variable adjustment? Then we have to take the lock again on our error unwind. Let's just check the input early and skip taking the locks needlessly if the input isn't valid. It was also noticed that we set mm = current->mm, we then never modify mm, but we still go back and reference current->mm a number of times needlessly. Be consistent in using the stored reference in mm. Signed-off-by: Doug Ledford <dledford@redhat.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_main.c')
0 files changed, 0 insertions, 0 deletions