From owner-freebsd-fs@FreeBSD.ORG Sun Aug 7 22:47:47 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6061B106566C for ; Sun, 7 Aug 2011 22:47:47 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 20EE88FC08 for ; Sun, 7 Aug 2011 22:47:46 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0EAIQVP06DaFvO/2dsb2JhbABChEejZYFqBFI1Ag0ZAl+xHJALgSuEC4EQBJMCkQQ X-IronPort-AV: E=Sophos;i="4.67,334,1309752000"; d="scan'208";a="130299992" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 07 Aug 2011 18:47:46 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 5922EB3F0A; Sun, 7 Aug 2011 18:47:46 -0400 (EDT) Date: Sun, 7 Aug 2011 18:47:46 -0400 (EDT) From: Rick Macklem To: FreeBSD FS Message-ID: <1687823014.1491995.1312757266327.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Linux)/6.0.10_GA_2692) Cc: onwahe@gmail.com Subject: NFS calculation of max commit size X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 22:47:47 -0000 A recent PR (kern/159351) noted that the following calculation results in a divide-by-zero when desiredvnodes < 1000. nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); Just fixing the divide-by-zero is easy enough, but I'm not sure what this calculation is trying to do. Making it a fraction of "hibufspace" makes sense (nm_wcommitsize is the maximum # of bytes of uncommitted data in the NFS client's buffer cache blocks, if I understand it correctly), but why divide it by (desiredvnodes / 1000) ?? Maybe thinking that fewer vnodes means sharing it with fewer other file systems or ??? Anyhow, it seems to me that the formulae is bogus for small values of desiredvnodes (for example desiredvnodes == 1500 implies nm_wcommitsize == hibufspace, which sounds too large to me). I'm thinking that putting an upper limit of 10% of hibufspace might make sense. ie. Change the above to: if (desiredvnodes >= 11000) nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); else nmp->nm_wcommitsize = hibufspace / 10; Anyone have comments or insight into this calculation? rick ps: jhb, I hope you don't mind. I emailed you first and then thought others might have some ideas, too.