Re: [PATCH rdma-rc] RDMA/usnic: Lock VF with mutex instead of spinlock

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

 




> On 13 Sep 2021, at 10:27, Leon Romanovsky <leon@xxxxxxxxxx> wrote:
> 
> On Mon, Sep 13, 2021 at 08:17:00AM +0000, Haakon Bugge wrote:
>> 
>> 
>>> On 13 Sep 2021, at 10:04, Leon Romanovsky <leon@xxxxxxxxxx> wrote:
>>> 
>>> From: Leon Romanovsky <leonro@xxxxxxxxxx>
>>> 
>>> Usnic VF doesn't need lock in atomic context to create QPs, so it is safe
>>> to use mutex instead of spinlock. Such change fixes the following smatch
>>> error.
>> 
>> s/GFP_ATOMIC/GFP_KERNEL/ in find_free_vf_and_create_qp_grp() as well?
> 
> Do you mean in usnic_uiom_get_dev_list()?

Sorry, my comments was v5.14.1 centric. For latest upstream, its alloc_res_chunk_list(), 

find_free_vf_and_create_qp_grp() 
   -> usnic_ib_qp_grp_create
      -> alloc_res_chunk_list()



> That GFP_ATOMIC existed before my patch while we are holding usdev_lock mutex.

True.

> Anyway, I prefer to touch that driver as less as possible.
> 
> The allocations can continue to be with GFP_ATOMIC while we use mutex.
> It is bad thing, but not a necessary to fix bug. We just wasting atomic
> memory and instruct kernel do not sleep while
> doing allocations.

I assume this driver is not very much maintained by Cisco, hence, I agree with your rationale above,

Reviewed-by: Håkon Bugge <haakon.bugge@xxxxxxxxxx>


Thxs, Håkon





[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