mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	MengEn Sun <mengensun@tencent.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	YueHong Wu <yuehongwu@tencent.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang1211@gmail.com>
Subject: Re: [PATCH 0/4] ucount: Simplify refcounting with rcuref_t.
Date: Mon, 3 Feb 2025 18:00:35 -0800	[thread overview]
Message-ID: <fc4c3ed1-aa8b-48c4-92ca-6d177efa869a@paulmck-laptop> (raw)
In-Reply-To: <20250203150525.456525-1-bigeasy@linutronix.de>

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@kernel.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
> 

  parent reply	other threads:[~2025-02-04  2:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 15:05 Sebastian Andrzej Siewior
2025-02-03 15:05 ` [PATCH 1/4] rcu: Provide a static initializer for hlist_nulls_head Sebastian Andrzej Siewior
2025-02-03 15:05 ` [PATCH 2/4] ucount: Replace get_ucounts_or_wrap() with atomic_inc_not_zero() Sebastian Andrzej Siewior
2025-02-03 15:05 ` [PATCH 3/4] ucount: Use RCU for ucounts lookups Sebastian Andrzej Siewior
2025-02-03 15:05 ` [PATCH 4/4] ucount: Use rcuref_t for reference counting Sebastian Andrzej Siewior
2025-02-04  2:00 ` Paul E. McKenney [this message]
2025-02-07 20:48 ` [PATCH 0/4] ucount: Simplify refcounting with rcuref_t Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc4c3ed1-aa8b-48c4-92ca-6d177efa869a@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=boqun.feng@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mengensun@tencent.com \
    --cc=qiang.zhang1211@gmail.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=urezki@gmail.com \
    --cc=yuehongwu@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®