From: Vivek Goyal <vgoyal@redhat.com>
To: Liu Bo <bo.liu@linux.alibaba.com>
Cc: virtio-fs@redhat.com, tao.peng@linux.alibaba.com
Subject: Re: [Virtio-fs] [PATCH 3/3] virtio-fs: Waiting for pending forget requests to finish
Date: Wed, 5 Jun 2019 14:39:13 -0400 [thread overview]
Message-ID: <20190605183913.GB22236@redhat.com> (raw)
In-Reply-To: <20190605182606.mrw4e2qobp2u4kjj@US-160370MP2.local>
On Wed, Jun 05, 2019 at 11:26:07AM -0700, Liu Bo wrote:
[..]
> > +static void virtio_fs_flush_hiprio_queue(struct virtio_fs_vq *fsvq)
> > +{
> > + struct virtio_fs_forget *forget;
> > +
> > + WARN_ON(fsvq->in_flight < 0);
> > +
> > + /* Go through pending forget reuests and free them */
> > + spin_lock(&fsvq->lock);
> > + while(1) {
> > + forget = list_first_entry_or_null(&fsvq->queued_reqs,
> > + struct virtio_fs_forget, list);
> > + if (!forget)
> > + break;
> > + kfree(forget);
> > + }
> > +
> > + spin_unlock(&fsvq->lock);
> > +
> > + /* Wait for in flight 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);
> > + }
>
> why not a wait_queue for fsvq->in_flight == 0?
It was much simpler to do busy wait as I am not expecting this wait to
be long. But if this turns out to be issue later, we can switch to
wait queue.
Vivek
next prev parent reply other threads:[~2019-06-05 18:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 18:57 [Virtio-fs] [PATCH 0/3] virtio-fs: Flush forget requests before sending destroy Vivek Goyal
2019-05-31 18:57 ` [Virtio-fs] [PATCH 1/3] Use helper function to get forget requests from fuse Vivek Goyal
2019-06-05 18:16 ` Liu Bo
2019-05-31 18:57 ` [Virtio-fs] [PATCH 2/3] Do not dispatch forget requests once queue is disconnected Vivek Goyal
2019-06-04 3:27 ` Tao Peng
2019-06-05 18:22 ` Liu Bo
2019-05-31 18:57 ` [Virtio-fs] [PATCH 3/3] virtio-fs: Waiting for pending forget requests to finish Vivek Goyal
2019-06-04 4:06 ` Peng Tao
2019-06-04 13:29 ` Vivek Goyal
2019-06-05 18:26 ` Liu Bo
2019-06-05 18:39 ` Vivek Goyal [this message]
2019-06-06 21:06 ` Liu Bo
2019-06-06 21:14 ` Vivek Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190605183913.GB22236@redhat.com \
--to=vgoyal@redhat.com \
--cc=bo.liu@linux.alibaba.com \
--cc=tao.peng@linux.alibaba.com \
--cc=virtio-fs@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.