Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2409658ybv; Fri, 21 Feb 2020 15:16:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzJRhkcZbrktsigRIEee0Y1VOBtxQYCHZSvMyKCpcUqBiZyvDOKgrk9iRvwRP9VGw33Uu9b X-Received: by 2002:a05:6830:1042:: with SMTP id b2mr29993270otp.306.1582326986925; Fri, 21 Feb 2020 15:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582326986; cv=none; d=google.com; s=arc-20160816; b=sgDS2OWdJ3sV9NjYsRj+u7yC2j7GZty00p/cUYxqLcs5BvRtpV5A4JZ3VldAWdZGOe gZezJcZWZ160Rg/PdZmEtv00mY0UMSiG3rwzTWRtdsLeOor8/aC8VIBexZnMVnOUhj3V YF61hFpfant4urJSCMHM/8SQKXo1+NmNiX7Q8YTw8DOT9OWNv3DFWn0o0gvuLOSeMu88 opabNHdOtzlbrdTqIvHrlcYDAFLTeIlZAUA/144zt6jO28Eb2OXQJyNr5Y/UO8rZc5+d pH/s2lTrY4MLr87ADb8hn2A5ZziDf+mu1wU1tZSwjqNMfLQgX4FU30D7wGwLNC9INUU2 iOnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=UJEKzfysaqZrkeCA8HwIoOcWyu6g7lLcWZn7LN4lJWs=; b=QUrvo0mmsz2YI1VEhs2JWeYaseD0ES0yRiQ5i0gvyhBYxl525/aRUWHwCD2dpe5SBO u52XMkLVxPPh8JKqFOZJW7O2u8lPQUgi27XlBMpJXPb8XlkPXNmtRNjVUphx/9ITEm6c Pm+0FnLZz7Arhwbt7vYqhHXf1n6AEZo/8qGlGFSSP8vbX4fHMLjEluPCMZ++oeOQRE2i vg4rnzxS50m7pw5B4ttYWk8TB6BtljUaoDWRb5vCHtgdmC+ARyfI72X1jhx9mMaYtd0X bX8T5vAQYpgpKWsxOgRumswLMAwhOMqs0AHEwrAqpCTdX6akZU0+jSTUpMdh+hF5k83w Ibrw== 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 t11si1437444oih.187.2020.02.21.15.16.14; Fri, 21 Feb 2020 15:16:26 -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 S1728656AbgBUXQL (ORCPT + 99 others); Fri, 21 Feb 2020 18:16:11 -0500 Received: from mga11.intel.com ([192.55.52.93]:45531 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbgBUXQL (ORCPT ); Fri, 21 Feb 2020 18:16:11 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2020 15:16:10 -0800 X-IronPort-AV: E=Sophos;i="5.70,470,1574150400"; d="scan'208";a="236718090" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2020 15:16:09 -0800 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org Cc: Petr Mladek , Tejun Heo , Dennis Zhou , Thomas Gleixner , Greg Kroah-Hartman , Roman Gushchin , Sakari Ailus , Ira Weiny Subject: [RESEND PATCH] percpu_ref: Fix comment regarding percpu_ref_init flags Date: Fri, 21 Feb 2020 15:16:07 -0800 Message-Id: <20200221231607.12782-1-ira.weiny@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Ira Weiny --- RESEND: Add more people on the CC list to see if I'm wrong here. https://lore.kernel.org/lkml/20200206042810.GA29917@iweiny-DESK2.sc.intel.com/ --- 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