linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haakon Bugge <haakon.bugge@oracle.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Christian Benvenuti <benve@cisco.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	OFED mailing list <linux-rdma@vger.kernel.org>,
	Nelson Escobar <neescoba@cisco.com>
Subject: Re: [PATCH rdma-rc] RDMA/usnic: Lock VF with mutex instead of spinlock
Date: Mon, 13 Sep 2021 12:50:58 +0000	[thread overview]
Message-ID: <AC729233-CCB2-4A90-A7B2-08E534C3B1F1@oracle.com> (raw)
In-Reply-To: <YT8LYZvhYm/kT7Kb@unreal>



> On 13 Sep 2021, at 10:27, Leon Romanovsky <leon@kernel.org> wrote:
> 
> On Mon, Sep 13, 2021 at 08:17:00AM +0000, Haakon Bugge wrote:
>> 
>> 
>>> On 13 Sep 2021, at 10:04, Leon Romanovsky <leon@kernel.org> wrote:
>>> 
>>> From: Leon Romanovsky <leonro@nvidia.com>
>>> 
>>> 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@oracle.com>


Thxs, Håkon


  reply	other threads:[~2021-09-13 12:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  8:04 Leon Romanovsky
2021-09-13  8:17 ` Haakon Bugge
2021-09-13  8:27   ` Leon Romanovsky
2021-09-13 12:50     ` Haakon Bugge [this message]
2021-09-23  5:34 ` Leon Romanovsky
2021-09-24 13:59 ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AC729233-CCB2-4A90-A7B2-08E534C3B1F1@oracle.com \
    --to=haakon.bugge@oracle.com \
    --cc=benve@cisco.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=neescoba@cisco.com \
    --subject='Re: [PATCH rdma-rc] RDMA/usnic: Lock VF with mutex instead of spinlock' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).