Subject: Re: [BUG] overflow in net/ipv4/route.c rt_check_expire()

From: Eric Dumazet <[email-masked]>
Date: Fri, 01 Apr 2005 23:05:37 +0200

David S. Miller a écrit :
> On Fri, 01 Apr 2005 16:39:48 +0200
> Eric Dumazet <[email-masked]> wrote:
> 

>>Maybe I should make a static sizing, (replace the 256 constant by something based on MAX_CPUS) ?
> 
> 
> Even for NR_CPUS, I think the table should be dynamically allocated.
> 
> It is a goal to eliminate all of these huge arrays in the static
> kernel image, which has grown incredibly too much in recent times.
> I work often to eliminate such things, let's not add new ones :-)

You mean you prefer :

static spinlock_t   *rt_hash_lock ; /* rt_hash_lock = alloc_memory_at_boot_time(...) */

instead of

static spinlock_t rt_hash_lock[RT_HASH_LOCK_SZ] ;

In both cases, memory is taken from lowmem, and size of kernel image is roughly the same (bss section takes no space in image)

Then the runtime cost is more expensive in the 'dynamic case' because of the extra indirection...

?