From: Daniel McNeil <daniel@osdl.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Suparna Bhattacharya <suparna@in.ibm.com>,
"linux-aio@kvack.org" <linux-aio@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: PATCH 2.6.0-test6-mm2] aio ref count during retry
Date: 03 Oct 2003 15:00:56 -0700 [thread overview]
Message-ID: <1065218455.1862.198.camel@ibm-c.pdx.osdl.net> (raw)
In-Reply-To: <20031003144010.3445ec1f.akpm@osdl.org>
On Fri, 2003-10-03 at 14:40, Andrew Morton wrote:
> Daniel McNeil <daniel@osdl.org> wrote:
> >
> > Here is the patch for AIO retry to hold an extra ref count.
> > The patch is small, but I wanted to make sure it was safe.
> > I spent time looking over the retry code and this patch looks
> > ok to me. It is potentially calling put_ioctx() while holding
> > ctx->ctx_lock, I do not think that will cause any problems.
> > This should never be the last reference on the ioctx anyway,
> > since the loop is checking list_empty(&ctx->run_list).
>
> So... if the refcount is never zero in there, why are you changing it to
> take an additional reference?
The extra reference is on the iocb itself. Each iocb has a reference
on the ioctx. When dropping the extra reference using __aio_put_req(),
you have to check if it was the last reference and then drop that iocb's
reference on the ioctx by calling put_ioctx(). It is the ioctx's ref
count that is never zero here.
Having the extra ref on the iocb, guarantees that the iocb won't be
freed until the extra reference is dropped. In the initial submit
case, the lower level code has looking at the iocb after submitting
it (which was racy without the extra reference). This patch just
added the extra reference for iocb during retries.
Daniel
prev parent reply other threads:[~2003-10-03 22:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-26 17:06 slab corruption on AIO 2.6.0-test5-mm4 Daniel McNeil
2003-09-26 23:59 ` Daniel McNeil
2003-09-29 4:09 ` Suparna Bhattacharya
[not found] ` <20030929131057.GA4630@in.ibm.com>
[not found] ` <1064876358.23108.41.camel@ibm-c.pdx.osdl.net>
[not found] ` <20030930040020.GA3435@in.ibm.com>
2003-09-30 23:22 ` [PATCH 2.6.0-test6-mm1] aio ref count in io_submit_one Daniel McNeil
2003-10-01 8:46 ` Suparna Bhattacharya
2003-10-01 20:51 ` [PATCH 2.6.0-test6-mm1] aio ref count in io_submit_one updated Daniel McNeil
2003-10-03 21:19 ` PATCH 2.6.0-test6-mm2] aio ref count during retry Daniel McNeil
2003-10-03 21:40 ` Andrew Morton
2003-10-03 22:00 ` Daniel McNeil [this message]
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=1065218455.1862.198.camel@ibm-c.pdx.osdl.net \
--to=daniel@osdl.org \
--cc=akpm@osdl.org \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
--cc=suparna@in.ibm.com \
/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®