Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1077055ybv; Wed, 5 Feb 2020 20:40:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzU8gAzWPhDUN+6g0P82mx28YtZl4MO2Afrh28kM10QBnrYwJGaJ7pe5QGuTOkwBFstp6LJ X-Received: by 2002:aca:33d5:: with SMTP id z204mr5469070oiz.120.1580964019920; Wed, 05 Feb 2020 20:40:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580964019; cv=none; d=google.com; s=arc-20160816; b=vZDdBzj1v/kbkxQiEc9onnEuqyRaY7EdzRMFtjuA+zLBVojpRK9uC/6MfdeKAVa2IQ HAv867XN+8mJDrbed4OUHNLlESObE/+KJcmoLTTBW1KcZ8n9fvOKqk/VgDKxsMSoBEa7 hDOyJfa2mBXfavnlgdIEay4s+/RsRkS80LgWI95KO5o1iLlMtZCdLNsf3HxMc5GahvL9 S5GVzErb6ElBreeVusJtmJS+Wq2WZ2ITAovCKp2XmbqOYdDWYVgmqAd0J6RogdFDICdI T6zMQoMEWkObEXnRWuXIqFMFsLAfk6/o4gapO0Q10xIKce9aZic9LyEGtP0x9glVTg06 jSzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=IMGrVtNSLZBFEHFiTjUnTI4CFjdUTaSFXgogIyS88Kc=; b=VyfDawfjcM1cumYh1/eOcGhkrv1CO/HXeuUhfdrWZieC28f9cYFHaySVJfdW7A2H74 RN5Dtw44yd6H0VMfhHUuJQ9o2ACaSbW80EknVa+nirAMbLdsNUiXR+G5wn9pNPyA4Q+y sgKM2+4NQi+c5X1yoEIzAmbqHKjwmVjzmysOVke+JBDSohROt7vowBa7lg1o5xe6Obip fziGrD3NjsDODtgtBZeKSoxLn+4hoR+/c0t4q3HG6KJ9JWoVEXbE0Q+nIyaOERh+hhwC iXkqyDNXMhv/p3XFwSTntagRioWKw0Fvji2ezXLM8oa5dPJmEpqy9o5/TEsittlj+JPs TqGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si1359949otn.189.2020.02.05.20.40.08; Wed, 05 Feb 2020 20:40:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727778AbgBFE2M (ORCPT + 99 others); Wed, 5 Feb 2020 23:28:12 -0500 Received: from mga12.intel.com ([192.55.52.136]:12764 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727548AbgBFE2L (ORCPT ); Wed, 5 Feb 2020 23:28:11 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2020 20:28:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,408,1574150400"; d="scan'208";a="225157132" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga007.fm.intel.com with ESMTP; 05 Feb 2020 20:28:11 -0800 Date: Wed, 5 Feb 2020 20:28:11 -0800 From: Ira Weiny To: Sakari Ailus , linux-kernel@vger.kernel.org Cc: Tejun Heo Subject: Re: [PATCH] percpu_ref: Fix comment regarding percpu_ref_init flags Message-ID: <20200206042810.GA29917@iweiny-DESK2.sc.intel.com> References: <20191209215420.19157-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191209215420.19157-1-ira.weiny@intel.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 09, 2019 at 01:54:20PM -0800, 'Ira Weiny' wrote: > From: Ira Weiny > > The comment for percpu_ref_init() implies that using > PERCPU_REF_ALLOW_REINIT will cause the refcount to start at 0. But > this is not true. PERCPU_REF_ALLOW_REINIT starts the count at 1 as > if the flags were zero. Add this fact to the kernel doc comment. Did this get picked up? Or am I wrong in the comment? Ira > > Signed-off-by: Ira Weiny > --- > lib/percpu-refcount.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c > index 4f6c6ebbbbde..48d7fcff70b6 100644 > --- a/lib/percpu-refcount.c > +++ b/lib/percpu-refcount.c > @@ -50,9 +50,9 @@ static unsigned long __percpu *percpu_count_ptr(struct percpu_ref *ref) > * @flags: PERCPU_REF_INIT_* flags > * @gfp: allocation mask to use > * > - * Initializes @ref. If @flags is zero, @ref starts in percpu mode with a > - * refcount of 1; analagous to atomic_long_set(ref, 1). See the > - * definitions of PERCPU_REF_INIT_* flags for flag behaviors. > + * Initializes @ref. If @flags is zero or PERCPU_REF_ALLOW_REINIT, @ref starts > + * in percpu mode with a refcount of 1; analagous to atomic_long_set(ref, 1). > + * See the definitions of PERCPU_REF_INIT_* flags for flag behaviors. > * > * Note that @release must not sleep - it may potentially be called from RCU > * callback context by percpu_ref_kill(). > -- > 2.21.0 >