mbuf large clusters

LI Xin delphij at delphij.net
Thu Jan 18 14:05:58 UTC 2007


Randall Stewart wrote:
> Christian Brueffer wrote:
> 
>>
>> Not sure if I'm understanding you correctly, but kern.ipc.nmbclusters is
>> a tunable not a sysctl, so it has to be set in /boot/loader.conf or at
>> the loader prompt (see loader(8)).
>>
> 
> Not in current from what I see (if
> I understand this correctly of course):
> -----------------------------------------------------
> static int
> sysctl_nmbclusters(SYSCTL_HANDLER_ARGS)
> {
>     int error, newnmbclusters;
> 
>     newnmbclusters = nmbclusters;
>     error = sysctl_handle_int(oidp, &newnmbclusters, sizeof(int), req);
>     if (error == 0 && req->newptr) {
>         if (newnmbclusters > nmbclusters) {
>             nmbclusters = newnmbclusters;
>             uma_zone_set_max(zone_clust, nmbclusters);
>             EVENTHANDLER_INVOKE(nmbclusters_change);
>         } else
>             error = EINVAL;
>     }
>     return (error);
> }
> SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, CTLTYPE_INT|CTLFLAG_RW,
> &nmbclusters, 0, sysctl_nmbclusters, "IU",
>     "Maximum number of mbuf clusters allowed");
> 
> -----------------------------------------------------
> 
> It looks to me like it lets you INCREASE the value from
> the calculated system value.. but NOT shrink it :-0

No, shrinking it is not currently supported...  It can easily trigger
'zonelimit' livelock if not handled properly.  On the other hand, the
code seems to have some problem as it allows setting an upper limit when
there is no upper limit (nmbclusters=0).

Cheers,
-- 
Xin LI <delphij at delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20070118/a95d10bc/signature.pgp


More information about the freebsd-net mailing list