Skip to contentSkip to conversation

mm/slab: stop exporting kvfree_rcu_barrier[_on_cache]()

PATCH Applied Vlastimil Babka (SUSE) 3 participants 7 messages Jul 30 – Aug 3

Subsystems (3)
lore
Share & tools
lore

Vlastimil Babka (SUSE)

author maintainer
#0 lore raw

PATCH 1/1 mm/slab: stop exporting kvfree_rcu_barrier[_on_cache]()

No module code calls these functions directly. Seems it was always the case. Remove the exports.

---
Based on slab/for-7.3/kfree_rcu_nolock

---
 mm/slab_common.c | 4 ----
 1 file changed, 4 deletions(-)
mm/slab_common.c +0 -4
index 6750dfa27367..cd155ffc2762 100644
@@ -1329,14 +1329,12 @@ void kvfree_rcu_barrier(void)
 	deferred_work_barrier();
 	rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
 
 void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
 {
 	deferred_work_barrier();
 	rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier_on_cache);
 
 void __init kvfree_rcu_init(void)
 {
@@ -2163,7 +2161,6 @@ void kvfree_rcu_barrier(void)
 	flush_all_rcu_sheaves();
 	__kvfree_rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
 
 /**
  * kvfree_rcu_barrier_on_cache - Wait for in-flight kvfree_rcu() calls on a
@@ -2186,7 +2183,6 @@ void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
 	rcu_barrier();
 	__kvfree_rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier_on_cache);
 
 static unsigned long
 kfree_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc)

---
base-commit: b01f6ed9ff0c4581fc669044fa5b82a93b4ef144
change-id: 20260730-unexport-barriers-439b3f69f791

maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Vlastimil Babka (SUSE)

No module code calls these functions directly. Seems it was always the case. Remove the exports.

Which reminds me... Are you guys interested in taking the kfree_rcu() test code from kernel/rcu/rcuscale.c? See for example the kfree_rcu_test module parameter.

Thanx, Paul

Quoted 47 lines

---
Based on slab/for-7.3/kfree_rcu_nolock

---
 mm/slab_common.c | 4 ----
 1 file changed, 4 deletions(-)
mm/slab_common.c +0 -5
index 6750dfa27367..cd155ffc2762 100644
@@ -1329,14 +1329,12 @@ void kvfree_rcu_barrier(void)
 	deferred_work_barrier();
 	rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
 
 void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
 {
 	deferred_work_barrier();
 	rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier_on_cache);
 
 void __init kvfree_rcu_init(void)
 {
@@ -2163,7 +2161,6 @@ void kvfree_rcu_barrier(void)
 	flush_all_rcu_sheaves();
 	__kvfree_rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
 
 /**
  * kvfree_rcu_barrier_on_cache - Wait for in-flight kvfree_rcu() calls on a
@@ -2186,7 +2183,6 @@ void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
 	rcu_barrier();
 	__kvfree_rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier_on_cache);
 
 static unsigned long
 kfree_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 
---

base-commit: b01f6ed9ff0c4581fc669044fa5b82a93b4ef144
change-id: 20260730-unexport-barriers-439b3f69f791

author maintainer
#2 lore raw
Quoted 7 lines · Paul E. McKenney
Quoted 4 lines · Vlastimil Babka (SUSE)

No module code calls these functions directly. Seems it was always the case. Remove the exports.

Thanks!

Quoted 3 lines

Which reminds me... Are you guys interested in taking the kfree_rcu() test code from kernel/rcu/rcuscale.c? See for example the kfree_rcu_test module parameter.

Hmm, we have a slub kunit test, but I think no such torture/scaling test infra. Maybe once we have that? What do you think, Harry?

Quoted 49 lines

Thanx, Paul

Quoted 47 lines

---
Based on slab/for-7.3/kfree_rcu_nolock

---
 mm/slab_common.c | 4 ----
 1 file changed, 4 deletions(-)
mm/slab_common.c +0 -5
index 6750dfa27367..cd155ffc2762 100644
@@ -1329,14 +1329,12 @@ void kvfree_rcu_barrier(void)
 	deferred_work_barrier();
 	rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
 
 void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
 {
 	deferred_work_barrier();
 	rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier_on_cache);
 
 void __init kvfree_rcu_init(void)
 {
@@ -2163,7 +2161,6 @@ void kvfree_rcu_barrier(void)
 	flush_all_rcu_sheaves();
 	__kvfree_rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
 
 /**
  * kvfree_rcu_barrier_on_cache - Wait for in-flight kvfree_rcu() calls on a
@@ -2186,7 +2183,6 @@ void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
 	rcu_barrier();
 	__kvfree_rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier_on_cache);
 
 static unsigned long
 kfree_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 
---

base-commit: b01f6ed9ff0c4581fc669044fa5b82a93b4ef144
change-id: 20260730-unexport-barriers-439b3f69f791

maintainer
#3 lore raw
Quoted 8 lines · Vlastimil Babka (SUSE)
Quoted 4 lines · Paul E. McKenney

On Thu, Jul 30, 2026 at 04:32:46PM +0200, Vlastimil Babka (SUSE) wrote:
Which reminds me... Are you guys interested in taking the kfree_rcu() test code from kernel/rcu/rcuscale.c? See for example the kfree_rcu_test module parameter.

Hmm, we have a slub kunit test, but I think no such torture/scaling test infra. Maybe once we have that? What do you think, Harry?

That'd be definitely useful. We have been reviving performance tests every time we wondered if it'd affect performance in a surprising way. But we've never put that in the mainline ;)

Probably test_kmalloc_nolock_and_friends*() don't even belong slub_kunit.

Perhaps worth starting small with lib/test_slab.c, and slowly move/add torture/scaling tests to there?

Signature · 2 lines
Cheers,
Harry / Hyeonggon
maintainer
#4 lore raw
Quoted 14 lines · Harry Yoo
Quoted 8 lines · Vlastimil Babka (SUSE)
Quoted 4 lines · Paul E. McKenney

On Thu, Jul 30, 2026 at 04:32:46PM +0200, Vlastimil Babka (SUSE) wrote:
Which reminds me... Are you guys interested in taking the kfree_rcu() test code from kernel/rcu/rcuscale.c? See for example the kfree_rcu_test module parameter.

Hmm, we have a slub kunit test, but I think no such torture/scaling test infra. Maybe once we have that? What do you think, Harry?

That'd be definitely useful. We have been reviving performance tests every time we wondered if it'd affect performance in a surprising way. But we've never put that in the mainline ;)

Quoted 5 lines

Probably test_kmalloc_nolock_and_friends*() don't even belong slub_kunit.

Perhaps worth starting small with lib/test_slab.c, and slowly move/add torture/scaling tests to there?

That would work for me.

Thanx, Paul

author maintainer Applied
#6 lore raw
In reply to Vlastimil Babka (SUSE)
Quoted 6 lines · Vlastimil Babka (SUSE)

No module code calls these functions directly. Seems it was always the case. Remove the exports.

---
Based on slab/for-7.3/kfree_rcu_nolock

Applied to that branch and slab/for-next

Quoted 44 lines
---
 mm/slab_common.c | 4 ----
 1 file changed, 4 deletions(-)
mm/slab_common.c +0 -5
index 6750dfa27367..cd155ffc2762 100644
@@ -1329,14 +1329,12 @@ void kvfree_rcu_barrier(void)
 	deferred_work_barrier();
 	rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
 
 void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
 {
 	deferred_work_barrier();
 	rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier_on_cache);
 
 void __init kvfree_rcu_init(void)
 {
@@ -2163,7 +2161,6 @@ void kvfree_rcu_barrier(void)
 	flush_all_rcu_sheaves();
 	__kvfree_rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
 
 /**
  * kvfree_rcu_barrier_on_cache - Wait for in-flight kvfree_rcu() calls on a
@@ -2186,7 +2183,6 @@ void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
 	rcu_barrier();
 	__kvfree_rcu_barrier();
 }
-EXPORT_SYMBOL_GPL(kvfree_rcu_barrier_on_cache);
 
 static unsigned long
 kfree_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 
---

base-commit: b01f6ed9ff0c4581fc669044fa5b82a93b4ef144
change-id: 20260730-unexport-barriers-439b3f69f791