Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Jan 2015 08:51:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 196586] [vm][patch] Using sysctl to set new limits on kern.ipc.nmbjumbo9 or kern.ipc.nmbjumbo16 does not work as expected
Message-ID:  <bug-196586-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196586

            Bug ID: 196586
           Summary: [vm][patch] Using sysctl to set new limits on
                    kern.ipc.nmbjumbo9 or kern.ipc.nmbjumbo16 does not
                    work as expected
           Product: Base System
           Version: 9.3-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: arnaud.ysmal@stormshield.eu

Created attachment 151450
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=151450&action=edit
Use (uk_maxpages / uk_ppera) * uk_ipers to compute the number of items

Overview:

Using sysctl to set a new value to kern.ipc.nmbjumbo9 or kern.ipc.nmbjumbo16
leads to a wrong value.
This appears in FreeBSD 9.3 with the revision 254515
(https://svnweb.freebsd.org/base?view=revision&revision=254515) which MFC the
revision 243631.


How to reproduce:

# sysctl kern.ipc.nmbjumbo9=224000
kern.ipc.nmbjumbo9: 223263 -> 672000


Expected Results:

# sysctl kern.ipc.nmbjumbo9=224000
kern.ipc.nmbjumbo9: 223263 -> 224000


Audit:

The sysctls functions in sys/kern/kern_mbuf.c got the new value from the
uma_zone_set_max (sys/vm/uma_core.c) function.
The formula used in uma_core.c to compute the number of items based on the
number of pages is not always the same (uk_ppera is sometimes missing).

Fix:

The enclosed patch fixes this issue by always using the same formula to compute
the number of items.


Additional Information:

This report is a follow up of my mail on freebsd-net
(https://lists.freebsd.org/pipermail/freebsd-net/2014-December/040584.html).

This issue was previously discussed on FreeBSD-hackers
(https://lists.freebsd.org/pipermail/freebsd-hackers/2014-September/046158.html).

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-196586-8>