On Fri, Jan 24, 2025 at 10:22 AM Bernd Schubert <bernd.schubert@xxxxxxxxxxx> wrote: > > Hi Joanne, > > On 1/24/25 12:30, Bernd Schubert wrote: > > Hmm, would only need to check head? Oh I see it, we need to use > > list_move_tail(). > > > how about the attached updated patch, which uses > list_first_entry_or_null()? It also changes from list_move() > to list_move_tail() so that oldest entry is always on top. > I didn't give it any testing, though. Woah that's cool, I didn't know you could send attachments over the mailing list. Ah I didn't realize list_move doesn't already by default add to the tail of the list - thanks for catching that, yes those should be list_move_tail() then. In t he attached patch, I think we still need the original ent_list_request_expired() logic: static bool ent_list_request_expired(struct fuse_conn *fc, struct list_head *list) { struct fuse_ring_ent *ent; struct fuse_req *req; list_for_each_entry(ent, list, list) { req = ent->fuse_req; if (req) return time_is_before_jiffies(req->create_time + fc->timeout.req_timeout); } return false; } and we can't assume req is non-NULL. For entries that have been committed, their ->req is set to NULL but they are still on the ent_commit_queue. Thanks, Joanne > > This is on top of the other fuse-uring updates I had sent > out about an hour ago. > > > Here is the corresponding branch > https://github.com/bsbernd/linux/tree/optimize-fuse-uring-req-timeouts > > > Thanks, > Bernd