[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181127095843.GF19871@piout.net>
Date: Tue, 27 Nov 2018 10:58:43 +0100
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: richard.genoud@...il.com
Cc: Ludovic Desroches <ludovic.desroches@...rochip.com>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Vinod Koul <vinod.koul@...el.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, dmaengine@...r.kernel.org,
Linux Kernel <linux-kernel@...r.kernel.org>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
Mario Forner <m.forner@...energy.com>
Subject: Re: DMA: atmel_serial: Opening and closing the serial device
repeatedly causes kmalloc-32 slab leak
Hello Richard,
On 27/11/2018 10:51:13+0100, richard.genoud@...il.com wrote:
> Hi all,
>
> I reproduced the memory leak on my board (at91sam9g35-cm) with a 4.20-rc3.
>
> It triggered an OOM after a couple of hours running a code like this:
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <unistd.h>
>
>
> int main(int argc, char **argv)
> {
> int fd;
> do {
> fd = open("/dev/ttyS1", O_RDONLY);
> close(fd);
> } while (true);
> return 0;
> }
>
> As Mario pointed out, this only happens when atmel,use-dma-{r,t}x are
> used in the device-tree.
>
> Adding:
> CONFIG_DEBUG_SLAB=y
> CONFIG_DEBUG_SLAB_LEAK=y
> Doesn't show anything suspect in /proc/slab_allocators
>
> From what I found until now, it's something done in :
> dma_request_slave_channel();
> that leaks kmalloc-32
> Mabe I missed something, but it seems that everything DMA related is
> deallocated in atmel_release_{tx,rx}_dma().
>
> Is this ringing a bell ?
>
Yes, this is known issue and it has yet to be worked on.
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists