public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat•com>
To: Alistair Popple <apopple@nvidia•com>
Cc: linux-mm@kvack•org, cgroups@vger•kernel.org,
	linux-kernel@vger•kernel.org, jgg@nvidia•com,
	jhubbard@nvidia•com, tjmercier@google•com, hannes@cmpxchg•org,
	surenb@google•com, mkoutny@suse•com, daniel@ffwll•ch,
	Jason Wang <jasowang@redhat•com>,
	kvm@vger•kernel.org, virtualization@lists•linux-foundation.org,
	netdev@vger•kernel.org
Subject: Re: [RFC PATCH 02/19] drivers/vhost: Convert to use vm_account
Date: Tue, 24 Jan 2023 00:55:06 -0500	[thread overview]
Message-ID: <20230124005356-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <97a17a6ab7e59be4287a2a94d43bb787300476b4.1674538665.git-series.apopple@nvidia.com>

On Tue, Jan 24, 2023 at 04:42:31PM +1100, Alistair Popple wrote:
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index ec32f78..a31dd53 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c

...

> @@ -780,6 +780,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
>  	u32 asid = iotlb_to_asid(iotlb);
>  	int r = 0;
>  
> +	if (!vdpa->use_va)
> +		if (vm_account_pinned(&dev->vm_account, PFN_DOWN(size)))
> +			return -ENOMEM;
> +
>  	r = vhost_iotlb_add_range_ctx(iotlb, iova, iova + size - 1,
>  				      pa, perm, opaque);
>  	if (r)

I suspect some error handling will have to be reworked then, no?

> -- 
> git-series 0.9.1


  reply	other threads:[~2023-01-24  5:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.f52b9eb2792bccb8a9ecd6bc95055705cfe2ae03.1674538665.git-series.apopple@nvidia.com>
2023-01-24  5:42 ` [RFC PATCH 01/19] mm: Introduce vm_account Alistair Popple
2023-01-24  6:29   ` Christoph Hellwig
2023-01-24 14:32   ` Jason Gunthorpe
2023-01-30 11:36     ` Alistair Popple
2023-01-31 14:00   ` David Hildenbrand
2023-01-24  5:42 ` [RFC PATCH 02/19] drivers/vhost: Convert to use vm_account Alistair Popple
2023-01-24  5:55   ` Michael S. Tsirkin [this message]
2023-01-30 10:43     ` Alistair Popple
2023-01-24 14:34   ` Jason Gunthorpe
2023-01-24  5:42 ` [RFC PATCH 10/19] net: skb: Switch to using vm_account Alistair Popple
2023-01-24 14:51   ` Jason Gunthorpe
2023-01-30 11:17     ` Alistair Popple
2023-02-06  4:36       ` Alistair Popple
2023-02-06 13:14         ` Jason Gunthorpe
2023-01-24  5:42 ` [RFC PATCH 11/19] xdp: convert to use vm_account Alistair Popple

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=20230124005356-mutt-send-email-mst@kernel.org \
    --to=mst@redhat$(echo .)com \
    --cc=apopple@nvidia$(echo .)com \
    --cc=cgroups@vger$(echo .)kernel.org \
    --cc=daniel@ffwll$(echo .)ch \
    --cc=hannes@cmpxchg$(echo .)org \
    --cc=jasowang@redhat$(echo .)com \
    --cc=jgg@nvidia$(echo .)com \
    --cc=jhubbard@nvidia$(echo .)com \
    --cc=kvm@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mm@kvack$(echo .)org \
    --cc=mkoutny@suse$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=surenb@google$(echo .)com \
    --cc=tjmercier@google$(echo .)com \
    --cc=virtualization@lists$(echo .)linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox