linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Haakon Bugge <haakon.bugge@oracle.com>
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 11:27:13 +0300	[thread overview]
Message-ID: <YT8LYZvhYm/kT7Kb@unreal> (raw)
In-Reply-To: <ADF1D118-A29D-4B32-9D25-F3B1768C8924@oracle.com>

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()?
That GFP_ATOMIC existed before my patch while we are holding usdev_lock mutex.

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.

Thanks

  reply	other threads:[~2021-09-13  8:27 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 [this message]
2021-09-13 12:50     ` Haakon Bugge
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=YT8LYZvhYm/kT7Kb@unreal \
    --to=leon@kernel.org \
    --cc=benve@cisco.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dledford@redhat.com \
    --cc=haakon.bugge@oracle.com \
    --cc=jgg@nvidia.com \
    --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).