All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] virtiofs: Notification queue and blocking posix locks
@ 2021-09-30 14:38 ` Vivek Goyal
  0 siblings, 0 replies; 42+ messages in thread
From: Vivek Goyal @ 2021-09-30 14:38 UTC (permalink / raw)
  To: linux-fsdevel, virtio-fs, miklos, stefanha
  Cc: vgoyal, iangelak, jaggel, dgilbert

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


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2021-10-07 18:46 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 14:38 [PATCH 0/8] virtiofs: Notification queue and blocking posix locks Vivek Goyal
2021-09-30 14:38 ` [Virtio-fs] " Vivek Goyal
2021-09-30 14:38 ` [PATCH 1/8] virtiofs: Disable interrupt requests properly Vivek Goyal
2021-09-30 14:38   ` [Virtio-fs] " 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   ` [Virtio-fs] " 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   ` [Virtio-fs] " Vivek Goyal
2021-09-30 14:38 ` [PATCH 4/8] virtiofs: Decouple queue index and queue type Vivek Goyal
2021-09-30 14:38   ` [Virtio-fs] " Vivek Goyal
2021-09-30 14:38 ` [PATCH 5/8] virtiofs: Add a virtqueue for notifications Vivek Goyal
2021-09-30 14:38   ` [Virtio-fs] " Vivek Goyal
2021-10-06 12:46   ` Miklos Szeredi
2021-10-06 12:46     ` [Virtio-fs] " Miklos Szeredi
2021-10-06 12:54     ` Vivek Goyal
2021-10-06 12:54       ` [Virtio-fs] " 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   ` [Virtio-fs] " Vivek Goyal
2021-09-30 14:38 ` [PATCH 7/8] virtiofs: Add new notification type FUSE_NOTIFY_LOCK Vivek Goyal
2021-09-30 14:38   ` [Virtio-fs] " Vivek Goyal
2021-10-06 12:55   ` Miklos Szeredi
2021-10-06 12:55     ` [Virtio-fs] " Miklos Szeredi
2021-10-06 15:01     ` Vivek Goyal
2021-10-06 15:01       ` [Virtio-fs] " Vivek Goyal
2021-10-06 13:02   ` Miklos Szeredi
2021-10-06 13:02     ` [Virtio-fs] " Miklos Szeredi
2021-10-06 16:12     ` Vivek Goyal
2021-10-06 16:12       ` [Virtio-fs] " Vivek Goyal
2021-10-07 13:45       ` Miklos Szeredi
2021-10-07 13:45         ` [Virtio-fs] " Miklos Szeredi
2021-10-07 14:21         ` Vivek Goyal
2021-10-07 14:21           ` [Virtio-fs] " Vivek Goyal
2021-10-07 18:11           ` Miklos Szeredi
2021-10-07 18:11             ` [Virtio-fs] " Miklos Szeredi
2021-10-07 18:32             ` Vivek Goyal
2021-10-07 18:32               ` [Virtio-fs] " Vivek Goyal
2021-10-07 18:46               ` Miklos Szeredi
2021-10-07 18:46                 ` [Virtio-fs] " Miklos Szeredi
2021-09-30 14:38 ` [PATCH 8/8] virtiofs: Handle reordering of reply and notification event Vivek Goyal
2021-09-30 14:38   ` [Virtio-fs] " Vivek Goyal
2021-09-30 15:43 ` [PATCH 0/8] virtiofs: Notification queue and blocking posix locks Vivek Goyal
2021-09-30 15:43   ` [Virtio-fs] " Vivek Goyal

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.