search for: kvfree

Displaying 20 results from an estimated 174 matches for "kvfree".

Did you mean: kfree
2014 Jun 12
2
[PATCH] vhost-scsi: don't open-code kvfree
Now that we have kvfree, use it in vhost-scsi instead of the open-coded version. Cc: Nicholas Bellinger <nab at linux-iscsi.org> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- I have this queued for -rc2. Nicholas could you review ack pls? drivers/vhost/scsi.c | 12 ++---------- 1 file changed,...
2014 Jun 12
2
[PATCH] vhost-scsi: don't open-code kvfree
Now that we have kvfree, use it in vhost-scsi instead of the open-coded version. Cc: Nicholas Bellinger <nab at linux-iscsi.org> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- I have this queued for -rc2. Nicholas could you review ack pls? drivers/vhost/scsi.c | 12 ++---------- 1 file changed,...
2016 Aug 02
1
[PATCH -next] VSOCK: Use kvfree()
Use kvfree() instead of open-coding it. Signed-off-by: Wei Yongjun <weiyj.lk at gmail.com> --- drivers/vhost/vsock.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 028ca16..0ddf3a2 100644 --- a/drivers/vhost/vsock.c +++ b/dri...
2016 Aug 02
1
[PATCH -next] VSOCK: Use kvfree()
Use kvfree() instead of open-coding it. Signed-off-by: Wei Yongjun <weiyj.lk at gmail.com> --- drivers/vhost/vsock.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 028ca16..0ddf3a2 100644 --- a/drivers/vhost/vsock.c +++ b/dri...
2019 Jun 18
2
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...@@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, ret = -ENOENT; goto out_unused_fd; } - - qobj = gem_to_virtio_gpu_obj(gobj); - buflist[i].bo = &qobj->tbo; - - list_add(&buflist[i].head, &validate_list); + buflist[i] = gobj; } kvfree(bo_handles); bo_handles = NULL; } - ret = virtio_gpu_object_list_validate(&ticket, &validate_list); + ret = drm_gem_lock_reservations(buflist, exbuf->num_bo_handles, &ticket); if (ret) - goto out_free; + goto out_unused_fd; buf = memdup_user(u64_to_user_ptr(exbuf->c...
2019 Jun 18
2
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...@@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, ret = -ENOENT; goto out_unused_fd; } - - qobj = gem_to_virtio_gpu_obj(gobj); - buflist[i].bo = &qobj->tbo; - - list_add(&buflist[i].head, &validate_list); + buflist[i] = gobj; } kvfree(bo_handles); bo_handles = NULL; } - ret = virtio_gpu_object_list_validate(&ticket, &validate_list); + ret = drm_gem_lock_reservations(buflist, exbuf->num_bo_handles, &ticket); if (ret) - goto out_free; + goto out_unused_fd; buf = memdup_user(u64_to_user_ptr(exbuf->c...
2014 Jun 11
2
[PULL] vhost: infrastructure changes for 3.16
Hi Linus, Please pull the following. Please note this needs to be merged before merging target-pending PULL which Nicholas will be sending out shortly. Thanks! The following changes since commit 1860e379875dfe7271c649058aeddffe5afd9d0d: Linux 3.15 (2014-06-08 11:19:54 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus
2014 Jun 11
2
[PULL] vhost: infrastructure changes for 3.16
Hi Linus, Please pull the following. Please note this needs to be merged before merging target-pending PULL which Nicholas will be sending out shortly. Thanks! The following changes since commit 1860e379875dfe7271c649058aeddffe5afd9d0d: Linux 3.15 (2014-06-08 11:19:54 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus
2020 Jun 17
2
[PATCH v4 0/3] mm, treewide: Rename kzfree() to kfree_sensitive()
...ved outside of the critical > > section, but we have rbtrees or lists that get deleted under locks and > > restructuring the code to do eg. splice and free it outside of the lock > > is not always possible. > > Not just performance critical, but correctness critical. Since kvfree() > may allocate from the vmalloc allocator, I really think that kvfree() > should assert that it's !in_atomic(). Otherwise we can get into trouble > if we end up calling vfree() and have to take the mutex. FWIW __vfree already checks for atomic context and put the work into a deferr...
2020 Jun 17
2
[PATCH v4 0/3] mm, treewide: Rename kzfree() to kfree_sensitive()
...ved outside of the critical > > section, but we have rbtrees or lists that get deleted under locks and > > restructuring the code to do eg. splice and free it outside of the lock > > is not always possible. > > Not just performance critical, but correctness critical. Since kvfree() > may allocate from the vmalloc allocator, I really think that kvfree() > should assert that it's !in_atomic(). Otherwise we can get into trouble > if we end up calling vfree() and have to take the mutex. FWIW __vfree already checks for atomic context and put the work into a deferr...
2024 Mar 06
1
[PATCH v3] nouveau/dmem: handle kcalloc() allocation failure
...gt;> PAGE_SHIFT, npages); @@ -406,11 +406,11 @@ nouveau_dmem_evict_chunk(struct nouveau_dmem_chunk *chunk) migrate_device_pages(src_pfns, dst_pfns, npages); nouveau_dmem_fence_done(&fence); migrate_device_finalize(src_pfns, dst_pfns, npages); - kfree(src_pfns); - kfree(dst_pfns); + kvfree(src_pfns); + kvfree(dst_pfns); for (i = 0; i < npages; i++) dma_unmap_page(chunk->drm->dev->dev, dma_addrs[i], PAGE_SIZE, DMA_BIDIRECTIONAL); - kfree(dma_addrs); + kvfree(dma_addrs); } void -- 2.17.1
2018 Feb 27
4
[PATCH 4/5] drm/ttm: add ttm_sg_tt_init
...(ttm); > + pr_err("Failed allocating page table\n"); > + return -ENOMEM; > + } > + return 0; > +} > +EXPORT_SYMBOL(ttm_sg_tt_init); > + > void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma) > { > struct ttm_tt *ttm = &ttm_dma->ttm; > > - kvfree(ttm->pages); > + if (ttm->pages) > + kvfree(ttm->pages); > + else > + kvfree(ttm_dma->dma_address); > ttm->pages = NULL; > ttm_dma->dma_address = NULL; > } > diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h > index 9c78556b488e....
2019 Jun 28
2
[PATCH v5 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...j = gem_to_virtio_gpu_obj(gobj); - buflist[i].bo = &qobj->tbo; - - list_add(&buflist[i].head, &validate_list); + buflist = virtio_gpu_array_from_handles(drm_file, bo_handles, + exbuf->num_bo_handles); + if (!buflist) { + ret = -ENOENT; + goto out_unused_fd; } kvfree(bo_handles); bo_handles = NULL; } - ret = virtio_gpu_object_list_validate(&ticket, &validate_list); - if (ret) - goto out_free; + if (buflist) { + ret = drm_gem_lock_reservations(buflist->objs, buflist->nents, + &ticket); + if (ret) + goto out_unused_fd; + } b...
2019 Jun 28
2
[PATCH v5 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...j = gem_to_virtio_gpu_obj(gobj); - buflist[i].bo = &qobj->tbo; - - list_add(&buflist[i].head, &validate_list); + buflist = virtio_gpu_array_from_handles(drm_file, bo_handles, + exbuf->num_bo_handles); + if (!buflist) { + ret = -ENOENT; + goto out_unused_fd; } kvfree(bo_handles); bo_handles = NULL; } - ret = virtio_gpu_object_list_validate(&ticket, &validate_list); - if (ret) - goto out_free; + if (buflist) { + ret = drm_gem_lock_reservations(buflist->objs, buflist->nents, + &ticket); + if (ret) + goto out_unused_fd; + } b...
2019 Jun 20
2
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...j = gem_to_virtio_gpu_obj(gobj); - buflist[i].bo = &qobj->tbo; - - list_add(&buflist[i].head, &validate_list); + buflist = virtio_gpu_array_from_handles(drm_file, bo_handles, + exbuf->num_bo_handles); + if (!buflist) { + ret = -ENOENT; + goto out_unused_fd; } kvfree(bo_handles); bo_handles = NULL; } - ret = virtio_gpu_object_list_validate(&ticket, &validate_list); - if (ret) - goto out_free; + if (buflist) { + ret = drm_gem_lock_reservations(buflist->objs, buflist->nents, + &ticket); + if (ret) + goto out_unused_fd; + } b...
2019 Jun 20
2
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...j = gem_to_virtio_gpu_obj(gobj); - buflist[i].bo = &qobj->tbo; - - list_add(&buflist[i].head, &validate_list); + buflist = virtio_gpu_array_from_handles(drm_file, bo_handles, + exbuf->num_bo_handles); + if (!buflist) { + ret = -ENOENT; + goto out_unused_fd; } kvfree(bo_handles); bo_handles = NULL; } - ret = virtio_gpu_object_list_validate(&ticket, &validate_list); - if (ret) - goto out_free; + if (buflist) { + ret = drm_gem_lock_reservations(buflist->objs, buflist->nents, + &ticket); + if (ret) + goto out_unused_fd; + } b...
2016 Jan 18
2
[PATCH RFC] vhost: convert pre sorted vhost memory array to interval tree
...vhost_umem_clean(struct vhost_dev *dev) +{ + struct vhost_umem_node *node, *tmp; + struct vhost_umem *umem = dev->umem; + + list_for_each_entry_safe(node, tmp, &umem->umem_list, link) { + vhost_umem_interval_tree_remove(node, &umem->umem_tree); + list_del(&node->link); + kvfree(node); + } + kvfree(umem); +} + /* Caller should have device mutex if and only if locked is set */ void vhost_dev_cleanup(struct vhost_dev *dev, bool locked) { @@ -549,8 +576,8 @@ void vhost_dev_cleanup(struct vhost_dev *dev, bool locked) fput(dev->log_file); dev->log_file = NULL; /...
2016 Jan 18
2
[PATCH RFC] vhost: convert pre sorted vhost memory array to interval tree
...vhost_umem_clean(struct vhost_dev *dev) +{ + struct vhost_umem_node *node, *tmp; + struct vhost_umem *umem = dev->umem; + + list_for_each_entry_safe(node, tmp, &umem->umem_list, link) { + vhost_umem_interval_tree_remove(node, &umem->umem_tree); + list_del(&node->link); + kvfree(node); + } + kvfree(umem); +} + /* Caller should have device mutex if and only if locked is set */ void vhost_dev_cleanup(struct vhost_dev *dev, bool locked) { @@ -549,8 +576,8 @@ void vhost_dev_cleanup(struct vhost_dev *dev, bool locked) fput(dev->log_file); dev->log_file = NULL; /...
2014 Jun 12
0
[PULL] vhost: infrastructure changes for 3.16
...performance. Thanks Michael, I'm glad to see that this change made its way into mainline after all! Would you be willing to take the following on top? From: Romain Francoise <romain at orebokech.com> Date: Thu, 12 Jun 2014 10:26:40 +0200 Subject: [PATCH] vhost-net: don't open-code kvfree Commit 23cc5a991c ("vhost-net: extend device allocation to vmalloc") added another open-coded version of kvfree (which is available since v3.15-rc5), nuke it. Signed-off-by: Romain Francoise <romain at orebokech.com> --- drivers/vhost/net.c | 12 ++---------- 1 file changed, 2 in...
2016 Mar 25
0
[RFC PATCH V2 1/2] vhost: convert pre sorted vhost memory array to interval tree
...+static void vhost_umem_clean(struct vhost_umem *umem) +{ + struct vhost_umem_node *node, *tmp; + + if (!umem) + return; + + list_for_each_entry_safe(node, tmp, &umem->umem_list, link) { + vhost_umem_interval_tree_remove(node, &umem->umem_tree); + list_del(&node->link); + kvfree(node); + } + kvfree(umem); +} + /* Caller should have device mutex if and only if locked is set */ void vhost_dev_cleanup(struct vhost_dev *dev, bool locked) { @@ -549,8 +578,8 @@ void vhost_dev_cleanup(struct vhost_dev *dev, bool locked) fput(dev->log_file); dev->log_file = NULL; /...