Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759365Ab3FCWjp (ORCPT ); Mon, 3 Jun 2013 18:39:45 -0400 Received: from mail-qe0-f50.google.com ([209.85.128.50]:48198 "EHLO mail-qe0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758711Ab3FCWji (ORCPT ); Mon, 3 Jun 2013 18:39:38 -0400 Date: Mon, 3 Jun 2013 15:39:31 -0700 From: Tejun Heo To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, Zach Brown , Felipe Balbi , Greg Kroah-Hartman , Mark Fasheh , Joel Becker , Rusty Russell , Jens Axboe , Asai Thambi S P , Selvan Mani , Sam Bradshaw , Jeff Moyer , Al Viro , Benjamin LaHaise , Oleg Nesterov , Christoph Lameter , Ingo Molnar , Andrew Morton Subject: Re: [PATCH] Generic percpu refcounting Message-ID: <20130603223931.GD29989@mtj.dyndns.org> References: <1370039205-14071-1-git-send-email-koverstreet@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1370039205-14071-1-git-send-email-koverstreet@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2068 Lines: 51 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. > > [akpm@linux-foundation.org: fix build] > [akpm@linux-foundation.org: coding-style tweak] > Signed-off-by: Kent Overstreet > Cc: Zach Brown > Cc: Felipe Balbi > Cc: Greg Kroah-Hartman > Cc: Mark Fasheh > Cc: Joel Becker > Cc: Rusty Russell > Cc: Jens Axboe > Cc: Asai Thambi S P > Cc: Selvan Mani > Cc: Sam Bradshaw > Cc: Jeff Moyer > Cc: Al Viro > Cc: Benjamin LaHaise > Cc: Tejun Heo > Cc: Oleg Nesterov > Cc: Christoph Lameter > Cc: Ingo Molnar > Reviewed-by: "Theodore Ts'o" > Signed-off-by: Andrew Morton 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/