linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhenhua Huang <quic_zhenhuah@quicinc.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: <rientjes@google.com>, <vbabka@suse.cz>, <cl@gentwo.org>,
	<roman.gushchin@linux.dev>, <harry.yoo@oracle.com>,
	<surenb@google.com>, <pasha.tatashin@soleen.com>,
	<akpm@linux-foundation.org>, <corbet@lwn.net>,
	<linux-mm@kvack.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <quic_tingweiz@quicinc.com>
Subject: Re: [PATCH 1/1] mm: slub: Introduce one knob to control the track of slub object
Date: Thu, 24 Jul 2025 11:57:39 +0800	[thread overview]
Message-ID: <95f2a23d-5ef0-473b-b3f0-c6d828cf8636@quicinc.com> (raw)
In-Reply-To: <mw52yqm7wfe5afb5ybvfkpdgo4pm4wobmzv3um2cov3amekzmi@ye5drijf7njj>



On 2025/7/23 19:31, Kent Overstreet wrote:
>> While In some scenarios, we may choose not to delve into SLUB allocation
>> details if initial triage indicates that SLUB memory usage is within
>> acceptable limits. To support this, a control knob is introduced to enable
>> or disable SLUB object tracking.
>> The "noslub" knob disables SLUB tracking, preventing further allocation of
>> slabobj_ext structures.
> ...Have there been actual scenarios where this would be useful?
> 
> We've already got a knob for memory allocation profiling as a whole;
> most allocations are slub allocations, so if you're looking at memory
> allocation profiling you probably want slub.

Hi Kent,

Let me elaborate a bit on the work we're doing. Some OEMs are interested 
in enabling this lightweight debug feature to help identify potential 
memory leaks on their devices. In the past, we depended on mechanisms 
such as page owner for tracking, but due to their overhead, they were 
not suitable for deployment on production devices. In response, our team 
is developing a post-processing script(may need to parse source code as 
well)—to classify memory usage accordingly.

One output example FYI:
version: 1.0
MemInfo                        :    Size_KB    Size_MB
slab                           :     440088     429.77
vmalloc                        :      71416      69.74
pgd                            :        888       0.87
pte                            :     104492     102.04
pmd                            :      12732      12.43
pageowner                      :     437760     427.50
module                         :          0       0.00
kernelStack                    :      54346      53.07
shmem                          :      18284      17.86
KDA                            :     188516     184.10
anon                           :     867120     846.80
ion                            :     420576     410.72
kgsl                           :      70328      68.68
CMA                            :     130992     127.92
file                           :    2037140    1989.39
zram                           :     156532     152.86
binder                         :          0       0.00
migrate                        :          0       0.00
Couldn't Parse                 :         17       0.02
slab_alone                     :     478939     467.71

In this case, we may not need to dive into slab-level details. Instead, 
our initial focus should be on checking KDA(that is, pages that are 
allocated but not tracked by any statistics). In other words, for a 
quick snapshot, it's unnecessary to analyze slab internals. If we need 
to debug specific slab leaks, we can even afford to enable slab_debug=U.

The key requirement is to make this feature suitable for deployment in 
production devices, as requested by OEMs. The 16-byte per-object 
overhead represents the highest cost in its current form, and we are 
exploring options to optimize it.



      reply	other threads:[~2025-07-24  3:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23  8:03 Zhenhua Huang
2025-07-23  9:19 ` Harry Yoo
2025-07-23 10:21   ` Zhenhua Huang
2025-07-23 11:38   ` Kent Overstreet
2025-07-24  3:29     ` Zhenhua Huang
2025-07-23 11:31 ` Kent Overstreet
2025-07-24  3:57   ` Zhenhua Huang [this message]

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=95f2a23d-5ef0-473b-b3f0-c6d828cf8636@quicinc.com \
    --to=quic_zhenhuah@quicinc.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=corbet@lwn.net \
    --cc=harry.yoo@oracle.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=quic_tingweiz@quicinc.com \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /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