From owner-svn-src-all@FreeBSD.ORG Wed Sep 4 12:58:04 2013 Return-Path: Delivered-To: svn-src-all@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 DFA9CBD6; Wed, 4 Sep 2013 12:58:04 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ve0-x22c.google.com (mail-ve0-x22c.google.com [IPv6:2607:f8b0:400c:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69BE22157; Wed, 4 Sep 2013 12:58:04 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id oz10so191795veb.31 for ; Wed, 04 Sep 2013 05:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=60G8VY619gfR8DX39/T3nG1zZvlwJp2ZfhznbA1rq+g=; b=F1rR4VngskrQZuKDLfRnaDgtvq693voXDAkmsNnROs612/kVToZbQk8VRL9AP5oyjZ 3+7e91m7XWbqASiDrpuHe4HbBtby3mOIJPoGy/HEOczgUDl87K+sUFmgA1k2dRCCJniY C4uD3kPD767e9mZehju/nyQj1GvPqMTadkPtiFTHg2ubJH1oIcA4Kx4hrxCLu0lVbpsa ZtoGMQc/hXFgx6rKSl5ZiZYkuwl49kfW8vlcX/mMUiSuClLeePKrwBxoJTkA04lqkMwL 8gEUZYaaWzqMmWCc/sgw81tYqgMil0fs+Xb+XBV/51sIaoWBNqzMuLKZTETefV/jfQfW OpXQ== X-Received: by 10.58.108.74 with SMTP id hi10mr2651443veb.14.1378299483558; Wed, 04 Sep 2013 05:58:03 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.58.229.167 with HTTP; Wed, 4 Sep 2013 05:57:23 -0700 (PDT) In-Reply-To: <201309041017.r84AHoR2075614@svn.freebsd.org> References: <201309041017.r84AHoR2075614@svn.freebsd.org> From: Ivan Voras Date: Wed, 4 Sep 2013 14:57:23 +0200 X-Google-Sender-Auth: KVTkamUT6thmpA61z6CLQxsQiYo Message-ID: Subject: Re: svn commit: r255202 - head/sys/netgraph/netflow To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@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: Wed, 04 Sep 2013 12:58:05 -0000 On 4 September 2013 12:17, Gleb Smirnoff wrote: > Log: > Make default cache size more modern. > -#define CACHESIZE (65536*4) > +#define CACHESIZE (65536*16) Things like this make me wonder if there shouldn't be a constant somehwere in an ubiquitous header which would basically be a single place to modify and which would cascade all over the place. Maybe even something like a macro based on something like a YEAR_OF_RELEASE, so e.g. the code becomes #define AUTO_TUNE_BASE (YEAR_OF_RELEASE - 2000) #define AUTO_TUNE_AGGRESIVE (AUTO_TUNE_BASE * 2) #define AUTO_TUNE_CONSERVATIVE ((AUTO_TUNE_BASE * 6) / 5) #define CACHESIZE (65536 * (4 + AUTO_TUNE_CONSERVATIVE)) Of course, some power-of-2 variants should also exist...