]> www.infradead.org Git - users/willy/pagecache.git/commit
ucount: use rcuref_t for reference counting
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 3 Feb 2025 15:05:25 +0000 (16:05 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 14 Mar 2025 22:56:01 +0000 (15:56 -0700)
commitf05cfcf565439048fb76a2c95022cea9548ed58d
tree106d7ac67491b89e7a1cb1095ec777d325ffee4a
parent72c51bb0ca3e572d08c7dd5aa77f8617475fc2dd
ucount: use rcuref_t for reference counting

Use rcuref_t for reference counting.  This eliminates the cmpxchg loop in
the get and put path.  This also eliminates the need to acquire the lock
in the put path because once the final user returns the reference, it can
no longer be obtained anymore.

Use rcuref_t for reference counting.

Link: https://lkml.kernel.org/r/20250203150525.456525-5-bigeasy@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Lai jiangshan <jiangshanlai@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Mengen Sun <mengensun@tencent.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: YueHong Wu <yuehongwu@tencent.com>
Cc: Zqiang <qiang.zhang1211@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/user_namespace.h
kernel/ucount.c