lkml.org 
[lkml]   [2023]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mm: kfence: allocate kfence_metadata at runtime
From


在 2023/7/10 18:37, Alexander Potapenko 写道:
> On Mon, Jul 10, 2023 at 5:27 AM 'Peng Zhang' via kasan-dev
> <kasan-dev@googlegroups.com> wrote:
>>
>> kfence_metadata is currently a static array. For the purpose of
>> allocating scalable __kfence_pool, we first change it to runtime
>> allocation of metadata. Since the size of an object of kfence_metadata
>> is 1160 bytes, we can save at least 72 pages (with default 256 objects)
>> without enabling kfence.
>>
>> Below is the numbers obtained in qemu (with default 256 objects).
>> before: Memory: 8134692K/8388080K available (3668K bss)
>> after: Memory: 8136740K/8388080K available (1620K bss)
>> More than expected, it saves 2MB memory.
>
> Do you have an understanding of where these 2MB come from?
> According to your calculations (which seem valid) the gain should be
> 290K, so either 2MB is irrelevant to your change (then these numbers
> should be omitted), or there's some hidden cost that we do not know
> about.
I don't know why the 2MB memory was saved, but it looks like it has to
do with the .bss section, maybe removing this array affected the linker?

\
 
 \ /
  Last update: 2023-07-10 12:59    [W:0.274 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site