From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 7 08:51:03 2015 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0EB2744 for ; Wed, 7 Jan 2015 08:51:03 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D64A6676E for ; Wed, 7 Jan 2015 08:51:03 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t078p3mj096151 for ; Wed, 7 Jan 2015 08:51:03 GMT (envelope-from bugzilla-noreply@freebsd.org) 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 Date: Wed, 07 Jan 2015 08:51:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 9.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: arnaud.ysmal@stormshield.eu X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2015 08:51:03 -0000 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.