search for: queued_reqs

Displaying 20 results from an estimated 20 matches for "queued_reqs".

2023 May 31
1
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
...--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/fs/fuse/virtio_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-&...
2023 Jul 03
2
[PATCH V4] virtio-fs: Improved request latencies when Virtio queue is full
...--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/fs/fuse/virtio_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-&...
2023 Jun 01
2
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
....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_fligh...
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
2023 May 31
1
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
...irtio_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 +20...
2023 Jun 01
1
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
...gt;>> 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; >>>>> l...
2023 May 22
1
[PATCH] virtio-fs: Improved request latencies when Virtio queue is full
...; } 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->queued_reqs); - schedule_delayed_work(&fsvq->dispatch_work, - msecs_to_jiffies(1)); spin_unlock(&fsvq->lock); return; } @@ -436,8 +436,6 @@ static int send_forget_request(struct virtio_fs_vq *fsvq, pr_debug("virtio-fs: Could not queue FORGET: err=%d. Will try...
2019 Oct 30
0
[PATCH 1/3] virtiofs: Use a common function to send forget
..._); + + ret = virtqueue_add_outbuf(vq, &sg, 1, forget, GFP_ATOMIC); + if (ret < 0) { + if (ret == -ENOMEM || ret == -ENOSPC) { + pr_debug("virtio-fs: Could not queue FORGET: err=%d." + " Will try later\n", ret); + list_add_tail(&forget->list, &fsvq->queued_reqs); + schedule_delayed_work(&fsvq->dispatch_work, + msecs_to_jiffies(1)); + if (!in_flight) + inc_in_flight_req(fsvq); + /* Queue is full */ + ret = 1; + } else { + pr_debug("virtio-fs: Could not queue FORGET: err=%d." + " Dropping it.\n", ret);...
2019 Sep 06
1
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...period 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,...
2019 Sep 05
0
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...are improvements which we can do over a period 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 ca...
2019 Sep 03
4
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...irtio_fs_instances); > + > +enum { > + 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 */...
2019 Sep 03
4
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...irtio_fs_instances); > + > +enum { > + 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 */...
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 Sep 05
0
[PATCH 08/18] virtiofs: Drain all pending requests during ->remove time
...p;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; + list_del(&forget->list); + kfree(forget); +...
2019 Oct 21
0
[PATCH 1/5] virtiofs: Do not end request in submission context
...@@ -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_LIST_HEAD(&fs->vqs[VQ_HIPRIO].queued_reqs); > > + INIT_LIST_HEAD(&fs->vqs[VQ_HIPRIO].end_reqs); > > INIT_DELAYED_WORK(&fs->vqs[VQ_HIPRIO].dispatch_work, > > virtio_fs_hiprio_dispatch_work); > > spin_lock_init(&fs->vqs[VQ_HIPRIO].lock); > > @@ -...
2019 Oct 21
0
[PATCH 5/5] virtiofs: Retry request submission from worker context
...lock); > > fuse_request_end(fc, req); > > } > > + > > + /* Dispatch pending requests */ > > + while (1) { > > + spin_lock(&fsvq->lock); > > + req = list_first_entry_or_null(&fsvq->queued_reqs, > > + struct fuse_req, list); > > + if (!req) { > > + spin_unlock(&fsvq->lock); > > + return; > > + } > > + list_del_init(&a...
2019 Oct 15
0
[PATCH 4/5] virtiofs: Count pending forgets as in_flight forgets
...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; - list_del(&forget->list); - kfree(forget); -...
2019 Sep 18
0
[PATCH v6] virtio-fs: add virtiofs filesystem
...irtio_fs_instances); > + > +enum { > + 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_h...
2019 Oct 30
0
[PATCH 3/3] virtiofs: Use completions while waiting for queue to be drained
...on(&fs->vqs[VQ_HIPRIO].in_flight_zero); spin_lock_init(&fs->vqs[VQ_HIPRIO].lock); /* Initialize the requests virtqueues */ @@ -591,6 +609,7 @@ static int virtio_fs_setup_vqs(struct virtio_device *vdev, virtio_fs_request_dispatch_work); INIT_LIST_HEAD(&fs->vqs[i].queued_reqs); INIT_LIST_HEAD(&fs->vqs[i].end_reqs); + init_completion(&fs->vqs[i].in_flight_zero); snprintf(fs->vqs[i].name, sizeof(fs->vqs[i].name), "requests.%u", i - VQ_REQUEST); callbacks[i] = virtio_fs_vq_done; @@ -684,7 +703,7 @@ static void virtio_fs_remove(s...
2019 Sep 05
38
[PATCH 00/18] virtiofs: Fix various races and cleanups round 1
Hi, Michael Tsirkin pointed out issues w.r.t various locking related TODO items and races w.r.t device removal. In this first round of cleanups, I have taken care of most pressing issues. These patches apply on top of following. git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#virtiofs-v4 I have tested these patches with mount/umount and device removal using qemu monitor. For