Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fuse: {io-uring} Allow reduced number of ring queues
Now that queue selection for fuse requests supports missing
queues we don't need to wait for full queue initialization.
In fact, fuse-server (daemon) might want to run with a reduced
number of queues, for example to reduce memory usage.
This also simplifies startup - after first queue entry
registration fuse-io-uring is ready to be used.

Signed-off-by: Bernd Schubert <[email protected]>
  • Loading branch information
bsbernd committed Jun 26, 2025
commit d763efd86aece25cc43542a29703104e7fb66fdc
35 changes: 3 additions & 32 deletions fs/fuse/dev_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,31 +1113,6 @@ static int fuse_uring_commit_fetch(struct io_uring_cmd *cmd, int issue_flags,
return 0;
}

static bool is_ring_ready(struct fuse_ring *ring, int current_qid)
{
int qid;
struct fuse_ring_queue *queue;
bool ready = true;

for (qid = 0; qid < ring->max_nr_queues && ready; qid++) {
if (current_qid == qid)
continue;

queue = ring->queues[qid];
if (!queue) {
ready = false;
break;
}

spin_lock(&queue->lock);
if (list_empty(&queue->ent_avail_queue))
ready = false;
spin_unlock(&queue->lock);
}

return ready;
}

/*
* fuse_uring_req_fetch command handling
*/
Expand All @@ -1158,13 +1133,9 @@ static void fuse_uring_do_register(struct fuse_ring_ent *ent,
spin_unlock(&queue->lock);

if (!ring->ready) {
bool ready = is_ring_ready(ring, queue->qid);

if (ready) {
WRITE_ONCE(fiq->ops, &fuse_io_uring_ops);
WRITE_ONCE(ring->ready, true);
wake_up_all(&fc->blocked_waitq);
}
WRITE_ONCE(fiq->ops, &fuse_io_uring_ops);
WRITE_ONCE(ring->ready, true);
wake_up_all(&fc->blocked_waitq);
}
}

Expand Down