svn commit: r186057 - head/sys/netinet

Bjoern A. Zeeb bz at FreeBSD.org
Wed Dec 17 08:45:08 UTC 2008


On Tue, 16 Dec 2008, Peter Wemm wrote:

Hi,

there's multiple things in here, so let me try to address them
separately.


> On Sat, Dec 13, 2008 at 1:59 PM, Bjoern A. Zeeb <bz at freebsd.org> wrote:
>>  De-virtualize the MD5 context for TCP initial seq number generation
>>  and make it a function local variable like we do almost everywhere
>>  inside the kernel.
> [..]
>> --- head/sys/netinet/vinet.h    Sat Dec 13 21:17:46 2008        (r186056)
>> +++ head/sys/netinet/vinet.h    Sat Dec 13 21:59:18 2008        (r186057)
>> @@ -142,7 +142,6 @@ struct vnet_inet {
>>        int     _isn_last_reseed;
>>        u_int32_t _isn_offset;
>>        u_int32_t _isn_offset_old;
>> -       MD5_CTX _isn_ctx;
>>
>>        struct  inpcbhead _udb;
>>        struct  inpcbinfo _udbinfo;

> BTW; the reason why _isn_ctx was global is because it is a non-trivial
> size.  It might only be 88 bytes, but when you've only got a few KB of
> stack and lots of nesting, this stuff adds up pretty quickly.  We were
> right on the edge of stack overflows for quite some time and had to go
> and hunt down this sort of thing.  In this case it is probably
> harmless, but we must not get into the habit of casually discarding
> previous hard-won space savings.

Ok. I wasn't aware of this but it's good to know as there are some
ip address printings out there that need to be resolved and it's
I'll send it out for broader review before resuming that work.

For the above change silby had confirmed that he initially went with
the global to save stack space.  To decide if I should really change
it I had looked at the kernel how other parts are handling this and
I found cam, ipfilter, pf, safe, usbsec, various geom modules,
the syncache itself, ... to have them on the stack. At that point
I stopped worrying.

For the actual structure change, yeah I missed the freebsd_version
bump most likely because I had done the patch ~2 days before vimage
went in, sent mail to silby, and was distracted by the SYSINIT ordering
problem Marko had found (see that commit) and then got back to this
commit days later after Marko's and my vimage commit.
In short - my fault.

(2nd mail to follow).

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.


More information about the svn-src-head mailing list