search for: vhost_dev_alloc_iovecs

Displaying 20 results from an estimated 88 matches for "vhost_dev_alloc_iovecs".

2020 Jun 17
4
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
On 2020/6/11 ??7:34, Michael S. Tsirkin wrote: > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > kfree(vq->descs); > @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > vq->max_descs = dev->iov_limit; > + if (vhost_vq_num_batch_descs(vq) < 0) { > + return -EINVAL; > + } This check breaks vdpa which set iov_limit to zero. Consider io...
2020 Jun 17
4
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
On 2020/6/11 ??7:34, Michael S. Tsirkin wrote: > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > kfree(vq->descs); > @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > vq->max_descs = dev->iov_limit; > + if (vhost_vq_num_batch_descs(vq) < 0) { > + return -EINVAL; > + } This check breaks vdpa which set iov_limit to zero. Consider io...
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
...FS; goto err; } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c579dcc..a45270e 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -212,6 +212,45 @@ static int vhost_worker(void *data) } } +/* Helper to allocate iovec buffers for all vqs. */ +static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) +{ + int i; + for (i = 0; i < dev->nvqs; ++i) { + dev->vqs[i].indirect = kmalloc(sizeof *dev->vqs[i].indirect * + UIO_MAXIOV, GFP_KERNEL); + dev->vqs[i].log = kmalloc(sizeof *dev->vqs[i].log * UIO_MAXIOV, + GFP_KERNEL); + dev->vqs[i].h...
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
...FS; goto err; } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c579dcc..a45270e 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -212,6 +212,45 @@ static int vhost_worker(void *data) } } +/* Helper to allocate iovec buffers for all vqs. */ +static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) +{ + int i; + for (i = 0; i < dev->nvqs; ++i) { + dev->vqs[i].indirect = kmalloc(sizeof *dev->vqs[i].indirect * + UIO_MAXIOV, GFP_KERNEL); + dev->vqs[i].log = kmalloc(sizeof *dev->vqs[i].log * UIO_MAXIOV, + GFP_KERNEL); + dev->vqs[i].h...
2010 Aug 05
0
[PATCH RFC] vhost: max s/g to match qemu
...drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e519950..b21a5e5 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -123,10 +123,31 @@ static void vhost_vq_reset(struct vhost_dev *dev, vq->log_ctx = NULL; } +/* Helper to allocate iovec buffers for all vqs. */ +static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) +{ + int i; + for (i = 0; i < dev->nvqs; ++i) { + dev->vqs[i].indirect = kmalloc(GFP_KERNEL, UIO_MAXIOV * + sizeof *dev->vqs[i].indirect); + dev->vqs[i].log = kmalloc(GFP_KERNEL, UIO_MAXIOV * + sizeof *dev->vqs[i].log); + if (!dev->vqs...
2010 Aug 05
0
[PATCH RFC] vhost: max s/g to match qemu
...drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e519950..b21a5e5 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -123,10 +123,31 @@ static void vhost_vq_reset(struct vhost_dev *dev, vq->log_ctx = NULL; } +/* Helper to allocate iovec buffers for all vqs. */ +static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) +{ + int i; + for (i = 0; i < dev->nvqs; ++i) { + dev->vqs[i].indirect = kmalloc(GFP_KERNEL, UIO_MAXIOV * + sizeof *dev->vqs[i].indirect); + dev->vqs[i].log = kmalloc(GFP_KERNEL, UIO_MAXIOV * + sizeof *dev->vqs[i].log); + if (!dev->vqs...
2019 Oct 12
2
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...> > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > + kfree(vq->descs); > + vq->descs = NULL; > + vq->max_descs = 0; > kfree(vq->indirect); > vq->indirect = NULL; > kfree(vq->log); > @@ -385,6 +389,10 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > + vq->max_descs = dev->iov_limit; > + vq->descs = kmalloc_array(vq->max_descs, > + sizeof(*vq->descs), > + GFP_KERNEL); Is iov_limit too much her...
2019 Oct 12
2
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...> > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > + kfree(vq->descs); > + vq->descs = NULL; > + vq->max_descs = 0; > kfree(vq->indirect); > vq->indirect = NULL; > kfree(vq->log); > @@ -385,6 +389,10 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > + vq->max_descs = dev->iov_limit; > + vq->descs = kmalloc_array(vq->max_descs, > + sizeof(*vq->descs), > + GFP_KERNEL); Is iov_limit too much her...
2019 Oct 14
2
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...eue *vq) >>> { >>> + kfree(vq->descs); >>> + vq->descs = NULL; >>> + vq->max_descs = 0; >>> kfree(vq->indirect); >>> vq->indirect = NULL; >>> kfree(vq->log); >>> @@ -385,6 +389,10 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) >>> for (i = 0; i < dev->nvqs; ++i) { >>> vq = dev->vqs[i]; >>> + vq->max_descs = dev->iov_limit; >>> + vq->descs = kmalloc_array(vq->max_descs, >>> + sizeof(*vq->descs), >>> +...
2019 Oct 14
2
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...eue *vq) >>> { >>> + kfree(vq->descs); >>> + vq->descs = NULL; >>> + vq->max_descs = 0; >>> kfree(vq->indirect); >>> vq->indirect = NULL; >>> kfree(vq->log); >>> @@ -385,6 +389,10 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) >>> for (i = 0; i < dev->nvqs; ++i) { >>> vq = dev->vqs[i]; >>> + vq->max_descs = dev->iov_limit; >>> + vq->descs = kmalloc_array(vq->max_descs, >>> + sizeof(*vq->descs), >>> +...
2016 Aug 22
4
[PATCH] CodingStyle: add some more error handling guidelines
On Mon, Aug 22, 2016 at 08:16:17AM -0600, Jonathan Corbet wrote: > On Mon, 22 Aug 2016 16:57:46 +0300 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > commit commit ea04036032edda6f771c1381d03832d2ed0f6c31 ("CodingStyle: > > add some more error handling guidelines") suggests never naming goto > > labels after the goto location - that is
2016 Aug 22
4
[PATCH] CodingStyle: add some more error handling guidelines
On Mon, Aug 22, 2016 at 08:16:17AM -0600, Jonathan Corbet wrote: > On Mon, 22 Aug 2016 16:57:46 +0300 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > commit commit ea04036032edda6f771c1381d03832d2ed0f6c31 ("CodingStyle: > > add some more error handling guidelines") suggests never naming goto > > labels after the goto location - that is
2019 Oct 11
8
[PATCH RFC v1 0/2] vhost: ring format independence
So the idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while we are fetching multiple descriptors. And perhaps more importantly,
2019 Oct 11
8
[PATCH RFC v1 0/2] vhost: ring format independence
So the idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while we are fetching multiple descriptors. And perhaps more importantly,
2019 Oct 12
2
[PATCH RFC v1 2/2] vhost: batching fetches
...host/vhost.c > @@ -302,6 +302,7 @@ static void vhost_vq_reset(struct vhost_dev *dev, > { > vq->num = 1; > vq->ndescs = 0; > + vq->first_desc = 0; > vq->desc = NULL; > vq->avail = NULL; > vq->used = NULL; > @@ -390,6 +391,7 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > vq->max_descs = dev->iov_limit; > + vq->batch_descs = dev->iov_limit - UIO_MAXIOV; > vq->descs = kmalloc_array(vq->max_descs, > sizeof(*vq->descs...
2019 Oct 12
2
[PATCH RFC v1 2/2] vhost: batching fetches
...host/vhost.c > @@ -302,6 +302,7 @@ static void vhost_vq_reset(struct vhost_dev *dev, > { > vq->num = 1; > vq->ndescs = 0; > + vq->first_desc = 0; > vq->desc = NULL; > vq->avail = NULL; > vq->used = NULL; > @@ -390,6 +391,7 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > vq->max_descs = dev->iov_limit; > + vq->batch_descs = dev->iov_limit - UIO_MAXIOV; > vq->descs = kmalloc_array(vq->max_descs, > sizeof(*vq->descs...
2014 May 13
2
[PATCH v1] vhost: avoid large order allocations
A test case which generates memory pressure while performing guest administration fails with vhost triggering "page allocation failure" and guest not starting up. After some analysis we discovered the allocation order of vhost to be rensponsible for this behaviour. Thus we suggest patch 1/1 which dynamically allocates the required memory. Please see its description for details. Thanks,
2014 May 13
2
[PATCH v1] vhost: avoid large order allocations
A test case which generates memory pressure while performing guest administration fails with vhost triggering "page allocation failure" and guest not starting up. After some analysis we discovered the allocation order of vhost to be rensponsible for this behaviour. Thus we suggest patch 1/1 which dynamically allocates the required memory. Please see its description for details. Thanks,
2019 Oct 12
2
[PATCH RFC v2 0/2] vhost: ring format independence
This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while
2020 Jun 03
2
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...> > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > + kfree(vq->descs); > + vq->descs = NULL; > + vq->max_descs = 0; > kfree(vq->indirect); > vq->indirect = NULL; > kfree(vq->log); > @@ -384,6 +388,10 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > + vq->max_descs = dev->iov_limit; > + vq->descs = kmalloc_array(vq->max_descs, > + sizeof(*vq->descs), > + GFP_KERNEL); > vq->indirect =...