From owner-freebsd-stable@FreeBSD.ORG Sun May 30 15:06:28 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3855110656CB; Sun, 30 May 2010 15:06:28 +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 C46458FC16; Sun, 30 May 2010 15:06:27 +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 o4UF6aM4053517 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 30 May 2010 18:06:36 +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 o4UF6MY7049447; Sun, 30 May 2010 18:06:22 +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 o4UF6MCi049446; Sun, 30 May 2010 18:06:22 +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, 30 May 2010 18:06:22 +0300 From: Kostik Belousov To: Dmitry Marakasov Message-ID: <20100530150622.GJ83316@deviant.kiev.zoral.com.ua> References: <20100530143034.GH43302@hades.panopticon> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aJd1ttTPPR7r8b0Q" Content-Disposition: inline In-Reply-To: <20100530143034.GH43302@hades.panopticon> 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=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, 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-current@freebsd.org, freebsd-stable@freebsd.org Subject: Re: need better POSIX semaphore support X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 May 2010 15:06:28 -0000 --aJd1ttTPPR7r8b0Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 30, 2010 at 06:30:35PM +0400, Dmitry Marakasov wrote: > Hi! >=20 > Not long ago, POSIX semaphores support was enabled by default as it's > becoming more widely used, by e.g. firefox. However, the support > for these is still incomplete: we only have systemwide limit of 30 > semaphores, and that doesn't seem to be configurable neither online with > sysctl, nor at boottime from loader.conf. I only was able to raise > semaphore count by changing SEM_MAX in kernel sources. >=20 > The real appliaction which needs more semaphores is lightspark > (graphics/lightspark-devel) flash plugin - it uses ~40 sems for simple > clips and ~250 for something like youtube videos. >=20 > Until there more apps that require proper semaphore support, I guess > we need to improve it asap. Given the amount of memory used by ksem, > the least can be done is SEM_MAX bumped up to 5120 or so for > non-embedded kernels. 5120 semaphores require just 644k of kernel > memory (judging by vmstat), and is "ought to be enough for anybody". > Another good thing would be to make it configurable at boot-time > or even better in runtime. HEAD contains different implementation. Apparently, it did not made into stable/8 yet, so it will not appear in the 8.1. Try this, I could try to squeeze it into 8.1. diff --git a/sys/kern/posix4_mib.c b/sys/kern/posix4_mib.c index 5242b31..41e28da 100644 --- a/sys/kern/posix4_mib.c +++ b/sys/kern/posix4_mib.c @@ -57,6 +57,9 @@ SYSCTL_DECL(_p1003_1b); #define P1B_SYSCTL(num, name) \ SYSCTL_INT(_p1003_1b, num, \ name, CTLFLAG_RD, facility + num - 1, 0, ""); +#define P1B_SYSCTL_RW(num, name) \ +SYSCTL_INT(_p1003_1b, num, \ + name, CTLFLAG_RW, facility + num - 1, 0, ""); =20 #else =20 @@ -65,6 +68,9 @@ SYSCTL_DECL(_kern_p1003_1b); #define P1B_SYSCTL(num, name) \ SYSCTL_INT(_kern_p1003_1b, OID_AUTO, \ name, CTLFLAG_RD, facility + num - 1, 0, ""); +#define P1B_SYSCTL_RW(num, name) \ +SYSCTL_INT(_kern_p1003_1b, OID_AUTO, \ + name, CTLFLAG_RW, facility + num - 1, 0, ""); SYSCTL_NODE(_kern, OID_AUTO, p1003_1b, CTLFLAG_RW, 0, "P1003.1B"); =20 #endif @@ -91,7 +97,7 @@ P1B_SYSCTL(CTL_P1003_1B_DELAYTIMER_MAX, delaytimer_max); P1B_SYSCTL(CTL_P1003_1B_MQ_OPEN_MAX, mq_open_max); P1B_SYSCTL(CTL_P1003_1B_PAGESIZE, pagesize); P1B_SYSCTL(CTL_P1003_1B_RTSIG_MAX, rtsig_max); -P1B_SYSCTL(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max); +P1B_SYSCTL_RW(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max); P1B_SYSCTL(CTL_P1003_1B_SEM_VALUE_MAX, sem_value_max); P1B_SYSCTL(CTL_P1003_1B_SIGQUEUE_MAX, sigqueue_max); P1B_SYSCTL(CTL_P1003_1B_TIMER_MAX, timer_max); --aJd1ttTPPR7r8b0Q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwCfu4ACgkQC3+MBN1Mb4inuACgwDhkHfAox2Km+EKeQkUkYQeM QusAmgLSXQKMzuGanmQD8yhBUlqcvDN3 =Irt5 -----END PGP SIGNATURE----- --aJd1ttTPPR7r8b0Q--