public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: Mohammed Anees <pvmohammedanees2003@gmail.com>,
	 willy@infradead.org, bcrl@kvack.org,  brauner@kernel.org,
	 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
	 linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [PATCH] fs: aio: Transition from Linked List to Hash Table for Active Request Management in AIO
Date: Thu, 31 Oct 2024 09:02:23 -0400	[thread overview]
Message-ID: <x491pzwtogw.fsf@segfault.usersys.redhat.com> (raw)
In-Reply-To: <20241031120423.5rq6uykywklkptkv@quack3> (Jan Kara's message of "Thu, 31 Oct 2024 13:04:23 +0100")

Jan Kara <jack@suse.cz> writes:

> Hi!
>
> On Tue 22-10-24 12:33:27, Mohammed Anees wrote:
>> > 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.
>
> Well, I'd say that calling io_cancel() isn't really frequent operation. Or
> are you aware of any workload that would be regularly doing that? Hence
> optimizing performance for such operation isn't going to bring much benefit
> to real users. On the other hand the additional complexity of handling
> hashtable for requests in flight (although it isn't big on its own) is
> going to impact everybody using AIO. Hence I agree with Matthew that
> changes like you propose are not a clear win when looking at the bigger
> picture and need good justification.

... and cancelation is only supported by usb gadgetfs.  I'd say submit a
patch that gets rid of that todo so nobody else wastes time on it.

Cheers,
Jeff


  reply	other threads:[~2024-10-31 13:02 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
2024-10-31 12:04     ` Jan Kara
2024-10-31 13:02       ` Jeff Moyer [this message]
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=x491pzwtogw.fsf@segfault.usersys.redhat.com \
    --to=jmoyer@redhat.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=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