Re: [PATCH 1/2] RDMA/umem: Minor optimizations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 21, 2018 at 11:30:12AM -0400, Doug Ledford wrote:
> Noticed while reviewing 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@xxxxxxxxxx>
> ---
>  drivers/infiniband/core/umem.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux