Re: [PATCH v5] 9pfs: use GHashTable for fid table

2022-09-27 Thread Christian Schoenebeck
On Dienstag, 27. September 2022 17:14:57 CEST Linus Heckemann wrote: > Linus Heckemann writes: > > static void coroutine_fn virtfs_reset(V9fsPDU *pdu) > > { > > > > V9fsState *s = pdu->s; > > V9fsFidState *fidp; > > > > +GList *freeing; > > +/* Get a list of all the values (

Re: [PATCH v5] 9pfs: use GHashTable for fid table

2022-09-27 Thread Christian Schoenebeck
On Dienstag, 27. September 2022 16:25:03 CEST Linus Heckemann wrote: > The previous implementation would iterate over the fid table for > lookup operations, resulting in an operation with O(n) complexity on > the number of open files and poor cache locality -- for every open, > stat, read, write, e

Re: [PATCH v5] 9pfs: use GHashTable for fid table

2022-09-27 Thread Linus Heckemann
Linus Heckemann writes: > static void coroutine_fn virtfs_reset(V9fsPDU *pdu) > { > V9fsState *s = pdu->s; > V9fsFidState *fidp; > +GList *freeing; > +/* Get a list of all the values (fid states) in the table, which we > then... */ > +g_autoptr(GList) fids = g_hash_table_g

[PATCH v5] 9pfs: use GHashTable for fid table

2022-09-27 Thread Linus Heckemann
The previous implementation would iterate over the fid table for lookup operations, resulting in an operation with O(n) complexity on the number of open files and poor cache locality -- for every open, stat, read, write, etc operation. This change uses a hashtable for this instead, significantly i