From owner-freebsd-net@FreeBSD.ORG Fri Sep 6 19:10:50 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 201A21E8 for ; Fri, 6 Sep 2013 19:10:50 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x234.google.com (mail-ea0-x234.google.com [IPv6:2a00:1450:4013:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9EAE72803 for ; Fri, 6 Sep 2013 19:10:49 +0000 (UTC) Received: by mail-ea0-f180.google.com with SMTP id h10so1821418eaj.11 for ; Fri, 06 Sep 2013 12:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Jx5Qgf9+3NaknNwd7NX2dM0JHOSB2M1ytc88s9ZIQfs=; b=XHhvrWvpdm61qcLnA+/D9n8T/DwKjRgVaJ348tMWx4faVQ27USGAkuALSV988d2STL JQQSKO7OOFMVtV6IULtMrMnzMr7q5JqvKh4ks2x6QLH/dwh48GTmpLIRNuJQvl4dYPf5 cBG70N0y8RfLKkRun3pHpuJ+EreXfFqH6o5DFHJxTAE3bnJlH16No+H+Wu2tiW27O9pJ 5L9V4ycGDf+OSLCiD96a9qTwZPIETPjG//zHiJpHPJPWdiFjUARPn0L+GGROFaqo5SSn R35Pl1IsN3ZNTY99G+f3bx9/V2smIMOHMh3oIBi4nz8YVzETFJdPAkusoFV8TplVlTBG gwsQ== MIME-Version: 1.0 X-Received: by 10.15.33.132 with SMTP id c4mr6453040eev.2.1378494647916; Fri, 06 Sep 2013 12:10:47 -0700 (PDT) Received: by 10.14.105.137 with HTTP; Fri, 6 Sep 2013 12:10:47 -0700 (PDT) Date: Fri, 6 Sep 2013 12:10:47 -0700 Message-ID: Subject: mbuf autotuning changes From: hiren panchasara To: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:10:50 -0000 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