search for: err_nomem

Displaying 20 results from an estimated 55 matches for "err_nomem".

Did you mean: err_nomem1
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
..._KERNEL); + dev->vqs[i].log = kmalloc(sizeof *dev->vqs[i].log * UIO_MAXIOV, + GFP_KERNEL); + dev->vqs[i].heads = kmalloc(sizeof *dev->vqs[i].heads * + UIO_MAXIOV, GFP_KERNEL); + + if (!dev->vqs[i].indirect || !dev->vqs[i].log || + !dev->vqs[i].heads) + goto err_nomem; + } + return 0; +err_nomem: + for (; i >= 0; --i) { + kfree(dev->vqs[i].indirect); + kfree(dev->vqs[i].log); + kfree(dev->vqs[i].heads); + } + return -ENOMEM; +} + +static void vhost_dev_free_iovecs(struct vhost_dev *dev) +{ + int i; + for (i = 0; i < dev->nvqs; ++i) { + kfre...
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
..._KERNEL); + dev->vqs[i].log = kmalloc(sizeof *dev->vqs[i].log * UIO_MAXIOV, + GFP_KERNEL); + dev->vqs[i].heads = kmalloc(sizeof *dev->vqs[i].heads * + UIO_MAXIOV, GFP_KERNEL); + + if (!dev->vqs[i].indirect || !dev->vqs[i].log || + !dev->vqs[i].heads) + goto err_nomem; + } + return 0; +err_nomem: + for (; i >= 0; --i) { + kfree(dev->vqs[i].indirect); + kfree(dev->vqs[i].log); + kfree(dev->vqs[i].heads); + } + return -ENOMEM; +} + +static void vhost_dev_free_iovecs(struct vhost_dev *dev) +{ + int i; + for (i = 0; i < dev->nvqs; ++i) { + kfre...
2010 Aug 05
0
[PATCH RFC] vhost: max s/g to match qemu
...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[i].indirect || !dev->vqs[i].log) + goto err_nomem; + } + return 0; +err_nomem: + for (; i >= 0; --i) { + kfree(dev->vqs[i].indirect); + kfree(dev->vqs[i].log); + } + return -ENOMEM; +} + long vhost_dev_init(struct vhost_dev *dev, struct vhost_virtqueue *vqs, int nvqs) { - int i; + int i, ret; dev->vqs = vqs; dev->nvqs...
2010 Aug 05
0
[PATCH RFC] vhost: max s/g to match qemu
...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[i].indirect || !dev->vqs[i].log) + goto err_nomem; + } + return 0; +err_nomem: + for (; i >= 0; --i) { + kfree(dev->vqs[i].indirect); + kfree(dev->vqs[i].log); + } + return -ENOMEM; +} + long vhost_dev_init(struct vhost_dev *dev, struct vhost_virtqueue *vqs, int nvqs) { - int i; + int i, ret; dev->vqs = vqs; dev->nvqs...
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,
2011 Jul 18
1
[PATCHv11] vhost: vhost TX zero-copy support
...); + if (zcopy) + dev->vqs[i].ubuf_info = + kmalloc(sizeof *dev->vqs[i].ubuf_info * + UIO_MAXIOV, GFP_KERNEL); if (!dev->vqs[i].indirect || !dev->vqs[i].log || - !dev->vqs[i].heads) + !dev->vqs[i].heads || + (zcopy && !dev->vqs[i].ubuf_info)) goto err_nomem; } return 0; err_nomem: - for (; i >= 0; --i) { - kfree(dev->vqs[i].indirect); - kfree(dev->vqs[i].log); - kfree(dev->vqs[i].heads); - } + for (; i >= 0; --i) + vhost_vq_free_iovecs(&dev->vqs[i]); return -ENOMEM; } @@ -257,14 +282,8 @@ static void vhost_dev_fre...
2011 Jul 18
1
[PATCHv11] vhost: vhost TX zero-copy support
...); + if (zcopy) + dev->vqs[i].ubuf_info = + kmalloc(sizeof *dev->vqs[i].ubuf_info * + UIO_MAXIOV, GFP_KERNEL); if (!dev->vqs[i].indirect || !dev->vqs[i].log || - !dev->vqs[i].heads) + !dev->vqs[i].heads || + (zcopy && !dev->vqs[i].ubuf_info)) goto err_nomem; } return 0; err_nomem: - for (; i >= 0; --i) { - kfree(dev->vqs[i].indirect); - kfree(dev->vqs[i].log); - kfree(dev->vqs[i].heads); - } + for (; i >= 0; --i) + vhost_vq_free_iovecs(&dev->vqs[i]); return -ENOMEM; } @@ -257,14 +282,8 @@ static void vhost_dev_fre...
2014 May 13
0
[PATCH v1] vhost: avoid large order allocations
...vq->log = kmalloc(sizeof *vq->log * UIO_MAXIOV, GFP_KERNEL); > vq->heads = kmalloc(sizeof *vq->heads * UIO_MAXIOV, GFP_KERNEL); > - if (!vq->indirect || !vq->log || !vq->heads) > + if (!vq->iov || !vq->indirect || !vq->log || !vq->heads) > goto err_nomem; > } > return 0; > @@ -310,6 +313,7 @@ void vhost_dev_init(struct vhost_dev *dev, > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > vq->log = NULL; > + vq->iov = NULL; > vq->indirect = NULL; > vq->heads = NULL; > vq-&g...
2014 May 13
2
[PATCH v1] vhost: avoid large order allocations
...GFP_KERNEL); vq->log = kmalloc(sizeof *vq->log * UIO_MAXIOV, GFP_KERNEL); vq->heads = kmalloc(sizeof *vq->heads * UIO_MAXIOV, GFP_KERNEL); - if (!vq->indirect || !vq->log || !vq->heads) + if (!vq->iov || !vq->indirect || !vq->log || !vq->heads) goto err_nomem; } return 0; @@ -310,6 +313,7 @@ void vhost_dev_init(struct vhost_dev *dev, for (i = 0; i < dev->nvqs; ++i) { vq = dev->vqs[i]; vq->log = NULL; + vq->iov = NULL; vq->indirect = NULL; vq->heads = NULL; vq->dev = dev; diff --git a/drivers/vhost/vhost.h b/...
2013 Apr 27
2
[PATCH v6 0/2] tcm_vhost flush
Changes in v6: - Allow device specific fields per vq - Track cmd per vq - Do not track evt - Switch to static array for inflight allocation, completely get rid of the pain to handle inflight allocation failure. Asias He (2): vhost: Allow device specific fields per vq tcm_vhost: Wait for pending requests in vhost_scsi_flush() drivers/vhost/net.c | 60 +++++++++++--------
2013 Apr 27
2
[PATCH v6 0/2] tcm_vhost flush
Changes in v6: - Allow device specific fields per vq - Track cmd per vq - Do not track evt - Switch to static array for inflight allocation, completely get rid of the pain to handle inflight allocation failure. Asias He (2): vhost: Allow device specific fields per vq tcm_vhost: Wait for pending requests in vhost_scsi_flush() drivers/vhost/net.c | 60 +++++++++++--------
2017 Sep 22
0
[PATCH net-next RFC 5/5] vhost_net: basic tx virtqueue batched processing
...GFP_KERNEL); vq->log = kmalloc(sizeof *vq->log * UIO_MAXIOV, GFP_KERNEL); - vq->heads = kmalloc(sizeof *vq->heads * UIO_MAXIOV, GFP_KERNEL); + vq->heads = kzalloc(sizeof *vq->heads * UIO_MAXIOV, GFP_KERNEL); if (!vq->indirect || !vq->log || !vq->heads) goto err_nomem; } -- 2.7.4
2011 Jul 17
3
[PATCHv9] vhost: experimental tx zero-copy support
...i].heads = kmalloc(sizeof *dev->vqs[i].heads * UIO_MAXIOV, GFP_KERNEL); + dev->vqs[i].ubuf_info = kmalloc(sizeof *dev->vqs[i].ubuf_info * + UIO_MAXIOV, GFP_KERNEL); if (!dev->vqs[i].indirect || !dev->vqs[i].log || !dev->vqs[i].heads) @@ -249,6 +254,7 @@ err_nomem: kfree(dev->vqs[i].indirect); kfree(dev->vqs[i].log); kfree(dev->vqs[i].heads); + kfree(dev->vqs[i].ubuf_info); } return -ENOMEM; } @@ -390,6 +396,29 @@ long vhost_dev_reset_owner(struct vhost_dev *dev) return 0; } +/* In case of DMA done not in order in lower device...
2011 Jul 17
3
[PATCHv9] vhost: experimental tx zero-copy support
...i].heads = kmalloc(sizeof *dev->vqs[i].heads * UIO_MAXIOV, GFP_KERNEL); + dev->vqs[i].ubuf_info = kmalloc(sizeof *dev->vqs[i].ubuf_info * + UIO_MAXIOV, GFP_KERNEL); if (!dev->vqs[i].indirect || !dev->vqs[i].log || !dev->vqs[i].heads) @@ -249,6 +254,7 @@ err_nomem: kfree(dev->vqs[i].indirect); kfree(dev->vqs[i].log); kfree(dev->vqs[i].heads); + kfree(dev->vqs[i].ubuf_info); } return -ENOMEM; } @@ -390,6 +396,29 @@ long vhost_dev_reset_owner(struct vhost_dev *dev) return 0; } +/* In case of DMA done not in order in lower device...
2020 Jun 03
2
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...t_dev *dev) > GFP_KERNEL); > vq->heads = kmalloc_array(dev->iov_limit, sizeof(*vq->heads), > GFP_KERNEL); > - if (!vq->indirect || !vq->log || !vq->heads) > + if (!vq->indirect || !vq->log || !vq->heads || !vq->descs) > goto err_nomem; > } > return 0; > @@ -2277,6 +2285,293 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, > } > EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > > +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) > +{ > + BUG_ON(!vq->ndescs); > + return...
2020 Jun 03
2
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...t_dev *dev) > GFP_KERNEL); > vq->heads = kmalloc_array(dev->iov_limit, sizeof(*vq->heads), > GFP_KERNEL); > - if (!vq->indirect || !vq->log || !vq->heads) > + if (!vq->indirect || !vq->log || !vq->heads || !vq->descs) > goto err_nomem; > } > return 0; > @@ -2277,6 +2285,293 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, > } > EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > > +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) > +{ > + BUG_ON(!vq->ndescs); > + return...
2020 Jun 02
0
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...vhost_dev_alloc_iovecs(struct vhost_dev *dev) GFP_KERNEL); vq->heads = kmalloc_array(dev->iov_limit, sizeof(*vq->heads), GFP_KERNEL); - if (!vq->indirect || !vq->log || !vq->heads) + if (!vq->indirect || !vq->log || !vq->heads || !vq->descs) goto err_nomem; } return 0; @@ -2277,6 +2285,293 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, } EXPORT_SYMBOL_GPL(vhost_get_vq_desc); +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + return &vq->descs[vq->ndescs - 1]; +} + +static void...
2020 Apr 07
0
[PATCH v7 17/19] vhost: option to fetch descriptors through an independent struct
...vhost_dev_alloc_iovecs(struct vhost_dev *dev) GFP_KERNEL); vq->heads = kmalloc_array(dev->iov_limit, sizeof(*vq->heads), GFP_KERNEL); - if (!vq->indirect || !vq->log || !vq->heads) + if (!vq->indirect || !vq->log || !vq->heads || !vq->descs) goto err_nomem; } return 0; @@ -2277,6 +2285,293 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, } EXPORT_SYMBOL_GPL(vhost_get_vq_desc); +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + return &vq->descs[vq->ndescs - 1]; +} + +static void...
2020 Apr 07
0
[PATCH v8 17/19] vhost: option to fetch descriptors through an independent struct
...vhost_dev_alloc_iovecs(struct vhost_dev *dev) GFP_KERNEL); vq->heads = kmalloc_array(dev->iov_limit, sizeof(*vq->heads), GFP_KERNEL); - if (!vq->indirect || !vq->log || !vq->heads) + if (!vq->indirect || !vq->log || !vq->heads || !vq->descs) goto err_nomem; } return 0; @@ -2277,6 +2285,293 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, } EXPORT_SYMBOL_GPL(vhost_get_vq_desc); +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + return &vq->descs[vq->ndescs - 1]; +} + +static void...