Subject: Re: [PATCH] [NET] Size listen hash tables using backlog hint

From: Stephen Hemminger <[email-masked]>
Date: Wed, 18 Oct 2006 21:54:08 -0700

David Miller wrote:
> From: Eric Dumazet Hi <[email-masked]>
> Date: Tue, 17 Oct 2006 14:58:37 +0200
>
>   
>> reqsk_queue_alloc() goal is to use a power of two size for the whole
>> listen_sock structure, to avoid wasting memory for large backlogs,
>> meaning the hash table nr_table_entries is not anymore a power of
>> two. (Hence one AND (nr_table_entries - 1) must be replaced by
>> MODULO nr_table_entries)
>>     
>
> Modulus can be very expensive for some small/slow cpus.  Please round
> down to a power-of-2 instead of up if you think the wastage really
> matters.
>   

Reminds me, anyone know why GCC is too stupid to convert modulus of a 
constant power of 2
into a mask operation?