From: Jeff Moyer <jmoyer@redhat.com>
To: Li Yu <raise.sail@gmail.com>
Cc: bcrl@kvack.org, viro@zeniv.linux.org.uk, linux-aio@kvack.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] aio: using hash table for active requests
Date: Wed, 15 Dec 2010 17:02:29 -0500 [thread overview]
Message-ID: <x49lj3qd79m.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <4D082FE9.7080407@gmail.com> (Li Yu's message of "Wed, 15 Dec 2010 11:03:05 +0800")
Li Yu <raise.sail@gmail.com> writes:
> This patch remove a TODO in fs/aio.c, that is to use hash table for
> active requests.
It's remained a TODO item for this long because it hasn't really
mattered in the past. Was there other motivation for this patch besides
the TODO comment?
> I prefer add an iocb at tail of collision chain, so I do not use hlist
> here.
Why do you prefer to add to the tail? It makes more sense to add
collisions at the head, since if you're going to cancel everything, you
have a better chance of cancelling stuff that was queued later than
earlier (assuming you can cancel anything at all, which for most cases,
you can't). Also, you're halving the number of buckets, so you should
have a good reason.
What sort of testing did you do?
I've made some cursory comments below. I'll more fully review this if
you can provide a bit more justification and some proof of testing. I'd
be really surprised if this helped any real workloads, though.
Cheers,
Jeff
> +static int ioctx_active_reqs_init(struct kioctx *ctx)
> +{
> + int i;
> +
> + ctx->active_reqs_table = kmalloc(AIO_ACTREQ_BUCKETS*sizeof(struct list_head), GFP_KERNEL);
Fit this into 80 columns, please. You may just want to run checkpatch
over the whole thing.
> +static inline void aio_cancel_one(struct kioctx *ctx, struct kiocb *iocb)
I see no good reason to inline this.
> @@ -465,10 +506,12 @@ static struct kiocb *__aio_get_req(struct kioctx *ctx)
> /* Check if the completion queue has enough free space to
> * accept an event from this io.
> */
> + bucket = hash_long((unsigned long)tohash, AIO_ACTREQ_BUCKETS_SHIFT);
hash_ptr?
> - struct list_head active_reqs; /* used for cancellation */
> + struct list_head* active_reqs_table; /* used for cancellation */
Coding Style
next prev parent reply other threads:[~2010-12-15 22:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 3:03 [PATCH] aio: using hash table for active requests Li Yu
2010-12-15 22:02 ` Jeff Moyer [this message]
2010-12-20 1:57 ` Li Yu
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=x49lj3qd79m.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=bcrl@kvack.org \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=raise.sail@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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).