From: Jan Kara <jack@suse.cz>
To: Mohammed Anees <pvmohammedanees2003@gmail.com>
Cc: jmoyer@redhat.com, bcrl@kvack.org, brauner@kernel.org,
jack@suse.cz, viro@zeniv.linux.org.uk, willy@infradead.org,
linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs:aio: Remove TODO comment suggesting hash or array usage in io_cancel()
Date: Tue, 12 Nov 2024 13:02:52 +0100 [thread overview]
Message-ID: <20241112120252.a75tg4xqszn7nou3@quack3> (raw)
In-Reply-To: <20241112113906.15825-1-pvmohammedanees2003@gmail.com>
On Tue 12-11-24 17:08:34, Mohammed Anees wrote:
> 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>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> 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
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-11-12 12:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 11:38 Mohammed Anees
2024-11-12 12:02 ` Jan Kara [this message]
2024-11-12 13:13 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241112120252.a75tg4xqszn7nou3@quack3 \
--to=jack@suse.cz \
--cc=bcrl@kvack.org \
--cc=brauner@kernel.org \
--cc=jmoyer@redhat.com \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pvmohammedanees2003@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®