search for: task_comm_len

Displaying 20 results from an estimated 33 matches for "task_comm_len".

2017 Aug 31
0
[PATCH] drm: nouveau: replace magic constant for TASK_COMM_LEN
Client's name is task_comm + pid: use constant for clarity and prepare for changed TASK_COMM_LEN. Signed-off-by: Michał Mirosław <mirq-linux at rere.qmqm.pl> --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 15a13d09d431..28396d0b0864 100644 --...
2018 Oct 09
0
[PATCH] drm/nouveau: avoid client name truncation
If TASK_COMM_LEN is made bigger DRM client name will be truncated. Avoid that. Signed-off-by: Michał Mirosław <mirq-linux at rere.qmqm.pl> --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nou...
2023 Mar 11
1
[PATCH 03/11] kthread: Pass in the thread's name during creation
...ucture when caller killed by a fatal signal. */ >> done = xchg(&create->done, NULL); >> if (!done) { >> + kfree(create->full_name); >> kfree(create); >> kthread_exit(-EINTR); >> } >> >> + if (strlen(create->full_name) >= TASK_COMM_LEN) >> + self->full_name = create->full_name; >> + else >> + kfree(create->full_name); > > This is monir but wwiw, this looks suspicious when reading it without > more context. It took me a while to see that kthread->full_name is > intended to store the unt...
2011 Jun 21
13
VM disk I/O limit patch
...uct backend_info *); static void backend_changed(struct xenbus_watch *, const char **, unsigned int); +static void unregister_rate_watch(struct backend_info *be); static int blkback_name(blkif_t *blkif, char *buf) { @@ -59,8 +60,10 @@ static void update_blkif_status(blkif_t char name[TASK_COMM_LEN]; /* Not ready to connect? */ - if (!blkif->irq || !blkif->vbd.bdev) + if (!blkif->irq || !blkif->vbd.bdev){ + DPRINTK("Not ready to connect"); return; + } /* Already connected? */ if (blkif->be->dev->state == XenbusStateConnected) @@ -193,6 +196,8 @@ st...
2011 Jun 21
13
VM disk I/O limit patch
...uct backend_info *); static void backend_changed(struct xenbus_watch *, const char **, unsigned int); +static void unregister_rate_watch(struct backend_info *be); static int blkback_name(blkif_t *blkif, char *buf) { @@ -59,8 +60,10 @@ static void update_blkif_status(blkif_t char name[TASK_COMM_LEN]; /* Not ready to connect? */ - if (!blkif->irq || !blkif->vbd.bdev) + if (!blkif->irq || !blkif->vbd.bdev){ + DPRINTK("Not ready to connect"); return; + } /* Already connected? */ if (blkif->be->dev->state == XenbusStateConnected) @@ -193,6 +196,8 @@ st...
2023 May 31
1
[syzbot] [kvm?] [net?] [virt?] general protection fault in vhost_work_queue
...task_stop(worker->vtsk); - kfree(worker); + vhost_task_stop(vtsk); + WARN_ON(!llist_empty(&dev->worker.work_list)); + WRITE_ONCE(dev->worker.vtsk, NULL); } static int vhost_worker_create(struct vhost_dev *dev) { - struct vhost_worker *worker; struct vhost_task *vtsk; char name[TASK_COMM_LEN]; int ret; - worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); - if (!worker) - return -ENOMEM; - - dev->worker = worker; - worker->kcov_handle = kcov_common_handle(); - init_llist_head(&worker->work_list); + dev->worker.kcov_handle = kcov_common_handle(); + init_llist_hea...
2023 Jun 05
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
...rker); + WARN_ON(!llist_empty(&dev->worker.work_list)); + vhost_task_stop(dev->worker.vtsk); + dev->worker.kcov_handle = 0; + dev->worker.vtsk = NULL; } static int vhost_worker_create(struct vhost_dev *dev) { - struct vhost_worker *worker; struct vhost_task *vtsk; char name[TASK_COMM_LEN]; - int ret; - - worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); - if (!worker) - return -ENOMEM; - dev->worker = worker; - worker->kcov_handle = kcov_common_handle(); - init_llist_head(&worker->work_list); + init_llist_head(&dev->worker.work_list); snprintf(name, si...
2023 Jun 05
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
...rker); + WARN_ON(!llist_empty(&dev->worker.work_list)); + vhost_task_stop(dev->worker.vtsk); + dev->worker.kcov_handle = 0; + dev->worker.vtsk = NULL; } static int vhost_worker_create(struct vhost_dev *dev) { - struct vhost_worker *worker; struct vhost_task *vtsk; char name[TASK_COMM_LEN]; - int ret; - - worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); - if (!worker) - return -ENOMEM; - dev->worker = worker; - worker->kcov_handle = kcov_common_handle(); - init_llist_head(&worker->work_list); + init_llist_head(&dev->worker.work_list); snprintf(name, si...
2023 Jun 01
1
[syzbot] [kvm?] [net?] [virt?] general protection fault in vhost_work_queue
...vtsk, NULL); The patch LGTM, I just wonder if we should set dev->worker to zero here, but maybe we don't need to. Thanks, Stefano > } > > static int vhost_worker_create(struct vhost_dev *dev) > { >- struct vhost_worker *worker; > struct vhost_task *vtsk; > char name[TASK_COMM_LEN]; > int ret; > >- worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); >- if (!worker) >- return -ENOMEM; >- >- dev->worker = worker; >- worker->kcov_handle = kcov_common_handle(); >- init_llist_head(&worker->work_list); >+ dev->worker.kcov_handle =...
2012 Dec 05
2
[RFC PATCH] drm/nouveau: report channel owner in error messages
.../nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -539,10 +539,11 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv) struct pci_dev *pdev = dev->pdev; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_cli *cli; - char name[16]; + char name[32], tmpname[TASK_COMM_LEN]; int ret; - snprintf(name, sizeof(name), "%d", pid_nr(fpriv->pid)); + get_task_comm(tmpname, current); + snprintf(name, sizeof(name), "%s[%d]", tmpname, pid_nr(fpriv->pid)); ret = nouveau_cli_create(pdev, name, sizeof(*cli), (void **)&cli); if (ret)
2023 Jun 06
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
...>worker.work_list)); >+ vhost_task_stop(dev->worker.vtsk); >+ dev->worker.kcov_handle = 0; >+ dev->worker.vtsk = NULL; > } > > static int vhost_worker_create(struct vhost_dev *dev) > { >- struct vhost_worker *worker; > struct vhost_task *vtsk; > char name[TASK_COMM_LEN]; >- int ret; >- >- worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); >- if (!worker) >- return -ENOMEM; > >- dev->worker = worker; >- worker->kcov_handle = kcov_common_handle(); >- init_llist_head(&worker->work_list); >+ init_llist_head(&dev-&gt...
2023 Mar 28
1
[PATCH v6 11/11] vhost: allow userspace to create workers
...rker_xa, i, worker) { + xa_erase(&dev->worker_xa, worker->id); + vhost_worker_put(dev, worker); + } + xa_destroy(&dev->worker_xa); +} + static struct vhost_worker *vhost_worker_create(struct vhost_dev *dev) { struct vhost_worker *worker; struct vhost_task *vtsk; char name[TASK_COMM_LEN]; + int ret; + u32 id; worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); if (!worker) return NULL; - dev->worker = worker; worker->kcov_handle = kcov_common_handle(); init_llist_head(&worker->work_list); + /* + * We increase the refcount for the initial creation an...
2018 Sep 26
5
[PATCH 0/4] Improve virtio ID allocation
I noticed you were using IDRs where you could be using the more efficient IDAs, then while fixing that I noticed the lack of error handling, and I decided to follow that up with an efficiency improvement. There's probably a v2 of this to follow because I couldn't figure out how to properly handle one of the error cases ... see the comment embedded in one of the patches. Matthew Wilcox
2014 Feb 01
0
[RFC 02/16] drm/nouveau: basic support for platform devices
...if (ret) @@ -662,7 +684,6 @@ static int nouveau_pmops_thaw(struct device *dev) static int nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv) { - struct pci_dev *pdev = dev->pdev; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_cli *cli; char name[32], tmpname[TASK_COMM_LEN]; @@ -676,7 +697,9 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv) get_task_comm(tmpname, current); snprintf(name, sizeof(name), "%s[%d]", tmpname, pid_nr(fpriv->pid)); - ret = nouveau_cli_create(pdev, name, sizeof(*cli), (void **)&cli); + ret = nouveau_cl...
2023 Mar 28
12
[PATCH v6 00/11] vhost: multiple worker support
The following patches were built over linux-next which contains various vhost patches in mst's tree and the vhost_task patchset in Christian Brauner's tree: git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git kernel.user_worker branch: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/log/?h=kernel.user_worker The latter patchset handles the review comment
2017 Dec 28
3
[PATCH] drm/virtio: Add window server support
...flush_work(&vgdev->winsrv_txq.dequeue_work); flush_work(&vgdev->config_changed_work); vgdev->vdev->config->del_vqs(vgdev->vdev); @@ -274,25 +287,43 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file) uint32_t id; char dbgname[64], tmpname[TASK_COMM_LEN]; - /* can't create contexts without 3d renderer */ - if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(...
2017 Dec 28
3
[PATCH] drm/virtio: Add window server support
...flush_work(&vgdev->winsrv_txq.dequeue_work); flush_work(&vgdev->config_changed_work); vgdev->vdev->config->del_vqs(vgdev->vdev); @@ -274,25 +287,43 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file) uint32_t id; char dbgname[64], tmpname[TASK_COMM_LEN]; - /* can't create contexts without 3d renderer */ - if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(...
2018 Jan 26
0
[PATCH v3 1/2] drm/virtio: Add window server support
...flush_work(&vgdev->winsrv_txq.dequeue_work); flush_work(&vgdev->config_changed_work); vgdev->vdev->config->del_vqs(vgdev->vdev); @@ -274,25 +295,43 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file) uint32_t id; char dbgname[64], tmpname[TASK_COMM_LEN]; - /* can't create contexts without 3d renderer */ - if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(...
2018 Jan 26
3
[PATCH v3 0/2] drm/virtio: Add window server support
Hi, this work is based on the virtio_wl driver in the ChromeOS kernel by Zach Reizner, currently at: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-4.4/drivers/virtio/virtio_wl.c There's one feature missing currently, which is letting clients write directly to the host part of a resource, so the extra copy in TRANSFER_TO_HOST isn't needed. Have pushed the
2017 Dec 14
2
[PATCH] drm/virtio: Add window server support
...flush_work(&vgdev->winsrv_txq.dequeue_work); flush_work(&vgdev->config_changed_work); vgdev->vdev->config->del_vqs(vgdev->vdev); @@ -274,25 +287,43 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file) uint32_t id; char dbgname[64], tmpname[TASK_COMM_LEN]; - /* can't create contexts without 3d renderer */ - if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(...