From owner-freebsd-arch@FreeBSD.ORG Wed Nov 1 20:27:17 2006 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F19716A415 for ; Wed, 1 Nov 2006 20:27:17 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id E187F43E18 for ; Wed, 1 Nov 2006 20:23:05 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 961E046DA5; Wed, 1 Nov 2006 21:23:00 +0100 (CET) Received: from localhost (dkh63.neoplus.adsl.tpnet.pl [83.24.11.63]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5384C45B26; Wed, 1 Nov 2006 21:22:56 +0100 (CET) Date: Wed, 1 Nov 2006 21:22:53 +0100 From: Pawel Jakub Dawidek To: Brooks Davis Message-ID: <20061101202252.GX15861@garage.freebsd.pl> References: <20061101190606.GQ15861@garage.freebsd.pl> <20061101192457.GA56970@lor.one-eyed-alien.net> <20061101194618.GT15861@garage.freebsd.pl> <20061101195952.GB56970@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PxDrs/Fpf4pPiewX" Content-Disposition: inline In-Reply-To: <20061101195952.GB56970@lor.one-eyed-alien.net> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r804 (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_00,RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-arch@FreeBSD.org Subject: Re: sysconf(3) extensions. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Nov 2006 20:27:17 -0000 --PxDrs/Fpf4pPiewX Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 01, 2006 at 01:59:52PM -0600, Brooks Davis wrote: > On Wed, Nov 01, 2006 at 08:46:18PM +0100, Pawel Jakub Dawidek wrote: > > On Wed, Nov 01, 2006 at 01:24:57PM -0600, Brooks Davis wrote: > > > On Wed, Nov 01, 2006 at 08:06:06PM +0100, Pawel Jakub Dawidek wrote: > > > > Hi. > > > >=20 > > > > I'd like to add two non-standard value to the sysconf(3) functions, > > > > which can be found in both Solaris and Linux: _SC_PHYS_PAGES and > > > > _SC_AVPHYS_PAGES. > > > >=20 > > > > The patch is here: > > > >=20 > > > > http://people.freebsd.org/~pjd/patches/sysconf.patch > > > >=20 > > > > Can someone review it? Thanks. > > >=20 > > > What are they for? My concern is that _SC_AVPHYS_PAGES isn't going to > > > semantically match other platforms since in a steady state the free c= ount > > > is small on FreeBSD, but on other systems it swings quite a bit based= on > > > load. > >=20 > > _SC_PHYS_PAGES is used by libzpool (a part of the ZFS file system). > > _SC_AVPHYS_PAGES I used more for completness. >=20 > OK. I'd be somewhat inclined to leave _SC_AVPHYS_PAGES out in that > case, but I don't feel strongly about it. I've no opinion, I can remove it. > > > +Note that it is possible for the product of this value and the value= of > > > +.Li _SC_PAGE_SIZE > > > +to overflow. > > >=20 > > > This would be more clear if it said what was expected to overflow and > > > when. > >=20 > > The sysconf(3) functions return 'long' and on 32bit machine long is also > > 32bit. If we have more than 4GB of memory (PAE) and want to calculate > > physical memory in bytes doing _SC_PHYS_PAGES * _SC_PAGE_SIZE will > > overflow. But I'm not sure if I want to put this into manual page... > > Maybe as an example if there are or may be in the future other cases > > when this is possible? >=20 > That's the problem I expected. Actually since it's a long not a u_long, = it > would overflow at >2GB. Maybe something like: >=20 > Note that it is possible that the product of this value and the value of > .Li _SC_PAGE_SIZE > will overflow a long in some configurations on a 32bit machine. >=20 > My worry is that your original phrasing may be unnecessarily subtle. Sounds good. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --PxDrs/Fpf4pPiewX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQFFSQIcForvXbEpPzQRAsdVAKC2HD1/gQhTUhuRLk6kvk4HjLRwcgCg+bvf LRz0ox0hN4OMMqc3YiLOCHc= =xLII -----END PGP SIGNATURE----- --PxDrs/Fpf4pPiewX--