Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Sep 2013 12:14:19 -0700
From:      Navdeep Parhar <nparhar@gmail.com>
To:        hiren panchasara <hiren.panchasara@gmail.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: mbuf autotuning changes
Message-ID:  <522A298B.30106@gmail.com>
In-Reply-To: <CALCpEUFxaXKh4%2B8evratZYE3JyfyTmrL7rzpBqUJ%2B_S3Ff-AcA@mail.gmail.com>
References:  <CALCpEUFxaXKh4%2B8evratZYE3JyfyTmrL7rzpBqUJ%2B_S3Ff-AcA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 09/06/13 12:10, hiren panchasara wrote:
> tunable_mbinit() in kern_mbuf.c looks like this:
> 
> 119         /*
> 120          * The default limit for all mbuf related memory is 1/2 of all
> 121          * available kernel memory (physical or kmem).
> 122          * At most it can be 3/4 of available kernel memory.
> 123          */
> 124         realmem = qmin((quad_t)physmem * PAGE_SIZE,
> 125             vm_map_max(kmem_map) - vm_map_min(kmem_map));
> 126         maxmbufmem = realmem / 2;
> 127         TUNABLE_QUAD_FETCH("kern.ipc.maxmbufmem", &maxmbufmem);
> 128         if (maxmbufmem > realmem / 4 * 3)
> 129                 maxmbufmem = realmem / 4 * 3;
> 
> If I am reading the code correctly, we loose the value on line 126 when we
> do FETCH on line 127.
> 
> And after line 127, if we havent specified kern.ipc.maxmbufmem (in
> loader.conf - I guess...), we set that value to 0.
> 
> And because of that the if condition on line 128 is almost always false?
> 
> What am I missing here?

All the TUNABLE_FOO_FETCH leave the data alone if the tunable isn't
actually in the environment.  For this specific case, see the the
implementation of getenv_quad().

Navdeep



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?522A298B.30106>