From owner-freebsd-net@FreeBSD.ORG Fri Sep 6 19:14:32 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 96D7B3A1 for ; Fri, 6 Sep 2013 19:14:32 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 84783284D for ; Fri, 6 Sep 2013 19:14:32 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 5AFEC1A3CF7; Fri, 6 Sep 2013 12:14:28 -0700 (PDT) Message-ID: <522A2993.6020206@mu.org> Date: Fri, 06 Sep 2013 12:14:27 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: hiren panchasara Subject: Re: mbuf autotuning changes References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2013 19:14:32 -0000 On 9/6/13 12:10 PM, 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? > > Thanks, > Hiren > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > I think TUNABLE_*_FETCH will only write to the variable if it explicitly set. Meaning, unless the user actually sets a value in loader.conf then 127 is a no-op. -Alfred -- Alfred Perlstein