lkml.org 
[lkml]   [2012]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: RFC: memory leak in udp_table_init
Date
From
> > > [PATCH] mm: add a low limit to alloc_large_system_hash
> >
> > I think you should just use zero as the default minimum for all
> > call sites except this UDP case we are trying to fix.
> >
> > For example I see you used 16 for kernel/pid.c
> >
> > Let's not try to do unrelated changes like that now, we can do such
> > tweaks later.
>
> It was to match the comment we have few lines above :
>
> /*
> * The pid hash table is scaled according to the amount of memory in
the
> * machine. From a minimum of 16 slots up to 4096 slots at one
gigabyte or
> * more.
> */

These large hash tables are, IMHO, an indication that the
algorithm used is, perhaps, suboptimal.

Not least of the problems is actually finding a suitable
(and fast) hash function that will work with the actual
real-life data.

The pid table is a good example of something where a hash
table is unnecessary.
Linux should steal the code I put into NetBSD :-)

David




\
 
 \ /
  Last update: 2012-02-27 12:37    [W:0.066 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site