All of lore.kernel.org
 help / color / mirror / Atom feed
* + rcu-provide-a-static-initializer-for-hlist_nulls_head.patch added to mm-nonmm-unstable branch
@ 2025-02-07 23:51 Andrew Morton
  2025-02-12 15:34 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2025-02-07 23:51 UTC (permalink / raw)
  To: mm-commits, yuehongwu, urezki, tglx, rostedt, qiang.zhang1211,
	paulmck, mengensun, mathieu.desnoyers, josh, joel, jiangshanlai,
	boqun.feng, bigeasy, akpm


The patch titled
     Subject: rcu: provide a static initializer for hlist_nulls_head
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     rcu-provide-a-static-initializer-for-hlist_nulls_head.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/rcu-provide-a-static-initializer-for-hlist_nulls_head.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: rcu: provide a static initializer for hlist_nulls_head
Date: Mon, 3 Feb 2025 16:05:22 +0100

Patch series "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.


This patch (of 4):

Provide a static initializer for hlist_nulls_head so that it can be used
in statically defined data structures.

Link: https://lkml.kernel.org/r/20250203150525.456525-1-bigeasy@linutronix.de
Link: https://lkml.kernel.org/r/20250203150525.456525-2-bigeasy@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Acked-by:Thomas Gleixner <tglx@linutronix.de>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
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: "Paul E . McKenney" <paulmck@kernel.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/list_nulls.h |    1 +
 1 file changed, 1 insertion(+)

--- a/include/linux/list_nulls.h~rcu-provide-a-static-initializer-for-hlist_nulls_head
+++ a/include/linux/list_nulls.h
@@ -28,6 +28,7 @@ struct hlist_nulls_node {
 #define NULLS_MARKER(value) (1UL | (((long)value) << 1))
 #define INIT_HLIST_NULLS_HEAD(ptr, nulls) \
 	((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls))
+#define HLIST_NULLS_HEAD_INIT(nulls) {.first = (struct hlist_nulls_node *)NULLS_MARKER(nulls)}
 
 #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member)
 
_

Patches currently in -mm which might be from bigeasy@linutronix.de are

rcu-provide-a-static-initializer-for-hlist_nulls_head.patch
ucount-replace-get_ucounts_or_wrap-with-atomic_inc_not_zero.patch
ucount-use-rcu-for-ucounts-lookups.patch
ucount-use-rcuref_t-for-reference-counting.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: + rcu-provide-a-static-initializer-for-hlist_nulls_head.patch added to mm-nonmm-unstable branch
  2025-02-07 23:51 + rcu-provide-a-static-initializer-for-hlist_nulls_head.patch added to mm-nonmm-unstable branch Andrew Morton
@ 2025-02-12 15:34 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-02-12 15:34 UTC (permalink / raw)
  To: Andrew Morton
  Cc: mm-commits, yuehongwu, urezki, tglx, rostedt, qiang.zhang1211,
	paulmck, mengensun, mathieu.desnoyers, josh, joel, jiangshanlai,
	boqun.feng

Thank you picking up the series.

On 2025-02-07 15:51:20 [-0800], Andrew Morton wrote:
> 
> The patch titled
>      Subject: rcu: provide a static initializer for hlist_nulls_head
> has been added to the -mm mm-nonmm-unstable branch.  Its filename is
>      rcu-provide-a-static-initializer-for-hlist_nulls_head.patch
> Link: https://lkml.kernel.org/r/20250203150525.456525-1-bigeasy@linutronix.de
> Link: https://lkml.kernel.org/r/20250203150525.456525-2-bigeasy@linutronix.de
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
> Cc: Acked-by:Thomas Gleixner <tglx@linutronix.de>

This and the following three patches have a Cc: in front of the tag and
there could be a space after the tag before the name.
[I haven't seen tglx replying to this series but then there are other
channels…]

Sebastian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-12 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07 23:51 + rcu-provide-a-static-initializer-for-hlist_nulls_head.patch added to mm-nonmm-unstable branch Andrew Morton
2025-02-12 15:34 ` Sebastian Andrzej Siewior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.