Displaying 20 results from an estimated 268 matches for "workqueue_struct".
2024 Feb 22
1
[PATCH] drm/nouveau: use dedicated wq for fence uevents work
...vers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 8a6d94c8b163..b43619a213a4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -261,6 +261,9 @@ struct nouveau_drm {
/* Workqueue used for channel schedulers. */
struct workqueue_struct *sched_wq;
+ /* Workqueue used to signal fences. */
+ struct workqueue_struct *fence_wq;
+
/* context for accelerated drm-internal operations */
struct nouveau_channel *cechan;
struct nouveau_channel *channel;
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/no...
2024 Feb 23
1
[PATCH] drm/nouveau: use dedicated wq for fence uevents work
....h
> > index 8a6d94c8b163..b43619a213a4 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_drv.h
> > +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
> > @@ -261,6 +261,9 @@ struct nouveau_drm {
> > /* Workqueue used for channel schedulers. */
> > struct workqueue_struct *sched_wq;
> >
> > + /* Workqueue used to signal fences. */
> > + struct workqueue_struct *fence_wq;
> > +
> > /* context for accelerated drm-internal operations */
> > struct nouveau_channel *cechan;
> > struct nouveau_c...
2024 Feb 02
3
[PATCH 1/2] drm/nouveau: don't fini scheduler if not initialized
...uveau/nouveau_sched.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sched.c
@@ -398,7 +398,7 @@ static const struct drm_sched_backend_ops nouveau_sched_ops = {
.free_job = nouveau_sched_free_job,
};
-int
+static int
nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm,
struct workqueue_struct *wq, u32 credit_limit)
{
@@ -453,7 +453,30 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm,
return ret;
}
-void
+int
+nouveau_sched_create(struct nouveau_sched **psched, struct nouveau_drm *drm,
+ struct workqueue_struct *wq, u32 credit_limit)
+{
+ struct nouv...
2018 Feb 11
0
[PATCH 1/5] workqueue: Allow retrieval of current task's work struct
...--git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 4a54ef96aff5..bc0cda180c8b 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -465,6 +465,7 @@ extern bool cancel_delayed_work_sync(struct delayed_work *dwork);
extern void workqueue_set_max_active(struct workqueue_struct *wq,
int max_active);
+extern struct work_struct *current_work(void);
extern bool current_is_workqueue_rescuer(void);
extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);
extern unsigned int work_busy(struct work_struct *work);
diff --git a/kernel/workqueue.c b/kernel...
2023 Mar 11
2
[PATCH 00/11] Use copy_process in vhost layer
On Fri, Mar 10, 2023 at 2:04?PM Mike Christie
<michael.christie at oracle.com> wrote:
>
> The following patches were made over Linus's tree and apply over next. They
> allow the vhost layer to use copy_process instead of using
> workqueue_structs to create worker threads for VM's devices.
Ok, all these patches looked fine to me from a quick scan - nothing
that I reacted to as objectionable, and several of them looked like
nice cleanups.
The only one I went "Why do you do it that way" for was in 10/11
(entirely internal to v...
2014 Nov 14
1
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
Hello, Michael, Petr.
On Wed, Nov 12, 2014 at 03:32:04PM +0200, Michael S. Tsirkin wrote:
> > + /* The workqueue servicing the balloon. */
> > + struct workqueue_struct *wq;
> > + struct work_struct wq_work;
>
> We could use system_freezable_wq instead.
> I do agree a dedicated wq is better since this can get blocked
> for a long time while allocating memory.
> However, please add a comment to this effect.
system_freezable_wq should be fine....
2014 Nov 14
1
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
Hello, Michael, Petr.
On Wed, Nov 12, 2014 at 03:32:04PM +0200, Michael S. Tsirkin wrote:
> > + /* The workqueue servicing the balloon. */
> > + struct workqueue_struct *wq;
> > + struct work_struct wq_work;
>
> We could use system_freezable_wq instead.
> I do agree a dedicated wq is better since this can get blocked
> for a long time while allocating memory.
> However, please add a comment to this effect.
system_freezable_wq should be fine....
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...@
#include <linux/scatterlist.h>
#include <linux/string_helpers.h>
#include <scsi/scsi_cmnd.h>
+#include <linux/idr.h>
#define PART_BITS 4
-static int major, index;
+static int major;
+static DEFINE_SPINLOCK(vd_index_lock);
+static DEFINE_IDA(vd_index_ida);
+
struct workqueue_struct *virtblk_wq;
struct virtio_blk
@@ -23,6 +27,7 @@ struct virtio_blk
/* The disk structure for the kernel. */
struct gendisk *disk;
+ u32 index;
/* Request tracking. */
struct list_head reqs;
@@ -343,12 +348,26 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
struct...
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...@
#include <linux/scatterlist.h>
#include <linux/string_helpers.h>
#include <scsi/scsi_cmnd.h>
+#include <linux/idr.h>
#define PART_BITS 4
-static int major, index;
+static int major;
+static DEFINE_SPINLOCK(vd_index_lock);
+static DEFINE_IDA(vd_index_ida);
+
struct workqueue_struct *virtblk_wq;
struct virtio_blk
@@ -23,6 +27,7 @@ struct virtio_blk
/* The disk structure for the kernel. */
struct gendisk *disk;
+ u32 index;
/* Request tracking. */
struct list_head reqs;
@@ -343,12 +348,26 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
struct...
2019 Nov 21
2
[PATCH net-next 4/6] vsock: add vsock_loopback transport
...ty in
> > virtio_transport_common.c? This doesn't have anything to do with virtio
> > :).
> >
>
> Completely agree, new transports could use it to handle the protocol without
> reimplementing things already done.
>
> > > +
> > > +static struct workqueue_struct *vsock_loopback_workqueue;
> > > +static struct vsock_loopback *the_vsock_loopback;
> >
> > the_vsock_loopback could be a static global variable (not a pointer) and
> > vsock_loopback_workqueue could also be included in the struct.
> >
> > The RCU pointer is...
2019 Nov 21
2
[PATCH net-next 4/6] vsock: add vsock_loopback transport
...ty in
> > virtio_transport_common.c? This doesn't have anything to do with virtio
> > :).
> >
>
> Completely agree, new transports could use it to handle the protocol without
> reimplementing things already done.
>
> > > +
> > > +static struct workqueue_struct *vsock_loopback_workqueue;
> > > +static struct vsock_loopback *the_vsock_loopback;
> >
> > the_vsock_loopback could be a static global variable (not a pointer) and
> > vsock_loopback_workqueue could also be included in the struct.
> >
> > The RCU pointer is...
2023 Mar 28
0
[PATCH v4 05/11] vduse: Support set_vq_affinity callback
...; struct work_struct kick;
> + int irq_effective_cpu;
> + struct cpumask irq_affinity;
> };
>
> struct vduse_dev;
> @@ -128,6 +132,7 @@ static struct class *vduse_class;
> static struct cdev vduse_ctrl_cdev;
> static struct cdev vduse_cdev;
> static struct workqueue_struct *vduse_irq_wq;
> +static struct workqueue_struct *vduse_irq_bound_wq;
>
> static u32 allowed_device_id[] = {
> VIRTIO_ID_BLOCK,
> @@ -708,6 +713,15 @@ static u32 vduse_vdpa_get_generation(struct vdpa_device *vdpa)
> return dev->generation;
> }
>
> +stat...
2019 Nov 21
2
[PATCH net-next 4/6] vsock: add vsock_loopback transport
...;linux/spinlock.h>
> +#include <linux/module.h>
> +#include <linux/list.h>
> +#include <linux/virtio_vsock.h>
Is it time to rename the generic functionality in
virtio_transport_common.c? This doesn't have anything to do with virtio
:).
> +
> +static struct workqueue_struct *vsock_loopback_workqueue;
> +static struct vsock_loopback *the_vsock_loopback;
the_vsock_loopback could be a static global variable (not a pointer) and
vsock_loopback_workqueue could also be included in the struct.
The RCU pointer is really a way to synchronize vsock_loopback_send_pkt()
and v...
2019 Nov 21
2
[PATCH net-next 4/6] vsock: add vsock_loopback transport
...;linux/spinlock.h>
> +#include <linux/module.h>
> +#include <linux/list.h>
> +#include <linux/virtio_vsock.h>
Is it time to rename the generic functionality in
virtio_transport_common.c? This doesn't have anything to do with virtio
:).
> +
> +static struct workqueue_struct *vsock_loopback_workqueue;
> +static struct vsock_loopback *the_vsock_loopback;
the_vsock_loopback could be a static global variable (not a pointer) and
vsock_loopback_workqueue could also be included in the struct.
The RCU pointer is really a way to synchronize vsock_loopback_send_pkt()
and v...
2023 Feb 15
1
[PATCH v3] vdpa/mlx5: should not activate virtq object when suspended
...ons(+), 1 deletion(-)
diff --git a/drivers/vdpa/mlx5/core/mlx5_vdpa.h b/drivers/vdpa/mlx5/core/mlx5_vdpa.h
index 058fbe2..25fc412 100644
--- a/drivers/vdpa/mlx5/core/mlx5_vdpa.h
+++ b/drivers/vdpa/mlx5/core/mlx5_vdpa.h
@@ -96,6 +96,7 @@ struct mlx5_vdpa_dev {
struct mlx5_control_vq cvq;
struct workqueue_struct *wq;
unsigned int group2asid[MLX5_VDPA_NUMVQ_GROUPS];
+ bool suspended;
};
int mlx5_vdpa_alloc_pd(struct mlx5_vdpa_dev *dev, u32 *pdn, u16 uid);
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index 3a6dbbc6..daac3ab 100644
--- a/drivers/vdpa/mlx5/net/mlx5_v...
2023 Feb 16
1
[PATCH v3] vdpa/mlx5: should not activate virtq object when suspended
...s/vdpa/mlx5/core/mlx5_vdpa.h b/drivers/vdpa/mlx5/core/mlx5_vdpa.h
> index 058fbe2..25fc412 100644
> --- a/drivers/vdpa/mlx5/core/mlx5_vdpa.h
> +++ b/drivers/vdpa/mlx5/core/mlx5_vdpa.h
> @@ -96,6 +96,7 @@ struct mlx5_vdpa_dev {
> struct mlx5_control_vq cvq;
> struct workqueue_struct *wq;
> unsigned int group2asid[MLX5_VDPA_NUMVQ_GROUPS];
> + bool suspended;
> };
>
> int mlx5_vdpa_alloc_pd(struct mlx5_vdpa_dev *dev, u32 *pdn, u16 uid);
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index 3a6dbbc6..daac...
2014 Jun 22
2
[PATCH v1 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...gt;
> #define PART_BITS 4
>
> +#define MAX_NUM_VQ 16
> +
> static int major;
> static DEFINE_IDA(vd_index_ida);
>
Does it work much worse if we just use as many queues as
hardware supports, allocating as much memory as necessary?
> @@ -24,8 +26,8 @@ static struct workqueue_struct *virtblk_wq;
> struct virtio_blk
> {
> struct virtio_device *vdev;
> - struct virtqueue *vq;
> - spinlock_t vq_lock;
> + struct virtqueue *vq[MAX_NUM_VQ];
> + spinlock_t vq_lock[MAX_NUM_VQ];
array of struct {
*vq;
spinlock_t lock;
}
would use more memory but would...
2014 Jun 22
2
[PATCH v1 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...gt;
> #define PART_BITS 4
>
> +#define MAX_NUM_VQ 16
> +
> static int major;
> static DEFINE_IDA(vd_index_ida);
>
Does it work much worse if we just use as many queues as
hardware supports, allocating as much memory as necessary?
> @@ -24,8 +26,8 @@ static struct workqueue_struct *virtblk_wq;
> struct virtio_blk
> {
> struct virtio_device *vdev;
> - struct virtqueue *vq;
> - spinlock_t vq_lock;
> + struct virtqueue *vq[MAX_NUM_VQ];
> + spinlock_t vq_lock[MAX_NUM_VQ];
array of struct {
*vq;
spinlock_t lock;
}
would use more memory but would...
2023 Feb 16
1
[PATCH v3] vdpa/mlx5: should not activate virtq object when suspended
....h b/drivers/vdpa/mlx5/core/mlx5_vdpa.h
>> index 058fbe2..25fc412 100644
>> --- a/drivers/vdpa/mlx5/core/mlx5_vdpa.h
>> +++ b/drivers/vdpa/mlx5/core/mlx5_vdpa.h
>> @@ -96,6 +96,7 @@ struct mlx5_vdpa_dev {
>> struct mlx5_control_vq cvq;
>> struct workqueue_struct *wq;
>> unsigned int group2asid[MLX5_VDPA_NUMVQ_GROUPS];
>> + bool suspended;
>> };
>>
>> int mlx5_vdpa_alloc_pd(struct mlx5_vdpa_dev *dev, u32 *pdn, u16 uid);
>> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet....
2014 Nov 12
3
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
..._device *vdev;
struct virtqueue *inflate_vq, *deflate_vq, *stats_vq;
- /* Where the ballooning thread waits for config to change. */
- wait_queue_head_t config_change;
-
- /* The thread servicing the balloon. */
- struct task_struct *thread;
+ /* The workqueue servicing the balloon. */
+ struct workqueue_struct *wq;
+ struct work_struct wq_work;
/* Waiting for host to ack the pages we released. */
wait_queue_head_t acked;
@@ -128,12 +125,13 @@ static void set_page_pfns(u32 pfns[], struct page *page)
static void fill_balloon(struct virtio_balloon *vb, size_t num)
{
struct balloon_dev_info *vb_dev...