[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fc4c3ed1-aa8b-48c4-92ca-6d177efa869a@paulmck-laptop>
Date: Mon, 3 Feb 2025 18:00:35 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-kernel@...r.kernel.org, rcu@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
MengEn Sun <mengensun@...cent.com>,
Thomas Gleixner <tglx@...utronix.de>,
YueHong Wu <yuehongwu@...cent.com>,
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>
Subject: Re: [PATCH 0/4] ucount: Simplify refcounting with rcuref_t.
On Mon, Feb 03, 2025 at 04:05:21PM +0100, Sebastian Andrzej Siewior wrote:
> 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.
The modification and later elimination of get_ucounts() threw me for
a bit, but for the series:
Reviewed-by: Paul E. McKenney <paulmck@...nel.org>
> 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