From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:43:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27BDE2F7 for ; Sat, 10 Nov 2012 17:43:50 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 81E8A8FC15 for ; Sat, 10 Nov 2012 17:43:49 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so82569lbb.13 for ; Sat, 10 Nov 2012 09:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Dctgs3GWgHpAp1ocqtYNBRtq7CQr6jeJhgoUkJvE/Gk=; b=kchStCbFVHcqva+Z4+GAuKVLIuuEQd9edZcCpqU0eCu5pL5X4kk/4RakZxjUIyFP2K YyCWJjChCc1pTseFyHPRBjemyYCLC3hnwRxGzT6tqkLPXSISWQ+fB1hkNOvk9waBS/RF 4exELuBHtpJ7XkNgwHGduIH5uwsashD/p2y2c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=Dctgs3GWgHpAp1ocqtYNBRtq7CQr6jeJhgoUkJvE/Gk=; b=K/FUvhbEcft4ZL9ACFffFqMs+Vp5Jzp74vPOX/Eo0EdT9V0ee8PXPoVH9EhAQQyaRE 9fsONfVaMBabPGbWd8brdfag8U8n0Xiq79+dLBE47udvgnwE7Vn4o/sKZBPYXWXHmuSK xt8lfbzltCpyMo14D5tmMCHfY61mIItaxe50/VRhDv8EOZJa9Rw8levdolRoVQu4vNE+ H1OSV2tO5L1DkUZHDxc2REpWiX6sJ+XKFlcIYA+Kb4lD6f8dCEnUhm2dPWW208QPNjIz 1lcdP5zASHIshEKOJCh6YFU7bhX18TBtXsq9KKmHPmgQaGDlyYFK6NJpU6xx/ohJf8Le pxaw== MIME-Version: 1.0 Received: by 10.152.106.4 with SMTP id gq4mr13486842lab.44.1352569428210; Sat, 10 Nov 2012 09:43:48 -0800 (PST) Received: by 10.112.100.230 with HTTP; Sat, 10 Nov 2012 09:43:48 -0800 (PST) In-Reply-To: <1352568275.17290.85.camel@revolution.hippie.lan> References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <1352568275.17290.85.camel@revolution.hippie.lan> Date: Sat, 10 Nov 2012 09:43:48 -0800 Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern From: Peter Wemm To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkEvEHGehqv9D6fW10mD7opZtn3FuNImwgK/8k7KNQQNwY9FiResbZ1T6iUuBUajgJTcruX Cc: src-committers@freebsd.org, Eitan Adler , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:43:50 -0000 On Sat, Nov 10, 2012 at 9:24 AM, Ian Lepore wrote: > On Sat, 2012-11-10 at 08:38 -0800, Alfred Perlstein wrote: >> On 11/10/12 8:25 AM, Eitan Adler wrote: >> > On 10 November 2012 11:19, Alfred Perlstein wrote: >> >> Please consult the svn log for this file, it's relatively clear >> just in the >> >> commit logs/comments. Grep for 384/512 and look around. >> > Can this reasoning be added as a comment? I did grep for 384 in the >> log, but >> > a) I didn't find the answer >> > b) one shouldn't have to. >> > >> > >> It probably could be added, but then a bunch of other people would >> complain about the comment being too wordy or "not in English". > > The fact that such a thing could happen explains much about the current > state of the code. An outsider could easily come to the conclusion that > the FreeBSD motto is something along the lines of "It should be as hard > to read as it was to write." Don't forget to explain that you get 1 maxusers per 2MB of physical memory which turns into 64 x 2k clusters and a whole series of side effects. Wouldn't it be nice if we could write "By default, mbuf clusters are capped at 6% of physical ram or 6% of kernel address space, whichever is smaller" ? That's a little easier than trying to explain maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE) if (maxusers > 384) maxusers = 384 + ((maxusers - 384) / 8); nmbclusters = 1024 + maxusers * 64; I'd sure prefer to explain: /* pick smaller of kva pages or physical pages */ if ((physpages / 16) < (kvapages / 16)) nmbclusters = physpages / 16; else nmbclusters = kvapages / 16; Leave maxusers for calculating maxproc. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell