lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91e59f27-27a8-4504-bacb-3e96ef1e6bbd@quicinc.com>
Date: Thu, 24 Jul 2025 11:29:16 +0800
From: Zhenhua Huang <quic_zhenhuah@...cinc.com>
To: Kent Overstreet <kent.overstreet@...ux.dev>,
        Harry Yoo
	<harry.yoo@...cle.com>
CC: <rientjes@...gle.com>, <vbabka@...e.cz>, <cl@...two.org>,
        <roman.gushchin@...ux.dev>, <surenb@...gle.com>,
        <pasha.tatashin@...een.com>, <akpm@...ux-foundation.org>,
        <corbet@....net>, <linux-mm@...ck.org>, <linux-doc@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <quic_tingweiz@...cinc.com>
Subject: Re: [PATCH 1/1] mm: slub: Introduce one knob to control the track of
 slub object



On 2025/7/23 19:38, Kent Overstreet wrote:
> On Wed, Jul 23, 2025 at 06:19:45PM +0900, Harry Yoo wrote:
>> The subject is a bit misleading. I think it should be something like
>> "alloc_tag: add an option to disable slab object accounting".
>>
>> On Wed, Jul 23, 2025 at 04:03:28PM +0800, Zhenhua Huang wrote:
>>> Mem profiling feature tracks both "alloc_slab_page"(page level) and slub
>>> object level allocations. To track object level allocations,
>>> slabobj_ext consumes 16 bytes per object for profiling slub object if
>>> CONFIG_MEMCG is set.
>>> Based on the data I've collected, this overhead accounts for approximately
>>> 5.7% of slub memory usage — a considerable cost.
>>> w/ noslub  slub_debug=-
>>> Slab:              87520 kB
>>> w/o noslub slub_debug=-
>>> Slab:              92812 kB
>>
>> Yes, the cost is not small and I hate that we have to pay 16 bytes of
>> memory overhead for each slab object when both memcg and memory profiling
>> are enabled.
> 
> I believe we did something about this for page_obj_ext; the exact
> pointer compression scheme we went with escapes me at the moment.
> 

Hi Kent,

I recall that it used page flags for compression — not actual pointers, 
but rather *idx*. Since every page has a corresponding struct page, that 
makes this approach feasible. However, it seems this assumption doesn't 
hold for slab objects.

> We did it for page and not slab because page_obj_ext is a large fixed
> size overhead and the page allocator is slower anyways, but it's
> conceivable we could do the same for slub if the memory overhead vs. cpu
> overhead tradeoff is worth it.
> 
> And - pointer compression is a valuable technique in general; coming up
> with some fast general purpose code (perhaps involving virtual mappings,
> we're not so limited on virtual address space as we used to be) might be
> worth someone's time exploring.
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ