Subject: Re: [PATCH] [NET] reduce sizeof(struct inet_peer), cleanup, change in peer_check_expire()

From: Eric Dumazet <[email-masked]>
Date: Fri, 13 Oct 2006 05:56:43 +0200

David Miller a écrit :
> From: Eric Dumazet <[email-masked]>
> Date: Thu, 12 Oct 2006 22:14:12 +0200
> 
>> 1) shrink struct inet_peer on 64 bits platforms.
>> ------------------------------------------------
>> I noticed sizeof(struct inet_peer) was 64+8 on x86_64
>>
>> As we dont really need 64 bits timestamps (we only care for garbage 
>> collection), we can use 32bits ones and reduce sizeof(struct inet_peer) to 64 
>> bytes : Because of SLAB_HWCACHE_ALIGN constraint, final allocation is 64 bytes 
>> instead of 128 bytes per inet_peer structure.
> 
> I'm not convinced this is %100 correct.  There are wrapping
> cases that I think aren't covered.
> 
> Consider an entry that lives long enough for the lower 32-bits
> of jiffies to wrap, then we kill it, but we won't purge it
> properly if the wrapped jiffie is close to dtime.
> 
> I'm sure there are other similar cases as well.

Hum, if it was incorrect, I urge you to grep for tcp_time_stamp, and correct 
this as soon as possible :)

2^31 is 2147483648

Thats a *lot* of timer ticks, an inet_peer entry should not stay in 
unused_list for more than 10 minutes.

Even if the system is under stress for more than 30 days, and some entries 
stay that long in unused list, they wont leak : either they are re-used, 
either they are purged by cleanup_once(0); done in inet_getpeer().

Eric