linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mohammed Anees <pvmohammedanees2003@gmail.com>
To: willy@infradead.org
Cc: bcrl@kvack.org, brauner@kernel.org, jack@suse.cz,
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, pvmohammedanees2003@gmail.com,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH] fs: aio: Transition from Linked List to Hash Table for Active Request Management in AIO
Date: Tue, 22 Oct 2024 12:33:27 +0530	[thread overview]
Message-ID: <20241022070329.144782-1-pvmohammedanees2003@gmail.com> (raw)
In-Reply-To: <ZxW3pyyfXWc6Uaqn@casper.infradead.org>

Hi Matthew,

> Benchmarks, please.  Look at what operations are done on this list.
> It's not at all obvious to me that what you've done here will improve
> performance of any operation.

This patch aims to improve this operation in io_cancel() syscall,
currently this iterates through all the requests in the Linked list,
checking for a match, which could take a significant time if the 
requests are high and once it finds one it deletes it. Using a hash
table will significant reduce the search time, which is what the comment
suggests as well.

/* 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);
			list_del_init(&kiocb->ki_list);
			break;
		}
	}

I have tested this patch and believe it doesn’t affect the 
other functions. As for the io_cancel() syscall, please let 
me know exactly how you’d like me to test it so I can benchmark 
it accordingly.

Thanks!!

  reply	other threads:[~2024-10-22  7:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-20 15:04 [PATCH] fs: aio: Transition from Linked List to Hash Table for Active Request Management in AIO Mohammed Anees
2024-10-21  2:08 ` Matthew Wilcox
2024-10-22  7:03   ` Mohammed Anees [this message]
2024-10-31 12:04     ` Jan Kara
2024-10-31 13:02       ` Jeff Moyer
2024-11-06 11:01         ` Mohammed Anees
2024-11-11 16:42           ` Jeff Moyer
2024-11-12 11:33             ` Mohammed Anees
2024-11-06 10:57       ` Mohammed Anees
2024-10-31 11:51 ` Mohammed Anees

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=20241022070329.144782-1-pvmohammedanees2003@gmail.com \
    --to=pvmohammedanees2003@gmail.com \
    --cc=bcrl@kvack.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).