Displaying 20 results from an estimated 21 matches for "dispatch_work".
2023 May 31
1
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
..._fs.c b/fs/fuse/virtio_fs.c
index 4d8d4f16c727..a676297db09b 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -45,7 +45,7 @@ struct virtio_fs_vq {
struct work_struct done_work;
struct list_head queued_reqs;
struct list_head end_reqs; /* End these requests */
- struct delayed_work dispatch_work;
+ struct work_struct dispatch_work;
struct fuse_dev *fud;
bool connected;
long in_flight;
@@ -202,7 +202,7 @@ static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq)
}
flush_work(&fsvq->done_work);
- flush_delayed_work(&fsvq->dispatch_work);
+ flush_work(&fsvq-&g...
2023 Jul 03
2
[PATCH V4] virtio-fs: Improved request latencies when Virtio queue is full
..._fs.c b/fs/fuse/virtio_fs.c
index 4d8d4f16c727..a676297db09b 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -45,7 +45,7 @@ struct virtio_fs_vq {
struct work_struct done_work;
struct list_head queued_reqs;
struct list_head end_reqs; /* End these requests */
- struct delayed_work dispatch_work;
+ struct work_struct dispatch_work;
struct fuse_dev *fud;
bool connected;
long in_flight;
@@ -202,7 +202,7 @@ static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq)
}
flush_work(&fsvq->done_work);
- flush_delayed_work(&fsvq->dispatch_work);
+ flush_work(&fsvq-&g...
2023 Jun 01
2
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
...++ b/fs/fuse/virtio_fs.c
> > >> @@ -45,7 +45,7 @@ struct virtio_fs_vq {
> > >> struct work_struct done_work;
> > >> struct list_head queued_reqs;
> > >> struct list_head end_reqs; /* End these requests */
> > >> - struct delayed_work dispatch_work;
> > >> + struct work_struct dispatch_work;
> > >> struct fuse_dev *fud;
> > >> bool connected;
> > >> long in_flight;
> > >> @@ -202,7 +202,7 @@ static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq)
> > >> }
>...
2023 May 31
1
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
...rtio_fs.c
> >> +++ b/fs/fuse/virtio_fs.c
> >> @@ -45,7 +45,7 @@ struct virtio_fs_vq {
> >> struct work_struct done_work;
> >> struct list_head queued_reqs;
> >> struct list_head end_reqs; /* End these requests */
> >> - struct delayed_work dispatch_work;
> >> + struct work_struct dispatch_work;
> >> struct fuse_dev *fud;
> >> bool connected;
> >> long in_flight;
> >> @@ -202,7 +202,7 @@ static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq)
> >> }
> >>
> >> f...
2023 Jun 01
1
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
...se/virtio_fs.c
>>>>> @@ -45,7 +45,7 @@ struct virtio_fs_vq {
>>>>> struct work_struct done_work;
>>>>> struct list_head queued_reqs;
>>>>> struct list_head end_reqs; /* End these requests */
>>>>> - struct delayed_work dispatch_work;
>>>>> + struct work_struct dispatch_work;
>>>>> struct fuse_dev *fud;
>>>>> bool connected;
>>>>> long in_flight;
>>>>> @@ -202,7 +202,7 @@ static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq)
>>>>...
2023 May 22
1
[PATCH] virtio-fs: Improved request latencies when Virtio queue is full
...--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -347,6 +347,8 @@ static void virtio_fs_hiprio_done_work(struct work_struct *work)
}
} while (!virtqueue_enable_cb(vq) && likely(!virtqueue_is_broken(vq)));
spin_unlock(&fsvq->lock);
+
+ schedule_delayed_work(&fsvq->dispatch_work, 0);
}
static void virtio_fs_request_dispatch_work(struct work_struct *work)
@@ -388,8 +390,6 @@ static void virtio_fs_request_dispatch_work(struct work_struct *work)
if (ret == -ENOMEM || ret == -ENOSPC) {
spin_lock(&fsvq->lock);
list_add_tail(&req->list, &fsvq-...
2019 Oct 15
7
[PATCH 0/5] virtiofs: Fix couple of deadlocks
Hi,
We have couple of places which can result in deadlock. This patch series
fixes these.
We can be called with fc->bg_lock (for background requests) while
submitting a request. This leads to two constraints.
- We can't end requests in submitter's context and call fuse_end_request()
as it tries to take fc->bg_lock as well. So queue these requests on a
list and use a worker to
2019 Oct 30
0
[PATCH 1/3] virtiofs: Use a common function to send forget
...150 +++++++++++++++++++-------------------------
1 file changed, 63 insertions(+), 87 deletions(-)
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index a5c86048b96e..6cc7be170cb8 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -313,17 +313,71 @@ static void virtio_fs_request_dispatch_work(struct work_struct *work)
}
}
+/*
+ * Returns 1 if queue is full and sender should wait a bit before sending
+ * next request, 0 otherwise.
+ */
+static int send_forget_request(struct virtio_fs_vq *fsvq,
+ struct virtio_fs_forget *forget,
+ bool in_flight)
+{
+ struct scatter...
2019 Sep 06
1
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...* Per-virtqueue state */
> > > +struct virtio_fs_vq {
> > > + spinlock_t lock;
> > > + struct virtqueue *vq; /* protected by ->lock */
> > > + struct work_struct done_work;
> > > + struct list_head queued_reqs;
> > > + struct delayed_work dispatch_work;
> > > + struct fuse_dev *fud;
> > > + bool connected;
> > > + long in_flight;
> > > + char name[24];
> >
> > I'd keep names somewhere separate as they are not used on data path.
>
> Ok, this sounds like a nice to have. Will take care of t...
2019 Oct 30
6
[PATCH 0/3] virtiofs: Small Cleanups for 5.5
Hi Miklos,
Here are few small cleanups for virtiofs for 5.5. I had received some
comments from Michael Tsirkin on original virtiofs patches and these
cleanups are result of these comments.
Thanks
Vivek
Vivek Goyal (3):
virtiofs: Use a common function to send forget
virtiofs: Do not send forget request "struct list_head" element
virtiofs: Use completions while waiting for queue
2019 Oct 21
0
[PATCH 1/5] virtiofs: Do not end request in submission context
On Mon, Oct 21, 2019 at 10:03:39AM +0200, Miklos Szeredi wrote:
[..]
> > static void virtio_fs_hiprio_dispatch_work(struct work_struct *work)
> > @@ -502,6 +522,7 @@ static int virtio_fs_setup_vqs(struct virtio_device *vdev,
> > names[VQ_HIPRIO] = fs->vqs[VQ_HIPRIO].name;
> > INIT_WORK(&fs->vqs[VQ_HIPRIO].done_work, virtio_fs_hiprio_done_work);
> > INIT_L...
2019 Sep 03
4
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...> + VQ_HIPRIO,
> + VQ_REQUEST
> +};
> +
> +/* Per-virtqueue state */
> +struct virtio_fs_vq {
> + spinlock_t lock;
> + struct virtqueue *vq; /* protected by ->lock */
> + struct work_struct done_work;
> + struct list_head queued_reqs;
> + struct delayed_work dispatch_work;
> + struct fuse_dev *fud;
> + bool connected;
> + long in_flight;
> + char name[24];
I'd keep names somewhere separate as they are not used on data path.
> +} ____cacheline_aligned_in_smp;
> +
> +/* A virtio-fs device instance */
> +struct virtio_fs {
> + struct li...
2019 Sep 03
4
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...> + VQ_HIPRIO,
> + VQ_REQUEST
> +};
> +
> +/* Per-virtqueue state */
> +struct virtio_fs_vq {
> + spinlock_t lock;
> + struct virtqueue *vq; /* protected by ->lock */
> + struct work_struct done_work;
> + struct list_head queued_reqs;
> + struct delayed_work dispatch_work;
> + struct fuse_dev *fud;
> + bool connected;
> + long in_flight;
> + char name[24];
I'd keep names somewhere separate as they are not used on data path.
> +} ____cacheline_aligned_in_smp;
> +
> +/* A virtio-fs device instance */
> +struct virtio_fs {
> + struct li...
2019 Sep 05
0
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...od of time.
[..]
> > +/* Per-virtqueue state */
> > +struct virtio_fs_vq {
> > + spinlock_t lock;
> > + struct virtqueue *vq; /* protected by ->lock */
> > + struct work_struct done_work;
> > + struct list_head queued_reqs;
> > + struct delayed_work dispatch_work;
> > + struct fuse_dev *fud;
> > + bool connected;
> > + long in_flight;
> > + char name[24];
>
> I'd keep names somewhere separate as they are not used on data path.
Ok, this sounds like a nice to have. Will take care of this once base
patch gets merged.
[..]
&...
2019 Oct 30
0
[PATCH 3/3] virtiofs: Use completions while waiting for queue to be drained
...ero);
+ spin_unlock(&fsvq->lock);
+ wait_for_completion(&fsvq->in_flight_zero);
+ } else {
spin_unlock(&fsvq->lock);
- /* TODO use completion instead of timeout */
- usleep_range(1000, 2000);
}
flush_work(&fsvq->done_work);
flush_delayed_work(&fsvq->dispatch_work);
}
-static void virtio_fs_drain_all_queues(struct virtio_fs *fs)
+static void virtio_fs_drain_all_queues_locked(struct virtio_fs *fs)
{
struct virtio_fs_vq *fsvq;
int i;
@@ -141,6 +145,19 @@ static void virtio_fs_drain_all_queues(struct virtio_fs *fs)
}
}
+static void virtio_fs_drain_...
2019 Oct 15
0
[PATCH 4/5] virtiofs: Count pending forgets as in_flight forgets
...->in_flight <= 0);
+ fsvq->in_flight--;
+}
+
static void release_virtio_fs_obj(struct kref *ref)
{
struct virtio_fs *vfs = container_of(ref, struct virtio_fs, refcount);
@@ -110,22 +123,6 @@ static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq)
flush_delayed_work(&fsvq->dispatch_work);
}
-static inline void drain_hiprio_queued_reqs(struct virtio_fs_vq *fsvq)
-{
- struct virtio_fs_forget *forget;
-
- spin_lock(&fsvq->lock);
- while (1) {
- forget = list_first_entry_or_null(&fsvq->queued_reqs,
- struct virtio_fs_forget, list);
- if (!forget)
- break;
-...
2019 Sep 18
0
[PATCH v6] virtio-fs: add virtiofs filesystem
...> + VQ_HIPRIO,
> + VQ_REQUEST
> +};
> +
> +/* Per-virtqueue state */
> +struct virtio_fs_vq {
> + spinlock_t lock;
> + struct virtqueue *vq; /* protected by ->lock */
> + struct work_struct done_work;
> + struct list_head queued_reqs;
> + struct delayed_work dispatch_work;
> + struct fuse_dev *fud;
> + bool connected;
> + long in_flight;
> + char name[24];
> +} ____cacheline_aligned_in_smp;
> +
> +/* A virtio-fs device instance */
> +struct virtio_fs {
> + struct kref refcount;
> + struct list_head list; /* on virtio_fs_instances */...
2019 Sep 05
0
[PATCH 08/18] virtiofs: Drain all pending requests during ->remove time
...t requests to finish.*/
+ while (1) {
+ spin_lock(&fsvq->lock);
+ if (!fsvq->in_flight) {
+ spin_unlock(&fsvq->lock);
+ break;
+ }
+ spin_unlock(&fsvq->lock);
+ usleep_range(1000, 2000);
+ }
+
+ flush_work(&fsvq->done_work);
+ flush_delayed_work(&fsvq->dispatch_work);
+}
+
+static inline void drain_hiprio_queued_reqs(struct virtio_fs_vq *fsvq)
+{
+ struct virtio_fs_forget *forget;
+
+ spin_lock(&fsvq->lock);
+ while (1) {
+ forget = list_first_entry_or_null(&fsvq->queued_reqs,
+ struct virtio_fs_forget, list);
+ if (!forget)
+ break;
+...
2019 Sep 05
0
[PATCH 11/18] virtiofs: stop and drain queues after sending DESTROY
...fs/fuse/virtio_fs.c
index 1ea0f889e804..a76bd5a04521 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -180,9 +180,6 @@ static void virtio_fs_free_devs(struct virtio_fs *fs)
if (!fsvq->fud)
continue;
- flush_work(&fsvq->done_work);
- flush_delayed_work(&fsvq->dispatch_work);
-
/* TODO need to quiesce/end_requests/decrement dev_count */
fuse_dev_free(fsvq->fud);
fsvq->fud = NULL;
@@ -994,6 +991,8 @@ static int virtio_fs_fill_super(struct super_block *sb)
atomic_inc(&fc->dev_count);
}
+ /* Previous unmount will stop all queues. Start these...
2019 Oct 21
0
[PATCH 5/5] virtiofs: Retry request submission from worker context
On Mon, Oct 21, 2019 at 10:15:18AM +0200, Miklos Szeredi wrote:
[..]
> > @@ -268,13 +272,43 @@ static void virtio_fs_request_dispatch_work(struct work_struct *work)
> > list);
> > if (!req) {
> > spin_unlock(&fsvq->lock);
> > - return;
> > + break;
> >...