[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130613035636.GF10979@localhost>
Date: Wed, 12 Jun 2013 20:56:36 -0700
From: Kent Overstreet <koverstreet@...gle.com>
To: Tejun Heo <tj@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Rusty Russell <rusty@...tcorp.com.au>,
Oleg Nesterov <oleg@...hat.com>,
Christoph Lameter <cl@...ux-foundation.org>
Subject: Re: [PATCH percpu/for-3.11 2/2] percpu-refcount: implement
percpu_ref_cancel_init()
On Wed, Jun 12, 2013 at 08:52:35PM -0700, Tejun Heo wrote:
> Normally, percpu_ref_init() initializes and percpu_ref_kill*()
> initiates destruction which completes asynchronously. The
> asynchronous destruction can be problematic in init failure path where
> the caller wants to destroy half-constructed object - distinguishing
> half-constructed objects from the usual release method can be painful
> for complex objects.
>
> This patch implements percpu_ref_cancel_init() which synchronously
> destroys the percpu_ref without invoking release. To avoid
> unintentional misuses, the function requires the ref to have finished
> percpu_ref_init() but never used and triggers WARN otherwise.
That's a good idea, I should've implemented that for aio.
I probably would've just gone with percpu_ref_free() (if caller knows
it's safe, they can do whatever they want) but I suppose I can live with
percpu_ref_cancel_init().
Acked-by: Kent Overstreet <koverstreet@...gle.com>
--
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