All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs:aio: Remove TODO comment suggesting hash or array usage in  io_cancel()
@ 2024-11-12 11:38 Mohammed Anees
  2024-11-12 12:02 ` Jan Kara
  2024-11-12 13:13 ` Christian Brauner
  0 siblings, 2 replies; 3+ messages in thread
From: Mohammed Anees @ 2024-11-12 11:38 UTC (permalink / raw)
  To: jmoyer, bcrl, brauner, jack, viro, willy
  Cc: linux-aio, linux-fsdevel, linux-kernel, pvmohammedanees2003

The comment suggests a hash or array approach to
store the active requests. Currently it iterates
through all the active requests and when found
deletes the requested request, in the linked list.
However io_cancel() isn’t a frequently used operation,
and optimizing it wouldn’t bring a substantial benefit
to real users and the increased complexity of maintaining
a hashtable for this would be significant and will slow
down other operation. Therefore remove this TODO 
to avoid people spending time improving this.

Signed-off-by: Mohammed Anees <pvmohammedanees2003@gmail.com>
---
 fs/aio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/aio.c b/fs/aio.c
index e8920178b50f..72e3970f4225 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -2191,7 +2191,6 @@ SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
 		return -EINVAL;
 
 	spin_lock_irq(&ctx->ctx_lock);
-	/* TODO: use a hash or array, this sucks. */
 	list_for_each_entry(kiocb, &ctx->active_reqs, ki_list) {
 		if (kiocb->ki_res.obj == obj) {
 			ret = kiocb->ki_cancel(&kiocb->rw);
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-12 13:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 11:38 [PATCH] fs:aio: Remove TODO comment suggesting hash or array usage in io_cancel() Mohammed Anees
2024-11-12 12:02 ` Jan Kara
2024-11-12 13:13 ` Christian Brauner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.