[Devel] [PATCH RHEL7 COMMIT] ms/percpu-refcount: cosmetic updates
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Aug 28 03:49:23 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-229.7.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.6.3
------>
commit d6bfd7b559fdbe649d00c272895cb26996d1ee1c
Author: Vladimir Davydov <vdavydov at parallels.com>
Date: Fri Aug 28 14:49:22 2015 +0400
ms/percpu-refcount: cosmetic updates
Patchset description:
Pulling upstream patches converting css refcnt to percpu_ref.
https://jira.sw.ru/browse/PSBM-34174
Kent Overstreet (2):
percpu: implement generic percpu refcounting
percpu-refcount: Don't use silly cmpxchg()
Tejun Heo (9):
percpu-refcount: consistently use plain (non-sched) RCU
percpu-refcount: cosmetic updates
percpu-refcount: add __must_check to percpu_ref_init() and don't use
ACCESS_ONCE() in percpu_ref_kill_rcu()
percpu-refcount: implement percpu_ref_cancel_init()
percpu-refcount: implement percpu_tryget() along with
percpu_ref_kill_and_confirm()
percpu-refcount: use RCU-sched insted of normal RCU
cgroup: reorder the operations in cgroup_destroy_locked()
cgroup: split cgroup destruction into two steps
cgroup: use percpu refcnt for cgroup_subsys_states
===
This patch description:
From: Tejun Heo <tj at kernel.org>
* s/percpu_ref_release/percpu_ref_func_t/ as it's customary to have _t
postfix for types and the type is gonna be used for a different type
of callback too.
* Add @ARG to function comments.
* Drop unnecessary and unaligned indentation from percpu_ref_init()
function comment.
Signed-off-by: Tejun Heo <tj at kernel.org>
Acked-by: Kent Overstreet <koverstreet at google.com>
(cherry picked from commit ac899061a93250c28562f05ad94d5c74603415bc)
Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
include/linux/percpu-refcount.h | 8 +++++---
lib/percpu-refcount.c | 7 ++++---
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
index abe1411..b61bd6f 100644
--- a/include/linux/percpu-refcount.h
+++ b/include/linux/percpu-refcount.h
@@ -51,7 +51,7 @@
#include <linux/rcupdate.h>
struct percpu_ref;
-typedef void (percpu_ref_release)(struct percpu_ref *);
+typedef void (percpu_ref_func_t)(struct percpu_ref *);
struct percpu_ref {
atomic_t count;
@@ -62,11 +62,11 @@ struct percpu_ref {
* percpu_ref_kill_rcu())
*/
unsigned __percpu *pcpu_count;
- percpu_ref_release *release;
+ percpu_ref_func_t *release;
struct rcu_head rcu;
};
-int percpu_ref_init(struct percpu_ref *, percpu_ref_release *);
+int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release);
void percpu_ref_kill(struct percpu_ref *ref);
#define PCPU_STATUS_BITS 2
@@ -78,6 +78,7 @@ void percpu_ref_kill(struct percpu_ref *ref);
/**
* percpu_ref_get - increment a percpu refcount
+ * @ref: percpu_ref to get
*
* Analagous to atomic_inc().
*/
@@ -99,6 +100,7 @@ static inline void percpu_ref_get(struct percpu_ref *ref)
/**
* percpu_ref_put - decrement a percpu refcount
+ * @ref: percpu_ref to put
*
* Decrement the refcount, and if 0, call the release function (which was passed
* to percpu_ref_init())
diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c
index 1a17399..9a78e55 100644
--- a/lib/percpu-refcount.c
+++ b/lib/percpu-refcount.c
@@ -33,8 +33,8 @@
/**
* percpu_ref_init - initialize a percpu refcount
- * @ref: ref to initialize
- * @release: function which will be called when refcount hits 0
+ * @ref: percpu_ref to initialize
+ * @release: function which will be called when refcount hits 0
*
* Initializes the refcount in single atomic counter mode with a refcount of 1;
* analagous to atomic_set(ref, 1).
@@ -42,7 +42,7 @@
* Note that @release must not sleep - it may potentially be called from RCU
* callback context by percpu_ref_kill().
*/
-int percpu_ref_init(struct percpu_ref *ref, percpu_ref_release *release)
+int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release)
{
atomic_set(&ref->count, 1 + PCPU_COUNT_BIAS);
@@ -98,6 +98,7 @@ static void percpu_ref_kill_rcu(struct rcu_head *rcu)
/**
* percpu_ref_kill - safely drop initial ref
+ * @ref: percpu_ref to kill
*
* Must be used to drop the initial ref on a percpu refcount; must be called
* precisely once before shutdown.
More information about the Devel
mailing list