[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130402013214.GA30122@thunk.org>
Date: Mon, 1 Apr 2013 21:32:14 -0400
From: Theodore Ts'o <tytso@....edu>
To: Kent Overstreet <koverstreet@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-aio@...ck.org,
akpm@...ux-foundation.org, Zach Brown <zab@...hat.com>,
Felipe Balbi <balbi@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mark Fasheh <mfasheh@...e.com>,
Joel Becker <jlbec@...lplan.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Jens Axboe <axboe@...nel.dk>,
Asai Thambi S P <asamymuthupa@...ron.com>,
Selvan Mani <smani@...ron.com>,
Sam Bradshaw <sbradshaw@...ron.com>,
Jeff Moyer <jmoyer@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
Benjamin LaHaise <bcrl@...ck.org>
Subject: Re: [PATCH 12/33] aio: refcounting cleanup
On Thu, Mar 21, 2013 at 09:35:33AM -0700, Kent Overstreet wrote:
> The usage of ctx->dead was fubar - it makes no sense to explicitly check
> it all over the place, especially when we're already using RCU.
>
> Now, ctx->dead only indicates whether we've dropped the initial
> refcount. The new teardown sequence is:
> set ctx->dead
> hlist_del_rcu();
> synchronize_rcu();
>
> Now we know no system calls can take a new ref, and it's safe to drop
> the initial ref:
> put_ioctx();
>
> We also need to ensure there are no more outstanding kiocbs. This was
> done incorrectly - it was being done in kill_ctx(), and before dropping
> the initial refcount. At this point, other syscalls may still be
> submitting kiocbs!
>
> Now, we cancel and wait for outstanding kiocbs in free_ioctx(), after
> kioctx->users has dropped to 0 and we know no more iocbs could be
> submitted.
>
> Signed-off-by: Kent Overstreet <koverstreet@...gle.com>
> Cc: Zach Brown <zab@...hat.com>
> Cc: Felipe Balbi <balbi@...com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Mark Fasheh <mfasheh@...e.com>
> Cc: Joel Becker <jlbec@...lplan.org>
> Cc: Rusty Russell <rusty@...tcorp.com.au>
> Cc: Jens Axboe <axboe@...nel.dk>
> Cc: Asai Thambi S P <asamymuthupa@...ron.com>
> Cc: Selvan Mani <smani@...ron.com>
> Cc: Sam Bradshaw <sbradshaw@...ron.com>
> Cc: Jeff Moyer <jmoyer@...hat.com>
> Cc: Al Viro <viro@...iv.linux.org.uk>
> Cc: Benjamin LaHaise <bcrl@...ck.org>
> Cc: Theodore Ts'o <tytso@....edu>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Reviewed-by: "Theodore Ts'o" <tytso@....edu>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists