On Sun, Sep 19, 2021 at 10:41:46AM -0400, Hamza Mahfooz wrote:
> Commit 833f4154ed56 ("aio: fold lookup_kiocb() into its sole caller")
> suggests that, the fact that active_reqs is a linked-list means aio_kiocb
> lookups in io_cancel() are inefficient. So, to get faster lookups (on
> average) while maintaining similar insertion and deletion characteristics,
> turn active_reqs into a hashtable.
You're doing this wrong. If you want faster cancellations, stash an index
into iocb->aio_key to index into an array with all requests rather than
using a hash table.
-ben
--
"Thought is the essence of where you are now."
On Sun, Sep 19 2021 at 10:56:45 AM -0400, Benjamin LaHaise
<[email protected]> wrote:
> You're doing this wrong. If you want faster cancellations, stash an
> index
> into iocb->aio_key to index into an array with all requests rather
> than
> using a hash table.
Would that not mean that, we would have to keep track of the indices of
the
array that are not being held by an `aio_kiocb`?
On Thu, Sep 23, 2021 at 09:00:43AM -0400, Hamza Mahfooz wrote:
> Would that not mean that, we would have to keep track of the indices of
> the
> array that are not being held by an `aio_kiocb`?
Correct. This is a better solution than the hash table and would mean
that the requests list could likely be replaced by the table.
-ben
--
"Thought is the essence of where you are now."