[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250203150525.456525-1-bigeasy@linutronix.de>
Date: Mon, 3 Feb 2025 16:05:21 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: linux-kernel@...r.kernel.org,
rcu@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
MengEn Sun <mengensun@...cent.com>,
Thomas Gleixner <tglx@...utronix.de>,
YueHong Wu <yuehongwu@...cent.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Joel Fernandes <joel@...lfernandes.org>,
Josh Triplett <josh@...htriplett.org>,
Boqun Feng <boqun.feng@...il.com>,
Uladzislau Rezki <urezki@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Zqiang <qiang.zhang1211@...il.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: [PATCH 0/4] ucount: Simplify refcounting with rcuref_t.
I noticed that the atomic_dec_and_lock_irqsave() in put_ucounts() loops
sometimes even during boot. Something like 2-3 iterations but still.
This series replaces the refcounting with rcuref_t and adds a RCU
lookup.
This allows a lockless lookup in alloc_ucounts() if the entry is
available and a cmpxchg()less put of the item.
Patch #1 adds HLIST_NULLS_HEAD_INIT for which I added the RCU folks.
Sebastian
Sebastian Andrzej Siewior (4):
rcu: Provide a static initializer for hlist_nulls_head.
ucount: Replace get_ucounts_or_wrap() with atomic_inc_not_zero().
ucount: Use RCU for ucounts lookups.
ucount: Use rcuref_t for reference counting.
include/linux/list_nulls.h | 1 +
include/linux/user_namespace.h | 15 ++++--
kernel/ucount.c | 97 +++++++++++++++-------------------
3 files changed, 55 insertions(+), 58 deletions(-)
--
2.47.2
Powered by blists - more mailing lists