Linux Documentation
 help / color / mirror / Atom feed
* [PATCH v2 0/4] mm/slub: preserve previous object lifetime
@ 2026-08-13 16:08 Pengpeng Hou
  2026-08-13 16:10 ` [PATCH v2 1/4] mm/slub: use a track count for user metadata sizing Pengpeng Hou
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Pengpeng Hou @ 2026-08-13 16:08 UTC (permalink / raw)
  To: Vlastimil Babka, Andrew Morton, linux-mm
  Cc: Harry Yoo, Hao Li, Christoph Lameter, David Rientjes,
	Roman Gushchin, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Jonathan Corbet, Shuah Khan, linux-doc, linux-kernel,
	Pengpeng Hou

SLAB_STORE_USER records one allocation and one free track per object.  A
new allocation overwrites the allocation track, and a later stale free can
overwrite the free track, so the completed lifetime that produced the
stale reference is no longer available in the report.

Extend the existing U option directly, as discussed on the RFC, to retain
one previous completed allocation/free pair.  The records remain address
history only; they do not infer semantic ownership.  The series also adds
KUnit coverage and documents the additional report section.

Changes since v1:
https://lore.kernel.org/all/20260616141410.52117-1-pengpeng@iscas.ac.cn/
- extend U directly instead of adding a separate H option
- use TRACK_NR in every user-metadata layout calculation
- copy the completed pair with explicit track assignments
- keep the current free track until a later free replaces it
- pin the KUnit task across immediate free and reuse

Testing used Linux 3d6d817622b0, GCC 13.3 and QEMU 8.2.2 for x86_64.
The focused SLUB KUnit test passed, including immediate free/reuse and
verification that the completed allocation/free pair moved to the
previous-lifetime slots.

A temporary KUnit probe, not part of this series, recorded the internal
cache slot size and objects per order-0 slab before and after the series:

  object bytes    U slot/objects    patched slot/objects
       32              96/42              160/25
       64             128/32              192/21
      128             192/21              256/16
      256             320/12              384/10

All four caches retained slab order 0.  The table quantifies the expected
per-object metadata cost only for caches using SLAB_STORE_USER; caches
without U do not allocate these track records.

Pengpeng Hou (4):
  mm/slub: use a track count for user metadata sizing
  mm/slub: preserve one previous object lifetime
  mm/slub: test previous lifetime tracking
  Documentation/mm: describe SLUB previous lifetime tracking

 Documentation/admin-guide/mm/slab.rst | 13 ++++-
 lib/tests/slub_kunit.c                | 35 ++++++++++++++
 mm/slab.h                             |  4 ++
 mm/slub.c                             | 69 ++++++++++++++++++++-------
 4 files changed, 104 insertions(+), 17 deletions(-)


base-commit: 3d6d817622b0a9721e3cc404df3469171582be13
-- 
2.50.1 (Apple Git-155)


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

end of thread, other threads:[~2026-08-17 10:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 16:08 [PATCH v2 0/4] mm/slub: preserve previous object lifetime Pengpeng Hou
2026-08-13 16:10 ` [PATCH v2 1/4] mm/slub: use a track count for user metadata sizing Pengpeng Hou
2026-08-17 10:04   ` Hao Li
2026-08-13 16:12 ` [PATCH v2 2/4] mm/slub: preserve one previous object lifetime Pengpeng Hou
2026-08-17 10:30   ` Hao Li
2026-08-13 16:14 ` [PATCH v2 3/4] mm/slub: test previous lifetime tracking Pengpeng Hou
2026-08-13 16:17 ` [PATCH v2 4/4] Documentation/mm: describe SLUB " Pengpeng Hou

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