From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 12:34:42 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0468106566C; Sun, 3 Jul 2011 12:34:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 035E18FC18; Sun, 3 Jul 2011 12:34:41 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p63CYZJ9052886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Jul 2011 15:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p63CYZSO097091; Sun, 3 Jul 2011 15:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p63CYZQl097089; Sun, 3 Jul 2011 15:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 3 Jul 2011 15:34:35 +0300 From: Kostik Belousov To: Robert Millan Message-ID: <20110703123435.GN48734@deviant.kiev.zoral.com.ua> References: <20110703115750.GL48734@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ppqw4mhdCbV3XNpT" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] PAGE_SIZE in libsbuf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 12:34:42 -0000 --ppqw4mhdCbV3XNpT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 03, 2011 at 02:07:59PM +0200, Robert Millan wrote: > 2011/7/3 Kostik Belousov : > > I think the different workaround is already included in the latest > > sbuf source. Please see > > http://svnweb.freebsd.org/base/head/sys/kern/subr_sbuf.c?revision=3D222= 015&view=3Dmarkup >=20 > How does libsbuf react if the guess fails? Also note this codepath > isn't tested in FreeBSD (except for pc98). >=20 > I'm afraid this situation could lead to runtime errors somehow. I'd > still propose replacing this guess with a sysconf() check. Which runtime errors ? The constant is used to size the malloc allocations. Use of the PAGE_SIZE is an attempt to do some optimization. I think it would work if you use e.g. 42 instead of PAGE_SIZE. --ppqw4mhdCbV3XNpT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk4QYdoACgkQC3+MBN1Mb4j9PwCfQRbDXJe5qB/t2HHTrA8hg76X 3msAnRDZqkBybktcBXVhSGq97qUpUFEw =QHJl -----END PGP SIGNATURE----- --ppqw4mhdCbV3XNpT--