public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c
@ 2010-12-17 10:18 Lothar Waßmann
  2010-12-17 10:35 ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Lothar Waßmann @ 2010-12-17 10:18 UTC (permalink / raw)
  To: netdev

Hi,

the kernel memory leak detector spews the message:
|kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
cat /sys/kernel/debug/kmemleak
|unreferenced object 0xc7a1c000 (size 5120):
|  comm "swapper", pid 1, jiffies 4294937513 (age 2320.120s)
|  hex dump (first 32 bytes):
|    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
|    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
|  backtrace:
|    [<c00112b8>] alloc_large_system_hash+0x188/0x224
|    [<c001be14>] udp_table_init+0x44/0x180
|    [<c001bf64>] udp_init+0x14/0x78
|    [<c001c620>] inet_init+0x138/0x240
|    [<c0030368>] do_one_initcall+0x58/0x1a8
|    [<c00083c8>] kernel_init+0x98/0x14c
|    [<c0037714>] kernel_thread_exit+0x0/0x8
|    [<ffffffff>] 0xffffffff
|unreferenced object 0xc7a26000 (size 5120):
|  comm "swapper", pid 1, jiffies 4294937513 (age 2320.130s)
|  hex dump (first 32 bytes):
|    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
|    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
|  backtrace:
|    [<c00112b8>] alloc_large_system_hash+0x188/0x224
|    [<c001be14>] udp_table_init+0x44/0x180
|    [<c001bff0>] udplite4_register+0x10/0x94
|    [<c001c624>] inet_init+0x13c/0x240
|    [<c0030368>] do_one_initcall+0x58/0x1a8
|    [<c00083c8>] kernel_init+0x98/0x14c
|    [<c0037714>] kernel_thread_exit+0x0/0x8
|    [<ffffffff>] 0xffffffff

The offending code in net/ipv4/udp.c is:
|void __init udp_table_init(struct udp_table *table, const char *name)
|{
|	unsigned int i;
|
|	if (!CONFIG_BASE_SMALL)
|		table->hash = alloc_large_system_hash(name,
|			2 * sizeof(struct udp_hslot),
|			uhash_entries,
|			21, /* one slot per 2 MB */
|			0,
|			&table->log,
|			&table->mask,
|			64 * 1024);
|	/*
|	 * Make sure hash table has the minimum size
|	 */
|	if (CONFIG_BASE_SMALL || table->mask < UDP_HTABLE_SIZE_MIN - 1) {
|		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
|				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
In case of !CONFIG_BASE_SMALL and 'table->mask < UDP_HTABLE_SIZE_MIN - 1)'
the memory allocated in the previous if clause becomes inacessible!

Shouldn't this be:
|	if (!CONFIG_BASE_SMALL && table->mask >= UDP_HTABLE_SIZE_MIN - 1) {
|		table->hash = alloc_large_system_hash(name,
|			2 * sizeof(struct udp_hslot),
|			uhash_entries,
|			21, /* one slot per 2 MB */
|			0,
|			&table->log,
|			&table->mask,
|			64 * 1024);
|	} else {
|		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
|				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
[...]



Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c
  2010-12-17 10:18 [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c Lothar Waßmann
@ 2010-12-17 10:35 ` Eric Dumazet
  2010-12-17 11:11   ` Lothar Waßmann
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2010-12-17 10:35 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: netdev

Le vendredi 17 décembre 2010 à 11:18 +0100, Lothar Waßmann a écrit :
> Hi,
> 
> the kernel memory leak detector spews the message:
> |kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
> cat /sys/kernel/debug/kmemleak
> |unreferenced object 0xc7a1c000 (size 5120):
> |  comm "swapper", pid 1, jiffies 4294937513 (age 2320.120s)
> |  hex dump (first 32 bytes):
> |    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
> |    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
> |  backtrace:
> |    [<c00112b8>] alloc_large_system_hash+0x188/0x224
> |    [<c001be14>] udp_table_init+0x44/0x180
> |    [<c001bf64>] udp_init+0x14/0x78
> |    [<c001c620>] inet_init+0x138/0x240
> |    [<c0030368>] do_one_initcall+0x58/0x1a8
> |    [<c00083c8>] kernel_init+0x98/0x14c
> |    [<c0037714>] kernel_thread_exit+0x0/0x8
> |    [<ffffffff>] 0xffffffff
> |unreferenced object 0xc7a26000 (size 5120):
> |  comm "swapper", pid 1, jiffies 4294937513 (age 2320.130s)
> |  hex dump (first 32 bytes):
> |    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
> |    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
> |  backtrace:
> |    [<c00112b8>] alloc_large_system_hash+0x188/0x224
> |    [<c001be14>] udp_table_init+0x44/0x180
> |    [<c001bff0>] udplite4_register+0x10/0x94
> |    [<c001c624>] inet_init+0x13c/0x240
> |    [<c0030368>] do_one_initcall+0x58/0x1a8
> |    [<c00083c8>] kernel_init+0x98/0x14c
> |    [<c0037714>] kernel_thread_exit+0x0/0x8
> |    [<ffffffff>] 0xffffffff
> 
> The offending code in net/ipv4/udp.c is:
> |void __init udp_table_init(struct udp_table *table, const char *name)
> |{
> |	unsigned int i;
> |
> |	if (!CONFIG_BASE_SMALL)
> |		table->hash = alloc_large_system_hash(name,
> |			2 * sizeof(struct udp_hslot),
> |			uhash_entries,
> |			21, /* one slot per 2 MB */
> |			0,
> |			&table->log,
> |			&table->mask,
> |			64 * 1024);
> |	/*
> |	 * Make sure hash table has the minimum size
> |	 */
> |	if (CONFIG_BASE_SMALL || table->mask < UDP_HTABLE_SIZE_MIN - 1) {
> |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> In case of !CONFIG_BASE_SMALL and 'table->mask < UDP_HTABLE_SIZE_MIN - 1)'
> the memory allocated in the previous if clause becomes inacessible!
> 
> Shouldn't this be:
> |	if (!CONFIG_BASE_SMALL && table->mask >= UDP_HTABLE_SIZE_MIN - 1) {
> |		table->hash = alloc_large_system_hash(name,
> |			2 * sizeof(struct udp_hslot),
> |			uhash_entries,
> |			21, /* one slot per 2 MB */
> |			0,
> |			&table->log,
> |			&table->mask,
> |			64 * 1024);
> |	} else {
> |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> [...]
> 
> 
> 
> Lothar Waßmann

Nothing we can do about it, there is no API to reverse the
alloc_large_system_hash() effect. We could call kmemleak api to at least
avoid this false alarm.

We really want a minimum size for the UDP hash table, because our algos
depend on this.

Why on your config alloc_large_system_hash() is allocating 5120 bytes, I
dont know :(



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c
  2010-12-17 10:35 ` Eric Dumazet
@ 2010-12-17 11:11   ` Lothar Waßmann
  2010-12-17 11:32     ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Lothar Waßmann @ 2010-12-17 11:11 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev

Hi,

Eric Dumazet writes:
> Le vendredi 17 décembre 2010 à 11:18 +0100, Lothar Waßmann a écrit :
> > The offending code in net/ipv4/udp.c is:
> > |void __init udp_table_init(struct udp_table *table, const char *name)
> > |{
> > |	unsigned int i;
> > |
> > |	if (!CONFIG_BASE_SMALL)
> > |		table->hash = alloc_large_system_hash(name,
> > |			2 * sizeof(struct udp_hslot),
> > |			uhash_entries,
> > |			21, /* one slot per 2 MB */
> > |			0,
> > |			&table->log,
> > |			&table->mask,
> > |			64 * 1024);
> > |	/*
> > |	 * Make sure hash table has the minimum size
> > |	 */
> > |	if (CONFIG_BASE_SMALL || table->mask < UDP_HTABLE_SIZE_MIN - 1) {
> > |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> > |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> > In case of !CONFIG_BASE_SMALL and 'table->mask < UDP_HTABLE_SIZE_MIN - 1)'
> > the memory allocated in the previous if clause becomes inacessible!
> > 
> > Shouldn't this be:
> > |	if (!CONFIG_BASE_SMALL && table->mask >= UDP_HTABLE_SIZE_MIN - 1) {
> > |		table->hash = alloc_large_system_hash(name,
> > |			2 * sizeof(struct udp_hslot),
> > |			uhash_entries,
> > |			21, /* one slot per 2 MB */
> > |			0,
> > |			&table->log,
> > |			&table->mask,
> > |			64 * 1024);
> > |	} else {
> > |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> > |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> > [...]
> > 
> 
> Nothing we can do about it, there is no API to reverse the
> alloc_large_system_hash() effect. We could call kmemleak api to at least
> avoid this false alarm.
> 
Do you have to call it at all in case of table->mask < UDP_HTABLE_SIZE_MIN - 1?

> We really want a minimum size for the UDP hash table, because our algos
> depend on this.
> 
I can't see why this could not be achieved by doing _either_
alloc_large_system_hash() _OR_ kmalloc() as stated above, but not
both.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c
  2010-12-17 11:11   ` Lothar Waßmann
@ 2010-12-17 11:32     ` Eric Dumazet
  2010-12-17 11:47       ` Lothar Waßmann
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2010-12-17 11:32 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: netdev

Le vendredi 17 décembre 2010 à 12:11 +0100, Lothar Waßmann a écrit :
> Hi,
> 
> Eric Dumazet writes:
> > Le vendredi 17 décembre 2010 à 11:18 +0100, Lothar Waßmann a écrit :
> > > The offending code in net/ipv4/udp.c is:
> > > |void __init udp_table_init(struct udp_table *table, const char *name)
> > > |{
> > > |	unsigned int i;
> > > |
> > > |	if (!CONFIG_BASE_SMALL)
> > > |		table->hash = alloc_large_system_hash(name,
> > > |			2 * sizeof(struct udp_hslot),
> > > |			uhash_entries,
> > > |			21, /* one slot per 2 MB */
> > > |			0,
> > > |			&table->log,
> > > |			&table->mask,
> > > |			64 * 1024);
> > > |	/*
> > > |	 * Make sure hash table has the minimum size
> > > |	 */
> > > |	if (CONFIG_BASE_SMALL || table->mask < UDP_HTABLE_SIZE_MIN - 1) {
> > > |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> > > |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> > > In case of !CONFIG_BASE_SMALL and 'table->mask < UDP_HTABLE_SIZE_MIN - 1)'
> > > the memory allocated in the previous if clause becomes inacessible!
> > > 
> > > Shouldn't this be:
> > > |	if (!CONFIG_BASE_SMALL && table->mask >= UDP_HTABLE_SIZE_MIN - 1) {
> > > |		table->hash = alloc_large_system_hash(name,
> > > |			2 * sizeof(struct udp_hslot),
> > > |			uhash_entries,
> > > |			21, /* one slot per 2 MB */
> > > |			0,
> > > |			&table->log,
> > > |			&table->mask,
> > > |			64 * 1024);
> > > |	} else {
> > > |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> > > |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> > > [...]
> > > 
> > 
> > Nothing we can do about it, there is no API to reverse the
> > alloc_large_system_hash() effect. We could call kmemleak api to at least
> > avoid this false alarm.
> > 
> Do you have to call it at all in case of table->mask < UDP_HTABLE_SIZE_MIN - 1?
> 

We call alloc_large_system_hash() asking it to size the table _itself_.
We give some hints : 

- How many slots per MB of avail memory.
- An upper limit (64*1024 slots because we only handle 65536 udp ports)
- but not a lower limit (not available in the API)

Problem is in your case, alloc_large_system_hash() allocates a very
small area. Then we catch the problem, seeing table->mask is too small
for our needs. We prefer to 'lost' this too small memory than crashing
kernel later.


> > We really want a minimum size for the UDP hash table, because our algos
> > depend on this.
> > 
> I can't see why this could not be achieved by doing _either_
> alloc_large_system_hash() _OR_ kmalloc() as stated above, but not
> both.

We definitly want alloc_large_system_hash() for the general case
(nice NUMA spread, while kmalloc() would allocate the hash table on a
single memory node. Not so nice)

One way to handle this problem would be to add a new parameter to
alloc_large_system_hash() to specify a lower limit.
alloc_large_system_hash() would not even try to allocate a too small
array.

Is your system so small ?




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c
  2010-12-17 11:32     ` Eric Dumazet
@ 2010-12-17 11:47       ` Lothar Waßmann
  2010-12-17 11:56         ` Lothar Waßmann
  0 siblings, 1 reply; 8+ messages in thread
From: Lothar Waßmann @ 2010-12-17 11:47 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev

Eric Dumazet writes:
> Le vendredi 17 décembre 2010 à 12:11 +0100, Lothar Waßmann a écrit :
> > Hi,
> > 
> > Eric Dumazet writes:
> > > Le vendredi 17 décembre 2010 à 11:18 +0100, Lothar Waßmann a écrit :
> > > > The offending code in net/ipv4/udp.c is:
> > > > |void __init udp_table_init(struct udp_table *table, const char *name)
> > > > |{
> > > > |	unsigned int i;
> > > > |
> > > > |	if (!CONFIG_BASE_SMALL)
> > > > |		table->hash = alloc_large_system_hash(name,
> > > > |			2 * sizeof(struct udp_hslot),
> > > > |			uhash_entries,
> > > > |			21, /* one slot per 2 MB */
> > > > |			0,
> > > > |			&table->log,
> > > > |			&table->mask,
> > > > |			64 * 1024);
> > > > |	/*
> > > > |	 * Make sure hash table has the minimum size
> > > > |	 */
> > > > |	if (CONFIG_BASE_SMALL || table->mask < UDP_HTABLE_SIZE_MIN - 1) {
> > > > |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> > > > |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> > > > In case of !CONFIG_BASE_SMALL and 'table->mask < UDP_HTABLE_SIZE_MIN - 1)'
> > > > the memory allocated in the previous if clause becomes inacessible!
> > > > 
> > > > Shouldn't this be:
> > > > |	if (!CONFIG_BASE_SMALL && table->mask >= UDP_HTABLE_SIZE_MIN - 1) {
> > > > |		table->hash = alloc_large_system_hash(name,
> > > > |			2 * sizeof(struct udp_hslot),
> > > > |			uhash_entries,
> > > > |			21, /* one slot per 2 MB */
> > > > |			0,
> > > > |			&table->log,
> > > > |			&table->mask,
> > > > |			64 * 1024);
> > > > |	} else {
> > > > |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> > > > |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> > > > [...]
> > > > 
> > > 
> > > Nothing we can do about it, there is no API to reverse the
> > > alloc_large_system_hash() effect. We could call kmemleak api to at least
> > > avoid this false alarm.
> > > 
> > Do you have to call it at all in case of table->mask < UDP_HTABLE_SIZE_MIN - 1?
> > 
> 
> We call alloc_large_system_hash() asking it to size the table _itself_.
> We give some hints : 
> 
> - How many slots per MB of avail memory.
> - An upper limit (64*1024 slots because we only handle 65536 udp ports)
> - but not a lower limit (not available in the API)
> 
> Problem is in your case, alloc_large_system_hash() allocates a very
> small area. Then we catch the problem, seeing table->mask is too small
> for our needs. We prefer to 'lost' this too small memory than crashing
> kernel later.
> 
table->mask is not altered by alloc_large_system_hash(), so you could
detect the situation beforhand and avoid calling that function in this
case. As far as I can tell there is no need for
alloc_large_system_hash() if you later decide to use kmalloc'ed memory
instead.

The current situation is
if (!CONFIG_BASE_SMALL)
	call alloc_large_system_hash()
if (CONFIG_BASE_SMALL || table->mask < MIN)
	call kmalloc() dropping evnetually allocated memory from the
	previous if clause

My proposal was:
if (!CONFIG_BASE_SMALL && table->mask >= MIN)
	call alloc_large_system_hash()
else
	call kmalloc()

which is functionally equivalent except for the missing call to
alloc_large_system_hash() if the memory allocated by that function is
not used.

> > > We really want a minimum size for the UDP hash table, because our algos
> > > depend on this.
> > > 
> > I can't see why this could not be achieved by doing _either_
> > alloc_large_system_hash() _OR_ kmalloc() as stated above, but not
> > both.
> 
> We definitly want alloc_large_system_hash() for the general case
> (nice NUMA spread, while kmalloc() would allocate the hash table on a
> single memory node. Not so nice)
> 
That would still be the case with my proposed solution.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c
  2010-12-17 11:47       ` Lothar Waßmann
@ 2010-12-17 11:56         ` Lothar Waßmann
  2010-12-17 14:22           ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Lothar Waßmann @ 2010-12-17 11:56 UTC (permalink / raw)
  To: Eric Dumazet, netdev

Hi again,

Lothar Waßmann writes:
> Eric Dumazet writes:
> > Le vendredi 17 décembre 2010 à 12:11 +0100, Lothar Waßmann a écrit :
> > > Hi,
> > > 
> > > Eric Dumazet writes:
> > > > Le vendredi 17 décembre 2010 à 11:18 +0100, Lothar Waßmann a écrit :
> > > > > The offending code in net/ipv4/udp.c is:
> > > > > |void __init udp_table_init(struct udp_table *table, const char *name)
> > > > > |{
> > > > > |	unsigned int i;
> > > > > |
> > > > > |	if (!CONFIG_BASE_SMALL)
> > > > > |		table->hash = alloc_large_system_hash(name,
> > > > > |			2 * sizeof(struct udp_hslot),
> > > > > |			uhash_entries,
> > > > > |			21, /* one slot per 2 MB */
> > > > > |			0,
> > > > > |			&table->log,
> > > > > |			&table->mask,
> > > > > |			64 * 1024);
> > > > > |	/*
> > > > > |	 * Make sure hash table has the minimum size
> > > > > |	 */
> > > > > |	if (CONFIG_BASE_SMALL || table->mask < UDP_HTABLE_SIZE_MIN - 1) {
> > > > > |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> > > > > |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> > > > > In case of !CONFIG_BASE_SMALL and 'table->mask < UDP_HTABLE_SIZE_MIN - 1)'
> > > > > the memory allocated in the previous if clause becomes inacessible!
> > > > > 
> > > > > Shouldn't this be:
> > > > > |	if (!CONFIG_BASE_SMALL && table->mask >= UDP_HTABLE_SIZE_MIN - 1) {
> > > > > |		table->hash = alloc_large_system_hash(name,
> > > > > |			2 * sizeof(struct udp_hslot),
> > > > > |			uhash_entries,
> > > > > |			21, /* one slot per 2 MB */
> > > > > |			0,
> > > > > |			&table->log,
> > > > > |			&table->mask,
> > > > > |			64 * 1024);
> > > > > |	} else {
> > > > > |		table->hash = kmalloc(UDP_HTABLE_SIZE_MIN *
> > > > > |				      2 * sizeof(struct udp_hslot), GFP_KERNEL);
> > > > > [...]
> > > > > 
> > > > 
> > > > Nothing we can do about it, there is no API to reverse the
> > > > alloc_large_system_hash() effect. We could call kmemleak api to at least
> > > > avoid this false alarm.
> > > > 
> > > Do you have to call it at all in case of table->mask < UDP_HTABLE_SIZE_MIN - 1?
> > > 
> > 
> > We call alloc_large_system_hash() asking it to size the table _itself_.
> > We give some hints : 
> > 
> > - How many slots per MB of avail memory.
> > - An upper limit (64*1024 slots because we only handle 65536 udp ports)
> > - but not a lower limit (not available in the API)
> > 
> > Problem is in your case, alloc_large_system_hash() allocates a very
> > small area. Then we catch the problem, seeing table->mask is too small
> > for our needs. We prefer to 'lost' this too small memory than crashing
> > kernel later.
> > 
> table->mask is not altered by alloc_large_system_hash(), so you could
> detect the situation beforhand and avoid calling that function in this
> case. As far as I can tell there is no need for
> alloc_large_system_hash() if you later decide to use kmalloc'ed memory
> instead.
> 
Forget about this. I was a little confused when reading the
alloc_large_system_hash() function. No I understand.

Sorry for the noise.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c
  2010-12-17 11:56         ` Lothar Waßmann
@ 2010-12-17 14:22           ` Eric Dumazet
  2010-12-17 14:28             ` Lothar Waßmann
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2010-12-17 14:22 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: netdev

Le vendredi 17 décembre 2010 à 12:56 +0100, Lothar Waßmann a écrit :

> Forget about this. I was a little confused when reading the
> alloc_large_system_hash() function. No I understand.

Any idea why you got a small allocation ?

How much LOWMEM do you have on your platform ?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c
  2010-12-17 14:22           ` Eric Dumazet
@ 2010-12-17 14:28             ` Lothar Waßmann
  0 siblings, 0 replies; 8+ messages in thread
From: Lothar Waßmann @ 2010-12-17 14:28 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev

Hi,

Eric Dumazet writes:
> Le vendredi 17 décembre 2010 à 12:56 +0100, Lothar Waßmann a écrit :
> 
> > Forget about this. I was a little confused when reading the
> > alloc_large_system_hash() function. No I understand.
> 
> Any idea why you got a small allocation ?
> 
How much should I expect?

> How much LOWMEM do you have on your platform ?
> 
It's a new platform with a Freescale i.MX28 SoC:

Linux version 2.6.37-rc5-karo+ (lothar@ipc1) (gcc version 4.4.1 (GCC) ) #43 PREEMPT Fri Dec 17 13:59:40 CET 2010
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Ka-Ro electronics TX28 module
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat c0454c9c, node_mem_map c0994000
  Normal zone: 288 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 32480 pages, LIFO batch:7
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32480
Kernel command line: init=/linuxrc tx28_baseboard=stk5-v3 root=/dev/nfs nfsroot=192.168.1.225:/tftpboot/KARO/imx28,nolock ip=bootp debug panic=1 console=ttyAM0,115200 ro
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 119968k/119968k available, 11104k reserved, 0K highmem


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-12-17 14:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-17 10:18 [BUG] 2.6.37-rc5 Memory leak in net/ipv4/udp.c Lothar Waßmann
2010-12-17 10:35 ` Eric Dumazet
2010-12-17 11:11   ` Lothar Waßmann
2010-12-17 11:32     ` Eric Dumazet
2010-12-17 11:47       ` Lothar Waßmann
2010-12-17 11:56         ` Lothar Waßmann
2010-12-17 14:22           ` Eric Dumazet
2010-12-17 14:28             ` Lothar Waßmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox