2019-07-30 16:40:52

by Nicolas Boichat

[permalink] [raw]
Subject: [PATCH] kmemleak: Increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K

The current default value (400) is too low on many systems (e.g.
some ARM64 platform takes up 1000+ entries).

syzbot uses 16000 as default value, and has proved to be enough
on beefy configurations, so let's pick that value.

This consumes more RAM on boot (each entry is 160 bytes, so
in total ~2.5MB of RAM), but the memory would later be freed
(early_log is __initdata).

Suggested-by: Dmitry Vyukov <[email protected]>
Signed-off-by: Nicolas Boichat <[email protected]>
---
lib/Kconfig.debug | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index f567875b87657de..b5a24045ab13310 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -596,7 +596,7 @@ config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
int "Maximum kmemleak early log entries"
depends on DEBUG_KMEMLEAK
range 200 40000
- default 400
+ default 16000
help
Kmemleak must track all the memory allocations to avoid
reporting false positives. Since memory may be allocated or
--
2.22.0.709.g102302147b-goog


2019-07-30 16:40:59

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] kmemleak: Increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K

On Tue, Jul 30, 2019 at 11:40:27PM +0800, Nicolas Boichat wrote:
> The current default value (400) is too low on many systems (e.g.
> some ARM64 platform takes up 1000+ entries).
>
> syzbot uses 16000 as default value, and has proved to be enough
> on beefy configurations, so let's pick that value.
>
> This consumes more RAM on boot (each entry is 160 bytes, so
> in total ~2.5MB of RAM), but the memory would later be freed
> (early_log is __initdata).
>
> Suggested-by: Dmitry Vyukov <[email protected]>
> Signed-off-by: Nicolas Boichat <[email protected]>

Acked-by: Catalin Marinas <[email protected]>

2019-07-30 18:05:16

by Dmitry Vyukov

[permalink] [raw]
Subject: Re: [PATCH] kmemleak: Increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K

On Tue, Jul 30, 2019 at 5:42 PM Catalin Marinas <[email protected]> wrote:
>
> On Tue, Jul 30, 2019 at 11:40:27PM +0800, Nicolas Boichat wrote:
> > The current default value (400) is too low on many systems (e.g.
> > some ARM64 platform takes up 1000+ entries).
> >
> > syzbot uses 16000 as default value, and has proved to be enough
> > on beefy configurations, so let's pick that value.
> >
> > This consumes more RAM on boot (each entry is 160 bytes, so
> > in total ~2.5MB of RAM), but the memory would later be freed
> > (early_log is __initdata).
> >
> > Suggested-by: Dmitry Vyukov <[email protected]>
> > Signed-off-by: Nicolas Boichat <[email protected]>
>
> Acked-by: Catalin Marinas <[email protected]>

Acked-by: Dmitry Vyukov <[email protected]>