From: Vivek Goyal <vgoyal@redhat.com>
To: linux-fsdevel@vger.kernel.org, virtio-fs@redhat.com,
miklos@szeredi.hu, stefanha@redhat.com
Cc: vgoyal@redhat.com, iangelak@redhat.com, jaggel@bu.edu,
dgilbert@redhat.com
Subject: [PATCH 0/8] virtiofs: Notification queue and blocking posix locks
Date: Thu, 30 Sep 2021 10:38:42 -0400 [thread overview]
Message-ID: <20210930143850.1188628-1-vgoyal@redhat.com> (raw)
Hi,
As of now we do not support blocking remote posix locks with virtiofs.
Well fuse client does not care but server returns -EOPNOTSUPP.
There are couple of reasons to not support it yet.
- If virtiofsd is single threaded or does not have a thread pool just
to handle requests which can block for a long time, virtiofsd will
stop processing new requests and virtiofs will come to a halt.
To the extent that further unlock request will not make progress
and deadlock will result. This can be taken care of by creating
a custom thread pool in virtiofsd just to hanlde lock requests.
- If client sends a blocking lock request and blocks, then it will
consume descriptors in vring. If enough processes block, it is
possible that vring does not have capacity to send more requests
till some response comes back and descriptors are free. This can
also lead to deadlock where an unlock request can't be sent to
virtiofsd now. Also this will stop virtiofs operation as well as
new filesystem requests can't be sent.
To avoid this issue, idea was suggested thatn when a blocking
lock request is sent by client, do not block it. Immediately
send a reply saying client process should wait for a notification
which will let it know once lock is available. This will make
sure descriptors in virtqueue are not kept busy while we are
waiting for lock and future unlock and other file system requests
can continue to make progress.
This first requires a notion of notification queue and virtiosfd
being able to send notifications to client. This patch series
implements that as well.
As of now only one notification type has been implemented but now
infrastructure is in place and other use cases should be easily
add more type of notifications as need be.
We don't yet have the capability to interrupt the process which
is waiting for the posix lock. And reason for that is that virtiofs
does not support capability to interrupt yet. That's a TODO item
for later.
Please have a look.
Thanks
Vivek
Vivek Goyal (8):
virtiofs: Disable interrupt requests properly
virtiofs: Fix a comment about fuse_dev allocation
virtiofs: Add an index to keep track of first request queue
virtiofs: Decouple queue index and queue type
virtiofs: Add a virtqueue for notifications
virtiofs: Add a helper to end request and decrement inflight number
virtiofs: Add new notification type FUSE_NOTIFY_LOCK
virtiofs: Handle reordering of reply and notification event
fs/fuse/virtio_fs.c | 438 ++++++++++++++++++++++++++++++---
include/uapi/linux/fuse.h | 11 +-
include/uapi/linux/virtio_fs.h | 5 +
3 files changed, 412 insertions(+), 42 deletions(-)
--
2.31.1
next reply other threads:[~2021-09-30 14:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 14:38 Vivek Goyal [this message]
2021-09-30 14:38 ` [PATCH 1/8] virtiofs: Disable interrupt requests properly Vivek Goyal
2021-09-30 14:38 ` [PATCH 2/8] virtiofs: Fix a comment about fuse_dev allocation Vivek Goyal
2021-09-30 14:38 ` [PATCH 3/8] virtiofs: Add an index to keep track of first request queue Vivek Goyal
2021-09-30 14:38 ` [PATCH 4/8] virtiofs: Decouple queue index and queue type Vivek Goyal
2021-09-30 14:38 ` [PATCH 5/8] virtiofs: Add a virtqueue for notifications Vivek Goyal
2021-10-06 12:46 ` Miklos Szeredi
2021-10-06 12:54 ` Vivek Goyal
2021-09-30 14:38 ` [PATCH 6/8] virtiofs: Add a helper to end request and decrement inflight number Vivek Goyal
2021-09-30 14:38 ` [PATCH 7/8] virtiofs: Add new notification type FUSE_NOTIFY_LOCK Vivek Goyal
2021-10-06 12:55 ` Miklos Szeredi
2021-10-06 15:01 ` Vivek Goyal
2021-10-06 13:02 ` Miklos Szeredi
2021-10-06 16:12 ` Vivek Goyal
2021-10-07 13:45 ` Miklos Szeredi
2021-10-07 14:21 ` Vivek Goyal
2021-10-07 18:11 ` Miklos Szeredi
2021-10-07 18:32 ` Vivek Goyal
2021-10-07 18:46 ` Miklos Szeredi
2021-09-30 14:38 ` [PATCH 8/8] virtiofs: Handle reordering of reply and notification event Vivek Goyal
2021-09-30 15:43 ` [PATCH 0/8] virtiofs: Notification queue and blocking posix locks 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=20210930143850.1188628-1-vgoyal@redhat.com \
--to=vgoyal@redhat.com \
--cc=dgilbert@redhat.com \
--cc=iangelak@redhat.com \
--cc=jaggel@bu.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=stefanha@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).