Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315736

Re: struct pid memory leak

From Eric Dumazet <edumazet@google.com>
Newsgroups linux.kernel
Subject Re: struct pid memory leak
Date 2016-01-23 21:00 +0100
Message-ID <qUcvM-7Cq-7@gated-at.bofh.it> (permalink)
References (1 earlier) <qTNe3-6HG-19@gated-at.bofh.it> <qUaNk-6xr-5@gated-at.bofh.it> <qUaX0-6Bi-5@gated-at.bofh.it> <qUbq1-6PU-7@gated-at.bofh.it> <qUbq1-6PU-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Jan 23, 2016 at 10:46 AM, Dmitry Vyukov <dvyukov@google.com> wrote:
> On Sat, Jan 23, 2016 at 7:40 PM, Willy Tarreau <w@1wt.eu> wrote:
>> On Sat, Jan 23, 2016 at 07:14:33PM +0100, Dmitry Vyukov wrote:
>>> I've attached my .config.
>>> Also run this program in a parallel loop. I think it's leaking not
>>> every time, probably some race is involved.
>>
>> Thank you. Just in order to confirm, am I supposed to see the
>> messages you quoted in dmesg ?
>
>
> I think the simplest way to confirm that you can reproduce it locally
> is to check /proc/slabinfo. When I run this program in a parallel
> loop, number of objects in pid cache was constantly growing:
>
> # cat /proc/slabinfo | grep pid
> pid                  297    532    576   28    4 : tunables    0    0
>   0 : slabdata     19     19      0
> ...
> pid                  412    532    576   28    4 : tunables    0    0
>   0 : slabdata     19     19      0
> ...
> pid                 1107   1176    576   28    4 : tunables    0    0
>   0 : slabdata     42     42      0
> ...
> pid                 1545   1652    576   28    4 : tunables    0    0
>   0 : slabdata     59     59      0
>
>
> If you want to use kmemleak, then you need to run this program in a
> parallel loop for some time, then stop it and then:
>
> $ echo scan > /sys/kernel/debug/kmemleak
> $ cat /sys/kernel/debug/kmemleak
>
> If kmemleak has detected any leaks, cat will show them. I noticed that
> kmemleak can delay leaks with significant delay, so usually I do scan
> at least 5 times.

Note that kmemleak is not needed.

Just run a normal kernel (eventually using slab_nomerge=1 boot cmd to
make sure 'pid' slab is not shared)

It seems that bug is rather old, as linux-4.0 has it.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

struct pid memory leak Dmitry Vyukov <dvyukov@google.com> - 2016-01-22 16:10 +0100
  Re: struct pid memory leak Eric Dumazet <eric.dumazet@gmail.com> - 2016-01-22 18:00 +0100
    Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-23 19:10 +0100
      Re: struct pid memory leak Dmitry Vyukov <dvyukov@google.com> - 2016-01-23 19:50 +0100
        Re: struct pid memory leak Eric Dumazet <edumazet@google.com> - 2016-01-23 21:00 +0100
        Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-24 03:20 +0100
          Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-24 03:40 +0100
            Re: struct pid memory leak Eric Dumazet <edumazet@google.com> - 2016-01-24 04:00 +0100
              Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-24 04:10 +0100
                Re: struct pid memory leak Eric Dumazet <edumazet@google.com> - 2016-01-24 22:20 +0100
                [PATCH net] af_unix: fix struct pid memory leak Eric Dumazet <eric.dumazet@gmail.com> - 2016-01-24 23:00 +0100
                Re: [PATCH net] af_unix: fix struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-25 02:10 +0100
      Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-23 19:50 +0100

csiph-web