[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9956d3c1-8464-ef70-a21a-7abaaa948fd2@redhat.com>
Date: Mon, 16 Nov 2020 12:19:17 +0800
From: Jason Wang <jasowang@...hat.com>
To: Stefano Garzarella <sgarzare@...hat.com>,
virtualization@...ts.linux-foundation.org
Cc: Stefan Hajnoczi <stefanha@...hat.com>,
Laurent Vivier <lvivier@...hat.com>,
linux-kernel@...r.kernel.org, Eli Cohen <elic@...dia.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Max Gurtovoy <mgurtovoy@...dia.com>
Subject: Re: [PATCH RFC 08/12] vdpa_sim: use kvmalloc to allocate
vdpasim->buffer
On 2020/11/13 下午9:47, Stefano Garzarella wrote:
> The next patch will make the buffer size configurable from each
> device.
> Since the buffer could be larger than a page, we use kvmalloc()
> instead of kmalloc().
>
> Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
Acked-by: Jason Wang <jasowang@...hat.com>
Thanks
> ---
> drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> index 9c29c2013661..bd034fbf4683 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -223,7 +223,7 @@ struct vdpasim *vdpasim_create(struct vdpasim_init_attr *attr)
> if (!vdpasim->iommu)
> goto err_iommu;
>
> - vdpasim->buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
> + vdpasim->buffer = kvmalloc(PAGE_SIZE, GFP_KERNEL);
> if (!vdpasim->buffer)
> goto err_iommu;
>
> @@ -495,7 +495,7 @@ static void vdpasim_free(struct vdpa_device *vdpa)
> struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
>
> cancel_work_sync(&vdpasim->work);
> - kfree(vdpasim->buffer);
> + kvfree(vdpasim->buffer);
> if (vdpasim->iommu)
> vhost_iotlb_free(vdpasim->iommu);
> kfree(vdpasim->vqs);
Powered by blists - more mailing lists