[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Possible memory leak in ethernet driver


The kernel allocates the skbs for outgoing packets but the driver
has to call dev_kfree_skb when the packet has been sent.

Do you get the message "eth0: transmit time out" on the debug
console? A potential problem is that the code in e100_tx_timeout
in arch/cris/drivers/ethernet.c looks incorrect in the case
where the transmit queue gets full before the timer expires
for the first packet in the queue.

I will put this on my todo-list to investigate.


-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com">mailto:owner-dev-etrax@xxxxxxx.com] On Behalf Of Christer Weinigel
Sent: Friday, May 16, 2003 1:53 PM
To: dev-etrax
Subject: Re: Possible memory leak in ethernet driver

[My last mail didn't seem to reach the list, so I'm trying again.]


I've been trying to fix a memory leak on Etrax100LX board with the Axis 2.4.19 kernel.  The problem shows itself in that the free memory on the board decreases all the time until finally all userspace processes are killed due to lack of memory.

Looking at /proc/slabinfo it seems that something is leaking

newly booted system:
skbuff_head_cache     77     98    160    2    2    1

system after an hour:
skbuff_head_cache   3942   3969    160   81   81    1

I've found a way to reproduce this problem, disconnect the ethernet cable and do the following:

ifconfig eth0
while true; do telnet 1234 & usleep 100; killall telnet; done

So it seems that when the system is trying to transmit data on the ethernet port but fails because the cable is disconnected it forgets to free the skbuff.

I've found a similar report about skbuff leaks:


Has anyone else seen this?  Is this a generic Linux bug or is it a cris/drivers/ethernet.c specific bug?  Any good ideas on how to fix this before I start digging into the code?


"Just how much can I get away with and still go to heaven?"

Freelance consultant specializing in device driver programming for Linux 
Christer Weinigel <christer@xxxxxxx.se">http://www.weinigel.se