On Fri, May 31, 2013 at 03:26:45PM -0700, Kent Overstreet wrote: > This implements a refcount with similar semantics to > atomic_get()/atomic_dec_and_test() - but percpu. > > It also implements two stage shutdown, as we need it to tear down the > percpu counts. Before dropping the initial refcount, you must call > percpu_ref_kill(); this puts the refcount in "shutting down mode" and > switches back to a single atomic refcount with the appropriate barriers > (synchronize_rcu()). > > It's also legal to call percpu_ref_kill() multiple times - it only returns > true once, so callers don't have to reimplement shutdown synchronization. > > [[email protected]: fix build] > [[email protected]: coding-style tweak] > Signed-off-by: Kent Overstreet <[email protected]> > Cc: Zach Brown <[email protected]> > Cc: Felipe Balbi <[email protected]> > Cc: Greg Kroah-Hartman <[email protected]> > Cc: Mark Fasheh <[email protected]> > Cc: Joel Becker <[email protected]> > Cc: Rusty Russell <[email protected]> > Cc: Jens Axboe <[email protected]> > Cc: Asai Thambi S P <[email protected]> > Cc: Selvan Mani <[email protected]> > Cc: Sam Bradshaw <[email protected]> > Cc: Jeff Moyer <[email protected]> > Cc: Al Viro <[email protected]> > Cc: Benjamin LaHaise <[email protected]> > Cc: Tejun Heo <[email protected]> > Cc: Oleg Nesterov <[email protected]> > Cc: Christoph Lameter <[email protected]> > Cc: Ingo Molnar <[email protected]> > Reviewed-by: "Theodore Ts'o" <[email protected]> > Signed-off-by: Andrew Morton <[email protected]>
Applied to percpu/for-3.11. Andrew, I removed your SOB as the patch is routed outside -mm. Please let me know if you want reviewed/ackd-by added. git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git for-3.11 Thanks a lot! -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

