From owner-svn-src-all@FreeBSD.ORG Mon Jun 14 13:50:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A587310656CD; Mon, 14 Jun 2010 13:50:12 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.211.182]) by mx1.freebsd.org (Postfix) with ESMTP id 03B958FC18; Mon, 14 Jun 2010 13:50:11 +0000 (UTC) Received: by ywh12 with SMTP id 12so2601595ywh.14 for ; Mon, 14 Jun 2010 06:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=L3uvvspge0IFS8nGIGoj8aWHzugrSPVXA9j10B50EpE=; b=I64YE3FNbq7zE3LlGS9S1nwM8709iGVijQOe0vp+wXPZctB5qXyKSNrfgzOoP6SYl3 +IJJmmHwz6n7XF3Z3C56LeSS+v/RJs4mVo8+10zZsgrb1TJH/Tj4RIq2nMlGq9SmfQOT mEZPQDPJzSuoVMqBZvmlbPTmqk48OkCOJ3I1E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Y4PHAorABMw/aM38Pk8EQkvdxedkDB0QumpymmBv3upuEJ67yCRjZyVx3yxpqP5Y5h DPlCr25zWRpRCOm+TKKrvVqiSWdW1FveXvKu1S9eFvHwFKq/EPMyXgR2Tr+LWGlmu5MF 4I7y/icI+cjSSY93N4Ul8Lc1yGfTjq61jmwqk= MIME-Version: 1.0 Received: by 10.224.79.22 with SMTP id n22mr2129056qak.258.1276523411065; Mon, 14 Jun 2010 06:50:11 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.224.28.79 with HTTP; Mon, 14 Jun 2010 06:50:10 -0700 (PDT) In-Reply-To: <20100614230205.A37830@delplex.bde.org> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C14E012.7080902@freebsd.org> <20100614230205.A37830@delplex.bde.org> Date: Mon, 14 Jun 2010 13:50:10 +0000 X-Google-Sender-Auth: W_LsiG_Mt0W__pIUaXM9em9nYkA Message-ID: From: mdf@FreeBSD.org To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Lawrence Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 14 Jun 2010 13:50:12 -0000 > BTW, one reason I liked BSD code more than gnu code is that it didn't > use so many macros. =A0Macros should only exist when they are not just > syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH(). As a style question, I do understand (generally) why too many macros make the code confusing. However, the *FOREACH macros all fit the same pattern and having a macro to iterate protects one against changes in the implementation -- there's a single location to change if e.g. we want to make CPU_FOREACH use a bitwise operator to determine the next non-zero bit, rather than testing each individually. So what I'm asking is, how do we balance the simplicity of the code (no "unnecessary" macros) versus the simplicity of making certain kinds of infrastructure changes simpler? Thanks, matthew