linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/slab: support kmalloc_nolock() -> kfree[_rcu]()
@ 2026-02-09 12:10 Harry Yoo
  2026-02-09 12:10 ` [PATCH 1/2] mm/slab: allow freeing kmalloc_nolock()'d objects using kfree[_rcu]() Harry Yoo
  2026-02-09 12:10 ` [PATCH 2/2] mm/slab: free a bit in enum objexts_flags Harry Yoo
  0 siblings, 2 replies; 6+ messages in thread
From: Harry Yoo @ 2026-02-09 12:10 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka
  Cc: Christoph Lameter, David Rientjes, Roman Gushchin, Hao Li,
	Alexei Starovoitov, Catalin Marinas, Uladzislau Rezki,
	Suren Baghdasaryan, linux-mm, Harry Yoo

This is separated from the RFC version of "k[v]free_rcu() improvements"
series [1], as these changes are relatively small and beneficial for BPF
because it enables the bpf code to use kfree_rcu() instead of
call_rcu() + kfree_nolock().

Hopefully we can get acks from kmemleak folks for kmemleak part in
patch 1, if it looks good for them.

Patch 1 allows kfree() and kfree_rcu() to be used with objects that are
allocated from kmalloc_nolock().

Patch 2 is a cleanup that frees a bit used to record whether obj_exts
was allocated using kmalloc_nolock() or kmalloc(), since now both cases
can be freed with kfree().

[1] https://lore.kernel.org/linux-mm/20260206093410.160622-1-harry.yoo@oracle.com

RFC -> v1:
- Added acked-bys from Alexei, thanks!

- Patch 1: While developing the RFC version, I mistakenly thought that
  removing "Trying to color unknown object at ..." warning in
  paint_ptr() became unnecessary after changing the kfree_rcu_nolock()
  implementation several times, but during testing I discovered this is
  still needed to silence the warning in kmalloc_nolock() -> kfree_rcu()
  (-> kmemleak_ignore()) path.

  So removed the warning in paint_ptr() again.

Harry Yoo (2):
  mm/slab: allow freeing kmalloc_nolock()'d objects using kfree[_rcu]()
  mm/slab: free a bit in enum objexts_flags

 include/linux/memcontrol.h |  3 +--
 include/linux/rcupdate.h   |  4 ++--
 mm/kmemleak.c              | 22 ++++++++++------------
 mm/slub.c                  | 33 ++++++++++++++++++++++-----------
 4 files changed, 35 insertions(+), 27 deletions(-)


base-commit: f6ed7e47c1fc78e78c9bfeb668b1ad9ba5c58120
-- 
2.43.0



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

end of thread, other threads:[~2026-02-10  1:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-09 12:10 [PATCH 0/2] mm/slab: support kmalloc_nolock() -> kfree[_rcu]() Harry Yoo
2026-02-09 12:10 ` [PATCH 1/2] mm/slab: allow freeing kmalloc_nolock()'d objects using kfree[_rcu]() Harry Yoo
2026-02-09 18:34   ` Catalin Marinas
2026-02-10  1:50     ` Harry Yoo
2026-02-09 12:10 ` [PATCH 2/2] mm/slab: free a bit in enum objexts_flags Harry Yoo
2026-02-10  1:44   ` Harry Yoo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox