fuse: add multi-threading support

Submitted by Maxim Patlasov on March 25, 2017, 2:11 a.m.

Details

Reviewer None
Submitted March 25, 2017, 2:11 a.m.
Last Updated March 25, 2017, 2:30 p.m.
Revision 1

Cover Letter

The series add multi-threading support. This essentially means
more than one channel of communicatuion between kernel and
userspace (represented by "struct fuse_device") per single mount.

Thus, userspace can spawn several threads (or processes) each of
them handling its own channel of communication (cloned file
descriptor in terms of userspace fuse).

The implementation consits of two parts. The first part is backport
of 40+ patches from mainline. The result is finer-grained locking
where each fuse_device posesses independent "processing" and "io"
queues.

The second part (last two patches) implements AK's idea: we need
separate input queues to preserve cpu affinity (letting userspace
to ACK read request on the same cpu where the request was originated)
and to avoid thundering herd porblem (waking up only those userspace
processes who registred themselves on given input queue).

https://jira.sw.ru/browse/PSBM-60210

---

Maxim Patlasov (46):
      fuse: initialize fc->release before calling it
      fuse: fix background request if not connected
      fuse: reset waiting
      fuse: account as waiting before queuing for background
      fuse: check conn_error earlier
      fuse: fold fuse_request_send_nowait() into single caller
      fuse: add memory barrier to INIT
      fuse: call fuse_abort_conn() in dev release
      fuse: simplify request abort
      fuse: req use bitops
      fuse: use per req lock for lock/unlock_request()
      fuse: fold helpers into abort
      fuse: rework abort
      fuse: simplify unique ctr
      fuse: don't hold lock over request_wait_answer()
      fuse: simplify req states
      fuse: req state use flags
      fuse: separate out input queue
      fuse: flush requests on umount
      fuse: duplicate ->connected in iqueue
      fuse: abort: group iqueue accesses
      fuse: dev read: split list_move
      fuse: iqueue locking
      fuse: allow interrupt queuing without fc->lock
      fuse: no fc->lock for iqueue parts
      fuse: simplify request_wait()
      fuse: use list_for_each_entry() for list traversing
      fuse: separate out processing queue
      fuse: duplicate ->connected in pqueue
      fuse: move list_del_init() from request_end() into callers
      fuse: cleanup fuse_dev_do_read()
      fuse: abort: group pqueue accesses
      fuse: pqueue locking
      fuse: add req flag for private list
      fuse: request_end(): do once
      fuse: cleanup request_end()
      fuse: no fc->lock in request_end()
      fuse: no fc->lock for pqueue parts
      fuse: abort: no fc->lock needed for request ending
      fuse: device fd clone
      fuse: introduce per-instance fuse_dev structure
      fuse: separate pqueue for clones
      fuse: clear FR_PENDING flag when moving requests out of pending queue
      fuse: fix use after free issue in fuse_dev_do_read()
      fuse: separate iqueue for clones
      fuse: ioctl() to bind fuse device to input queue


 Documentation/ioctl/ioctl-number.txt |    1 
 fs/fuse/control.c                    |   51 +-
 fs/fuse/cuse.c                       |   23 +
 fs/fuse/dev.c                        |  922 ++++++++++++++++++----------------
 fs/fuse/file.c                       |   31 +
 fs/fuse/fuse_i.h                     |  187 ++++---
 fs/fuse/inode.c                      |  143 ++++-
 include/uapi/linux/fuse.h            |    4 
 8 files changed, 795 insertions(+), 567 deletions(-)

--
Signature
  

Revisions

SERIES REVISION LOOKS STRANGE. Please double-check patch list and the ordering before proceeding.

Patches download mbox

# Name Submitter State
[Devel,vz7,01/46] fuse: initialize fc->release before calling it Maxim Patlasov New
[Devel,vz7,02/46] fuse: fix background request if not connected Maxim Patlasov New
[Devel,vz7,03/46] fuse: reset waiting Maxim Patlasov New
[Devel,vz7,04/46] fuse: account as waiting before queuing for background Maxim Patlasov New
[Devel,vz7,05/46] fuse: check conn_error earlier Maxim Patlasov New
[Devel,vz7,06/46] fuse: fold fuse_request_send_nowait() into single caller Maxim Patlasov New
[Devel,vz7,07/46] fuse: add memory barrier to INIT Maxim Patlasov New
[Devel,vz7,08/46] fuse: call fuse_abort_conn() in dev release Maxim Patlasov New
[Devel,vz7,09/46] fuse: simplify request abort Maxim Patlasov New
[Devel,vz7,10/46] fuse: req use bitops Maxim Patlasov New
[Devel,vz7,11/46] fuse: use per req lock for lock/unlock_request() Maxim Patlasov New
[Devel,vz7,12/46] fuse: fold helpers into abort Maxim Patlasov New
[Devel,vz7,13/46] fuse: rework abort Maxim Patlasov New
[Devel,vz7,14/46] fuse: simplify unique ctr Maxim Patlasov New
[Devel,vz7,15/46] fuse: don't hold lock over request_wait_answer() Maxim Patlasov New
[Devel,vz7,16/46] fuse: simplify req states Maxim Patlasov New
[Devel,vz7,17/46] fuse: req state use flags Maxim Patlasov New
[Devel,vz7,18/46] fuse: separate out input queue Maxim Patlasov New
[Devel,vz7,19/46] fuse: flush requests on umount Maxim Patlasov New
[Devel,vz7,20/46] fuse: duplicate ->connected in iqueue Maxim Patlasov New
[Devel,vz7,21/46] fuse: abort: group iqueue accesses Maxim Patlasov New
[Devel,vz7,22/46] fuse: dev read: split list_move Maxim Patlasov New
[Devel,vz7,23/46] fuse: iqueue locking Maxim Patlasov New
[Devel,vz7,24/46] fuse: allow interrupt queuing without fc->lock Maxim Patlasov New
[Devel,vz7,25/46] fuse: no fc->lock for iqueue parts Maxim Patlasov New
[Devel,vz7,26/46] fuse: simplify request_wait() Maxim Patlasov New
[Devel,vz7,27/46] fuse: use list_for_each_entry() for list traversing Maxim Patlasov New
[Devel,vz7,28/46] fuse: separate out processing queue Maxim Patlasov New
[Devel,vz7,29/46] fuse: duplicate ->connected in pqueue Maxim Patlasov New
[Devel,vz7,30/46] fuse: move list_del_init() from request_end() into callers Maxim Patlasov New
[Devel,vz7,31/46] fuse: cleanup fuse_dev_do_read() Maxim Patlasov New
[Devel,vz7,32/46] fuse: abort: group pqueue accesses Maxim Patlasov New
[Devel,vz7,33/46] fuse: pqueue locking Maxim Patlasov New
[Devel,vz7,34/46] fuse: add req flag for private list Maxim Patlasov New
[Devel,vz7,35/46] fuse: request_end(): do once Maxim Patlasov New
[Devel,vz7,36/46] fuse: cleanup request_end() Maxim Patlasov New
[Devel,vz7,37/46] fuse: no fc->lock in request_end() Maxim Patlasov New
[Devel,vz7,38/46] fuse: no fc->lock for pqueue parts Maxim Patlasov New
[Devel,vz7,39/46] fuse: abort: no fc->lock needed for request ending Maxim Patlasov New
[Devel,vz7,40/46] fuse: device fd clone Maxim Patlasov New
[Devel,vz7,41/46] fuse: introduce per-instance fuse_dev structure Maxim Patlasov New
[Devel,vz7,42/46] fuse: separate pqueue for clones Maxim Patlasov New
[Devel,vz7,43/46] fuse: clear FR_PENDING flag when moving requests out of pending queue Maxim Patlasov New
[Devel,vz7,44/46] fuse: fix use after free issue in fuse_dev_do_read() Maxim Patlasov New
[Devel,vz7,45/46] fuse: separate iqueue for clones Maxim Patlasov New
[Devel,vz7,46/46] fuse: ioctl() to bind fuse device to input queue Maxim Patlasov New