From: Pengpeng Hou <pengpeng@iscas.ac.cn>
To: Vlastimil Babka <vbabka@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Cc: Harry Yoo <harry@kernel.org>, Hao Li <hao.li@linux.dev>,
Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Pengpeng Hou <pengpeng@iscas.ac.cn>
Subject: [PATCH v2 0/4] mm/slub: preserve previous object lifetime
Date: Fri, 14 Aug 2026 00:08:25 +0800 [thread overview]
Message-ID: <20260813160825.73031-1-pengpeng@iscas.ac.cn> (raw)
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)
next reply other threads:[~2026-08-13 16:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 16:08 Pengpeng Hou [this message]
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
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=20260813160825.73031-1-pengpeng@iscas.ac.cn \
--to=pengpeng@iscas.ac.cn \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=hao.li@linux.dev \
--cc=harry@kernel.org \
--cc=liam@infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
/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