From owner-freebsd-arch@FreeBSD.ORG Sun Nov 5 04:24:32 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 4C48616A4C2 for ; Sun, 5 Nov 2006 04:24:32 +0000 (UTC) (envelope-from myjfw71ijo@ricochet.com) Received: from ricochet.com (pc-56-220-47-190.cm.vtr.net [190.47.220.56]) by mx1.FreeBSD.org (Postfix) with SMTP id 9310243D7E for ; Sun, 5 Nov 2006 04:23:24 +0000 (GMT) (envelope-from myjfw71ijo@ricochet.com) To: From: "See Danna" Date: Sun, 05 Nov 2006 01:23:24 -0400 Message-ID: <543ego652wv.5218@ricochet.com> User-Agent: Mozilla Thunderbird 1.5 (Windows/20060111) X-Accept-Language: en-us, en MIME-Version: 1.0 Content-Type: multipart/related; boundary="------------Next_Part_40328134" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: ij I HAVE ErectileDysfunction PROBLEM IN MY SexLife.. BUT WITH YOUR PRODUCT, WE ACHIEVED LONG LASTING CL1MAX learned thank 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: Sun, 05 Nov 2006 04:24:32 -0000 This is a multi-part message in MIME format. --------------Next_Part_40328134 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable VigraMax - Natural Anti_ImpotencePill BetterThanViagra, fast acting - start working within 30 mins We served over 100,000 satisfied returning customers worldwide (Ship all countries) VigraMax=$0.94/pill Cheaper 20 times than GenuineViagra=$17.50/pill It cures: Loss of Libido, ErectileDysfunction, LackOfSexual desire, Impotence, Mood swings, Sperm count and potency, General weakness & Depression To conclude, VigraMax is the best solution available for all impotence related problems with NO side effects. Only $0.94/pill, Dont waste $ on other pill (click the link to save) http://rtsqxkob.ohyeahwhatisthis.com sorry short grave modern? talked got affect his? sale not again evil independent? --------------Next_Part_40328134 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" shining captain shook quickly. VigraMax - Natural = Anti_ImpotencePill We served = over 100,000 satisfied returning customers worldwide (Ship all = countries) BetterThanViagra, fast acting - start = working within 30 mins VigraMax=3D$0.94/pill Cheaper 20 times than = GenuineViagra=3D$17.50/pill It's fine blend of safe herbs and all essential vitamins to = give you a break from all those erection problems like impotence, ED, = loss of libido, lack of Sexual Derive, etc It cures: Loss of Libido, ErectileDysfunction, LackOfSexual desire, Impotence, Mood = swings, Sperm count and potency, = General weakness & Depression To conclude, VigraMax is the best solution available for = all impotence related problems with NO side effects. [1]kn Only $0.94/pill, Dont waste $ on = other pill (click here) = jv least account embarrass nervous girls discuss quickly. References 1. 3Dhttp://rtsqxkob.ohyeahwhatisthis.com/ --------------Next_Part_40328134-- From owner-freebsd-arch@FreeBSD.ORG Sun Nov 5 17:22:37 2006 Return-Path: X-Original-To: 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 0FD3516A4B3; Sun, 5 Nov 2006 17:22:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id B055143D45; Sun, 5 Nov 2006 17:22:35 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id BFE1146D04; Sun, 5 Nov 2006 12:22:34 -0500 (EST) Date: Sun, 5 Nov 2006 17:22:34 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bruce Evans In-Reply-To: <20061101231230.B31271@delplex.bde.org> Message-ID: <20061105170117.A14555@fledge.watson.org> References: <20061031092122.D96078@fledge.watson.org> <20061031144050.GC13359@garage.freebsd.pl> <20061031144237.B87421@fledge.watson.org> <20061101231230.B31271@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org, Pawel Jakub Dawidek Subject: Re: New in-kernel privilege API: priv(9) 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: Sun, 05 Nov 2006 17:22:37 -0000 On Thu, 2 Nov 2006, Bruce Evans wrote: > I prefer the old code. The privilege check is the normal access control, > and this is unlikely to change since user mounts are so inscure that they > are usually turned off by vfs.usermount so attempting them doesn't get this > far. The structure I've been trying to move towards is one in which privilege is checked for only when required. This will, eventually, allow us to audit the use of privilege "as exercised". The old BSD accounting system used to try to do this, but it didn't actually work since privilege was rather in excess of the minimal requirements, so many things were marked as requiring privilege that didn't. To do this, the structure generally has to start to resemble: error = my_normal_checks(); if (error) { /* * Invoke privilege to exempt the thread from the normal policy. */ error = priv_check(td, PRIV_FOO); if (error) return (error); } > Clearing error indicators and statistics counters and the like could be > under a less generic privilege. Yes, this is a good idea. I'll have to check through and see what other circumstances in which this happens -- I suspect most stats are protected by the sysctl privilege check, so we may need to think about how further to refine that. sysctl is used in rather diverse ways -- for example, during bgfsck to manipulate inode reference counts -- so some more work is generally required there. >>>> Index: sys/dev/ofw/ofw_console.c >>>> =================================================================== >>>> RCS file: /zoo/cvsup/FreeBSD-CVS/src/sys/dev/ofw/ofw_console.c,v >>>> retrieving revision 1.34 >>>> diff -u -r1.34 ofw_console.c >>>> --- sys/dev/ofw/ofw_console.c 30 May 2006 07:56:57 -0000 1.34 >>>> +++ sys/dev/ofw/ofw_console.c 30 Oct 2006 17:07:55 -0000 >>>> @@ -140,7 +140,8 @@ >>>> ttyconsolemode(tp, 0); >>>> >>>> setuptimeout = 1; >>>> - } else if ((tp->t_state & TS_XCLUDE) && suser(td)) { >>>> + } else if ((tp->t_state & TS_XCLUDE) && >>>> + priv_check(td, PRIV_TTY_EXCLUSIVE)) { >>>> return (EBUSY); >>>> } >>>> > > There sure are a lot of these. The conversion to use ttyopen() isn't as > complete as I thought. Yes. > This was apparently clear to someone named rwatson when he replaced the > "cred->cr_uid != ip->i_uid && suser_xxx(...)" check by > VOP_ACCESS(... VADMIN) in ffs in ffs_vnops.c 1.151 (2000/10/19), without > changing the logical expression, but with adding a large comment :-). Yes, what a nefarious fellow! > The bug is that the VADMIN change had not reached many poorly maintained > file systems. Hmm. I'll investigate this further. > The style bugs (boolean tests on non-boolean `error' should be fixed more > globally. In general, I've tried to move code to distinguishing ints used as booleans and as values, but in this patch I've tried to avoid changing code style where possible, since it touches so much code. >>>> Index: sys/kern/tty.c >>>> =================================================================== >>>> RCS file: /zoo/cvsup/FreeBSD-CVS/src/sys/kern/tty.c,v >>>> retrieving revision 1.262 >>>> diff -u -r1.262 tty.c >>>> --- sys/kern/tty.c 26 Oct 2006 21:42:20 -0000 1.262 >>>> +++ sys/kern/tty.c 30 Oct 2006 17:07:55 -0000 >>>> @@ -1169,9 +1170,9 @@ >>>> splx(s); >>>> break; >>>> case TIOCSTI: /* simulate terminal input */ >>>> - if ((flag & FREAD) == 0 && suser(td)) >>>> + if ((flag & FREAD) == 0 && priv_check(td, PRIV_TTY_STI)) >>>> return (EPERM); > > suser() isn't really boolean, so boolean comparison of it with 0 is a > style bug. Here the new and old error value returned is ignored replaced > by EPERM, which is always (?) the same, but other code in even this file > users the return value. > >>>> - if (!isctty(p, tp) && suser(td)) >>>> + if (!isctty(p, tp) && priv_check(td, PRIV_TTY_STI)) >>>> return (EACCES); > > It's strange that this changes the error to a different one. Yes. In general, EPERM is the right error to return for a decision that involves being the owner of an object or having superuser privilege. The only real exception to this is in discretionary access control (permissions, etc) where the permissions (whatever) on the object deny access, in which case EACCES is returned. >>>> @@ -3340,7 +3342,7 @@ >>>> ct = dev->si_drv2; >>>> switch (cmd) { >>>> case TIOCSETA: >>>> - error = suser(td); >>>> + error = priv_check(td, PRIV_TTY_SETA); >>>> if (error != 0) >>>> return (error); >>>> *ct = *(struct termios *)data; > > This isn't really a TTY_SETA privilege, but privilege to change the .init > and .lock devices. This should have been controlled by device access > privilege, but the modes and permissions of these devices have always > been bogus: > - for cua*.* they are uucp:dialer 660, but should be more like root:wheel > 644, with an FWRITE check for the "set" ioctls instead of the priv check. > - for tty*.*, they are root:wheel 600, but should be more like root:wheel > 644 Hmm. > I got bored of even paging through the diffs here :-). Positively mind-numbing stuff, but something where the details really matter... Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-arch@FreeBSD.ORG Mon Nov 6 02:58:03 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 7B45516A47C for ; Mon, 6 Nov 2006 02:58:03 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93F2543D62 for ; Mon, 6 Nov 2006 02:58:01 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by wx-out-0506.google.com with SMTP id i27so838513wxd for ; Sun, 05 Nov 2006 18:58:01 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Nk6CMHY6oPRFVdZxgSc7mtoowzz6HiuAB6RfwI7bs0zarRwTMn0Vyq35eMIPQM05n+aRfMKoH6Ai/9ZhvDnu8tJqMM1sz7sCsHHASliYSuqgCtmffcpizECJBhS5VSsqy4Oer4Ua1EZx2Mn0sCXFfiKygAJ0aLgnK1/Sdy5J6ng= Received: by 10.70.19.16 with SMTP id 16mr4206777wxs.1162781870607; Sun, 05 Nov 2006 18:57:50 -0800 (PST) Received: by 10.70.12.2 with HTTP; Sun, 5 Nov 2006 18:57:50 -0800 (PST) Message-ID: <3bbf2fe10611051857m4c644ad2o7d71a86e46eaf9a8@mail.gmail.com> Date: Mon, 6 Nov 2006 03:57:50 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: freebsd-current@freebsd.org, freebsd-arch@freebsd.org, "John Baldwin" , kmacy@freebsd.org, pho@freebsd.org In-Reply-To: <3bbf2fe10610181518k68356528i154267c0bd1b1a77@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3bbf2fe10610181518k68356528i154267c0bd1b1a77@mail.gmail.com> X-Google-Sender-Auth: eb3e76b2c1b91d35 Cc: Subject: Re: sx locks rewriting - needs testers 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: Mon, 06 Nov 2006 02:58:03 -0000 2006/10/18, Attilio Rao : > In my P4 branch: //depot/user/attilio/attilio_smpng/... > you can find a sx locks rewriting using the optimized semantic of > rwlocks; in the end this might result in a valuable performance > improvement. After have received very positive stress-test feedbacks from pho@ (that I would like to thank for his patience and work) I went ahead and rather completed the implementation. Now this is ready to be reviewed and possibly committed into the CVS. Even if I plan a longer work on this branch (about syncronizing primitives), I think it is time for a revision of the work done until now from SMPng people (jhb, kmacy, etc.) and possibily an inclusion into HEAD (patch actually is 58k...). Some few hints about the patch: - LOCK_DEBUG adds a dependence between sx.h and lock.h (as for rwlocks and mutex) and a the new options SXLOCK_NOINLINE is added - XFS locking is still disabled in the patch (I hope to do it for tomorrow, I'm in GMT+1). - Possibly the sleepqueue interface modifies and new flags might be documented in the manpages (and NOTES file too, in order to reflect SXLOCK_NOINLINE inclusion). - It misses still of the adaptive spinning code, but it can be inserted after without problems. You can download the code directly from perforce (//depot/user/attilio/attilio_smpng/...) but patches are available here: http://users.gufi.org/~rookie/works/patches/smpng06112006.diff http://users.gufi.org/~rookie/works/patches/_sx.h I hope you will enjoy it (feedbacks, ideas, comments would be very appreciated). Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-freebsd-arch@FreeBSD.ORG Tue Nov 7 14:11:43 2006 Return-Path: X-Original-To: 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 DA90716A403; Tue, 7 Nov 2006 14:11:42 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from pittgoth.com (ns1.pittgoth.com [216.38.206.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9C6243D88; Tue, 7 Nov 2006 14:11:40 +0000 (GMT) (envelope-from trhodes@FreeBSD.org) Received: from localhost (ip70-177-190-239.dc.dc.cox.net [70.177.190.239]) (authenticated bits=0) by pittgoth.com (8.13.6/8.13.6) with ESMTP id kA7EBcgm069394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 7 Nov 2006 09:11:39 -0500 (EST) (envelope-from trhodes@FreeBSD.org) Date: Tue, 7 Nov 2006 09:11:28 -0500 From: Tom Rhodes To: standards@FreeBSD.org Message-Id: <20061107091128.063d0ae5.trhodes@FreeBSD.org> Organization: The FreeBSD Project X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: arch@FreeBSD.org Subject: cvs rm sys/posix4 && enable sem 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: Tue, 07 Nov 2006 14:11:43 -0000 Hi, I spent some time this morning working over the P1003_1B_SEMAPHORES option and figured I might as well play with the task of merging posix4/ into regular sys. In light of of this, I also enabled and tested on all architectures, the sem module disabled by Alfred for some unknown (later learned via old email) reason. Does anyone object to the following: 1: Repocopy posix4/* files to sys/sys and sys/kern; 2: patch CURRENT for the change; 3: remove posix4/*; 4: enable sem module; 5: add P1003_1B_SEMAPHORES to GENERIC; 6: (eventually and maybe) merge psched.h and sched.h (I renamed posix4/sched.h to sys/psched.h in this patch). This one is completely optional. The included patch is pretty vanilla and does *most* of this, not counting the repo-copy and added P1003_1B_SEMAPHORES to GENERIC. It also passes my universe build. This also has the side effect of differentiating between the two sched.h files we have in the tree. Thanks, -- Tom Rhodes Index: include/Makefile =================================================================== RCS file: /home/ncvs/src/include/Makefile,v retrieving revision 1.265 diff -u -r1.265 Makefile --- include/Makefile 31 Oct 2006 22:22:29 -0000 1.265 +++ include/Makefile 7 Nov 2006 13:48:11 -0000 @@ -28,7 +28,7 @@ MHDRS= float.h floatingpoint.h stdarg.h -PHDRS= sched.h semaphore.h _semaphore.h +PHDRS= psched.h semaphore.h _semaphore.h LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ termios.h ucontext.h @@ -36,7 +36,7 @@ LDIRS= bsm cam geom net net80211 netatalk netatm netgraph netinet netinet6 \ netipsec ${_netipx} netkey netnatm ${_netncp} netsmb \ nfs nfsclient nfsserver \ - pccard posix4 sys vm + pccard sys vm LSUBDIRS= cam/scsi \ dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ @@ -111,7 +111,7 @@ INCSLINKS+= machine/$i ${INCLUDEDIR}/$i .endfor .for i in ${PHDRS} -INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i +INCSLINKS+= sys/$i ${INCLUDEDIR}/$i .endfor .if ${MACHINE} != ${MACHINE_ARCH} Index: include/pthread.h =================================================================== RCS file: /home/ncvs/src/include/pthread.h,v retrieving revision 1.40 diff -u -r1.40 pthread.h --- include/pthread.h 24 Oct 2005 05:53:54 -0000 1.40 +++ include/pthread.h 7 Nov 2006 13:48:11 -0000 @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include /* Index: lib/libc/stdlib/malloc.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdlib/malloc.c,v retrieving revision 1.137 diff -u -r1.137 malloc.c --- lib/libc/stdlib/malloc.c 8 Sep 2006 17:52:15 -0000 1.137 +++ lib/libc/stdlib/malloc.c 7 Nov 2006 13:48:13 -0000 @@ -210,7 +210,7 @@ #include #include #include -#include +#include #include #include #include Index: lib/libc/sys/sched_get_priority_max.2 =================================================================== RCS file: /home/ncvs/src/lib/libc/sys/sched_get_priority_max.2,v retrieving revision 1.19 diff -u -r1.19 sched_get_priority_max.2 --- lib/libc/sys/sched_get_priority_max.2 2 Jul 2004 23:52:13 -0000 1.19 +++ lib/libc/sys/sched_get_priority_max.2 7 Nov 2006 13:48:13 -0000 @@ -35,7 +35,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sched.h +.In psched.h .Ft int .Fn sched_get_priority_max "int policy" .Ft int @@ -67,7 +67,7 @@ The value of .Fa policy should be one of the scheduling policy values defined in -.Fa : +.Fa : .Bl -tag -width [SCHED_OTHER] .It Bq Er SCHED_FIFO First-in-first-out fixed priority scheduling with no round robin scheduling; Index: lib/libc/sys/sched_setparam.2 =================================================================== RCS file: /home/ncvs/src/lib/libc/sys/sched_setparam.2,v retrieving revision 1.17 diff -u -r1.17 sched_setparam.2 --- lib/libc/sys/sched_setparam.2 4 Jul 2004 20:55:48 -0000 1.17 +++ lib/libc/sys/sched_setparam.2 7 Nov 2006 13:48:13 -0000 @@ -33,7 +33,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sched.h +.In psched.h .Ft int .Fn sched_setparam "pid_t pid" "const struct sched_param *param" .Ft int Index: lib/libc/sys/sched_setscheduler.2 =================================================================== RCS file: /home/ncvs/src/lib/libc/sys/sched_setscheduler.2,v retrieving revision 1.17 diff -u -r1.17 sched_setscheduler.2 --- lib/libc/sys/sched_setscheduler.2 2 Jul 2004 23:52:13 -0000 1.17 +++ lib/libc/sys/sched_setscheduler.2 7 Nov 2006 13:48:13 -0000 @@ -33,7 +33,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sched.h +.In psched.h .Ft int .Fn sched_setscheduler "pid_t pid" "int policy" "const struct sched_param *param" .Ft int @@ -81,7 +81,7 @@ as a write-style operation. .Pp The scheduling policies are in -.Fa : +.Fa : .Bl -tag -width [SCHED_OTHER] .It Bq Er SCHED_FIFO First-in-first-out fixed priority scheduling with no round robin scheduling; @@ -94,7 +94,7 @@ The .Vt sched_param structure is defined in -.Fa : +.Fa : .Pp .Bd -literal -offset indent struct sched_param { Index: lib/libc/sys/sched_yield.2 =================================================================== RCS file: /home/ncvs/src/lib/libc/sys/sched_yield.2,v retrieving revision 1.13 diff -u -r1.13 sched_yield.2 --- lib/libc/sys/sched_yield.2 2 Jul 2004 23:52:13 -0000 1.13 +++ lib/libc/sys/sched_yield.2 7 Nov 2006 13:48:13 -0000 @@ -32,7 +32,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sched.h +.In psched.h .Ft int .Fn sched_yield void .Sh DESCRIPTION Index: lib/libc_r/test/mutex_d.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/test/mutex_d.c,v retrieving revision 1.4 diff -u -r1.4 mutex_d.c --- lib/libc_r/test/mutex_d.c 4 Jun 2003 20:38:54 -0000 1.4 +++ lib/libc_r/test/mutex_d.c 7 Nov 2006 13:48:13 -0000 @@ -39,7 +39,7 @@ #include #include #include "pthread.h" -#include +#include #include #include #include Index: lib/libc_r/uthread/pthread_private.h =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/pthread_private.h,v retrieving revision 1.87 diff -u -r1.87 pthread_private.h --- lib/libc_r/uthread/pthread_private.h 31 May 2005 19:57:23 -0000 1.87 +++ lib/libc_r/uthread/pthread_private.h 7 Nov 2006 13:48:13 -0000 @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include #include Index: lib/libc_r/uthread/uthread_spinlock.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_spinlock.c,v retrieving revision 1.12 diff -u -r1.12 uthread_spinlock.c --- lib/libc_r/uthread/uthread_spinlock.c 26 Mar 2003 04:02:24 -0000 1.12 +++ lib/libc_r/uthread/uthread_spinlock.c 7 Nov 2006 13:48:13 -0000 @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include Index: lib/libpthread/test/mutex_d.c =================================================================== RCS file: /home/ncvs/src/lib/libpthread/test/mutex_d.c,v retrieving revision 1.5 diff -u -r1.5 mutex_d.c --- lib/libpthread/test/mutex_d.c 19 Nov 2005 04:47:06 -0000 1.5 +++ lib/libpthread/test/mutex_d.c 7 Nov 2006 13:48:15 -0000 @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include Index: lib/libpthread/thread/thr_private.h =================================================================== RCS file: /home/ncvs/src/lib/libpthread/thread/thr_private.h,v retrieving revision 1.127 diff -u -r1.127 thr_private.h --- lib/libpthread/thread/thr_private.h 9 Jun 2006 14:23:40 -0000 1.127 +++ lib/libpthread/thread/thr_private.h 7 Nov 2006 13:48:15 -0000 @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include @@ -1257,7 +1257,7 @@ int __sys_ioctl(int, unsigned long, ...); #endif -/* #inclde */ +/* #inclde */ #ifdef _SCHED_H_ int __sys_sched_yield(void); #endif Index: lib/libthr/thread/thr_yield.c =================================================================== RCS file: /home/ncvs/src/lib/libthr/thread/thr_yield.c,v retrieving revision 1.2 diff -u -r1.2 thr_yield.c --- lib/libthr/thread/thr_yield.c 4 Apr 2006 02:57:49 -0000 1.2 +++ lib/libthr/thread/thr_yield.c 7 Nov 2006 13:48:40 -0000 @@ -34,7 +34,7 @@ #include "namespace.h" #include -#include +#include #include "un-namespace.h" __weak_reference(_pthread_yield, pthread_yield); Index: share/man/man4/sem.4 =================================================================== RCS file: /home/ncvs/src/share/man/man4/sem.4,v retrieving revision 1.2 diff -u -r1.2 sem.4 --- share/man/man4/sem.4 2 Jun 2003 11:19:23 -0000 1.2 +++ share/man/man4/sem.4 7 Nov 2006 13:48:49 -0000 @@ -24,19 +24,26 @@ .\" .\" $FreeBSD: src/share/man/man4/sem.4,v 1.2 2003/06/02 11:19:23 ru Exp $ .\" -.Dd January 14, 2003 +.Dd November 6, 2006 .Dt SEM 4 .Os .Sh NAME .Nm sem .Nd POSIX semaphores .Sh SYNOPSIS -To link into the kernel: +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: .Bd -ragged -offset indent .Cd "options P1003_1B_SEMAPHORES" .Ed .Pp -To load as a kernel loadable module: +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +sem_load="YES" +.Ed .Pp .Dl "kldload sem" .Sh DESCRIPTION @@ -47,6 +54,10 @@ to implement .Tn POSIX semaphores. +This facility offers support for such functions as +.Fn sem_init +and +.Fn sem_wait . It is available both as a kernel option for static inclusion and as a dynamic kernel module. .Sh SEE ALSO @@ -68,3 +79,4 @@ .Nm kernel module appeared in .Fx 5.0 . +.\" XXX: This manual page is weak with details and info. Index: sys/Makefile =================================================================== RCS file: /home/ncvs/src/sys/Makefile,v retrieving revision 1.38 diff -u -r1.38 Makefile --- sys/Makefile 10 Aug 2006 06:29:43 -0000 1.38 +++ sys/Makefile 7 Nov 2006 13:48:49 -0000 @@ -11,7 +11,7 @@ CSCOPEDIRS= coda compat conf contrib crypto ddb dev fs geom gnu i4b isa \ isofs kern libkern modules net net80211 netatalk netatm \ netgraph netinet netinet6 netipx netkey netnatm netncp \ - netsmb nfs nfsclient nfs4client rpc pccard pci posix4 sys \ + netsmb nfs nfsclient nfs4client rpc pccard pci sys \ ufs vm ${ARCHDIR} ARCHDIR ?= ${MACHINE} Index: sys/amd64/linux32/linux32_proto.h =================================================================== RCS file: /home/ncvs/src/sys/amd64/linux32/linux32_proto.h,v retrieving revision 1.25 diff -u -r1.25 linux32_proto.h --- sys/amd64/linux32/linux32_proto.h 29 Oct 2006 14:12:44 -0000 1.25 +++ sys/amd64/linux32/linux32_proto.h 7 Nov 2006 13:48:50 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/compat/freebsd32/freebsd32_proto.h =================================================================== RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_proto.h,v retrieving revision 1.74 diff -u -r1.74 freebsd32_proto.h --- sys/compat/freebsd32/freebsd32_proto.h 3 Nov 2006 21:23:33 -0000 1.74 +++ sys/compat/freebsd32/freebsd32_proto.h 7 Nov 2006 13:48:51 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/compat/linux/linux_misc.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_misc.c,v retrieving revision 1.191 diff -u -r1.191 linux_misc.c --- sys/compat/linux/linux_misc.c 28 Oct 2006 16:47:38 -0000 1.191 +++ sys/compat/linux/linux_misc.c 7 Nov 2006 13:48:51 -0000 @@ -72,7 +72,7 @@ #include #include -#include +#include #include #include Index: sys/compat/svr4/svr4_proto.h =================================================================== RCS file: /home/ncvs/src/sys/compat/svr4/svr4_proto.h,v retrieving revision 1.27 diff -u -r1.27 svr4_proto.h --- sys/compat/svr4/svr4_proto.h 15 Aug 2006 17:36:59 -0000 1.27 +++ sys/compat/svr4/svr4_proto.h 7 Nov 2006 13:48:51 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/conf/files =================================================================== RCS file: /home/ncvs/src/sys/conf/files,v retrieving revision 1.1159 diff -u -r1.1159 files --- sys/conf/files 3 Nov 2006 21:09:03 -0000 1.1159 +++ sys/conf/files 7 Nov 2006 13:48:52 -0000 @@ -1315,6 +1315,7 @@ kern/inflate.c optional gzip kern/init_main.c standard kern/init_sysent.c standard +kern/ksched.c optional _kposix_priority_scheduling kern/kern_acct.c standard kern/kern_acl.c standard kern/kern_alq.c optional alq @@ -1374,6 +1375,8 @@ kern/linker_if.m standard kern/md4c.c optional netsmb kern/md5c.c standard +kern/p1003_1b.c standard +kern/posix4_mib.c standard kern/sched_4bsd.c optional sched_4bsd kern/sched_core.c optional sched_core kern/sched_ule.c optional sched_ule @@ -1918,9 +1921,6 @@ pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci pci/xrpu.c optional xrpu pci -posix4/ksched.c optional _kposix_priority_scheduling -posix4/p1003_1b.c standard -posix4/posix4_mib.c standard rpc/rpcclnt.c optional nfsclient security/audit/audit.c optional audit security/audit/audit_arg.c optional audit Index: sys/i386/ibcs2/ibcs2_proto.h =================================================================== RCS file: /home/ncvs/src/sys/i386/ibcs2/ibcs2_proto.h,v retrieving revision 1.30 diff -u -r1.30 ibcs2_proto.h --- sys/i386/ibcs2/ibcs2_proto.h 15 Aug 2006 17:37:00 -0000 1.30 +++ sys/i386/ibcs2/ibcs2_proto.h 7 Nov 2006 13:49:01 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/i386/ibcs2/ibcs2_xenix.h =================================================================== RCS file: /home/ncvs/src/sys/i386/ibcs2/ibcs2_xenix.h,v retrieving revision 1.21 diff -u -r1.21 ibcs2_xenix.h --- sys/i386/ibcs2/ibcs2_xenix.h 15 Aug 2006 17:37:00 -0000 1.21 +++ sys/i386/ibcs2/ibcs2_xenix.h 7 Nov 2006 13:49:01 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/i386/linux/linux_proto.h =================================================================== RCS file: /home/ncvs/src/sys/i386/linux/linux_proto.h,v retrieving revision 1.86 diff -u -r1.86 linux_proto.h --- sys/i386/linux/linux_proto.h 29 Oct 2006 14:12:44 -0000 1.86 +++ sys/i386/linux/linux_proto.h 7 Nov 2006 13:49:01 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/kern/Make.tags.inc =================================================================== RCS file: /home/ncvs/src/sys/kern/Make.tags.inc,v retrieving revision 1.15 diff -u -r1.15 Make.tags.inc --- sys/kern/Make.tags.inc 5 Mar 2003 19:24:21 -0000 1.15 +++ sys/kern/Make.tags.inc 7 Nov 2006 13:49:01 -0000 @@ -47,7 +47,6 @@ ${SYS}/netnatm/*.[ch] \ ${SYS}/nfs/*.[ch] \ ${SYS}/pci/*.[ch] \ - ${SYS}/posix4/*.[ch] \ ${SYS}/ufs/ffs/*.[ch] \ ${SYS}/ufs/ufs/*.[ch] \ ${SYS}/vm/*.[ch] \ @@ -64,7 +63,6 @@ ${SYS}/netnatm \ ${SYS}/nfs \ ${SYS}/pci \ - ${SYS}/posix4 \ ${SYS}/vm \ ${SYS}/sys Index: sys/kern/kern_sig.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_sig.c,v retrieving revision 1.335 diff -u -r1.335 kern_sig.c --- sys/kern/kern_sig.c 26 Oct 2006 21:42:19 -0000 1.335 +++ sys/kern/kern_sig.c 7 Nov 2006 13:49:01 -0000 @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -76,7 +77,6 @@ #include #include -#include #include #include Index: sys/kern/kern_thr.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_thr.c,v retrieving revision 1.54 diff -u -r1.54 kern_thr.c --- sys/kern/kern_thr.c 26 Oct 2006 21:42:20 -0000 1.54 +++ sys/kern/kern_thr.c 7 Nov 2006 13:49:01 -0000 @@ -33,7 +33,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -45,8 +47,6 @@ #include #include #include -#include -#include #include #include Index: sys/kern/kern_time.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_time.c,v retrieving revision 1.134 diff -u -r1.134 kern_time.c --- sys/kern/kern_time.c 22 Oct 2006 11:52:13 -0000 1.134 +++ sys/kern/kern_time.c 7 Nov 2006 13:49:01 -0000 @@ -48,14 +48,13 @@ #include #include #include +#include #include #include #include #include #include -#include - #include #include Index: sys/kern/makesyscalls.sh =================================================================== RCS file: /home/ncvs/src/sys/kern/makesyscalls.sh,v retrieving revision 1.66 diff -u -r1.66 makesyscalls.sh --- sys/kern/makesyscalls.sh 15 Aug 2006 17:09:32 -0000 1.66 +++ sys/kern/makesyscalls.sh 7 Nov 2006 13:49:01 -0000 @@ -125,7 +125,7 @@ printf "#define\t%s\n\n", sysproto_h > sysarg printf "#include \n" > sysarg printf "#include \n" > sysarg - printf "#include \n" > sysarg + printf "#include \n" > sysarg printf "#include \n\n" > sysarg printf "#include \n\n" > sysarg printf "struct proc;\n\n" > sysarg Index: sys/kern/uipc_mqueue.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_mqueue.c,v retrieving revision 1.16 diff -u -r1.16 uipc_mqueue.c --- sys/kern/uipc_mqueue.c 26 Sep 2006 04:12:47 -0000 1.16 +++ sys/kern/uipc_mqueue.c 7 Nov 2006 13:49:01 -0000 @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -78,7 +79,6 @@ #include #include #include -#include /* * Limits and constants Index: sys/kern/uipc_sem.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_sem.c,v retrieving revision 1.25 diff -u -r1.25 uipc_sem.c --- sys/kern/uipc_sem.c 22 Oct 2006 11:52:13 -0000 1.25 +++ sys/kern/uipc_sem.c 7 Nov 2006 13:49:01 -0000 @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include #include @@ -49,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -56,11 +59,7 @@ #include #include #include - -#include -#include -#include -#include +#include #include Index: sys/kern/vfs_aio.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_aio.c,v retrieving revision 1.228 diff -u -r1.228 vfs_aio.c --- sys/kern/vfs_aio.c 15 Oct 2006 14:22:13 -0000 1.228 +++ sys/kern/vfs_aio.c 7 Nov 2006 13:49:12 -0000 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,6 @@ #include -#include #include #include #include Index: sys/modules/Makefile =================================================================== RCS file: /home/ncvs/src/sys/modules/Makefile,v retrieving revision 1.510 diff -u -r1.510 Makefile --- sys/modules/Makefile 9 Sep 2006 16:58:22 -0000 1.510 +++ sys/modules/Makefile 7 Nov 2006 13:49:12 -0000 @@ -219,6 +219,7 @@ scc \ scd \ ${_scsi_low} \ + sem \ sf \ ${_sio} \ sis \ Index: sys/security/mac/mac_posix_sem.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac/mac_posix_sem.c,v retrieving revision 1.3 diff -u -r1.3 mac_posix_sem.c --- sys/security/mac/mac_posix_sem.c 22 Oct 2006 11:52:18 -0000 1.3 +++ sys/security/mac/mac_posix_sem.c 7 Nov 2006 13:49:21 -0000 @@ -37,14 +37,13 @@ #include #include +#include #include #include #include #include #include -#include - #include #include Index: sys/security/mac_biba/mac_biba.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac_biba/mac_biba.c,v retrieving revision 1.94 diff -u -r1.94 mac_biba.c --- sys/security/mac_biba/mac_biba.c 12 Sep 2006 04:25:12 -0000 1.94 +++ sys/security/mac_biba/mac_biba.c 7 Nov 2006 13:49:21 -0000 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -66,8 +67,6 @@ #include #include -#include - #include #include Index: sys/security/mac_mls/mac_mls.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac_mls/mac_mls.c,v retrieving revision 1.77 diff -u -r1.77 mac_mls.c --- sys/security/mac_mls/mac_mls.c 12 Sep 2006 04:25:12 -0000 1.77 +++ sys/security/mac_mls/mac_mls.c 7 Nov 2006 13:49:21 -0000 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -66,8 +67,6 @@ #include #include -#include - #include #include Index: sys/security/mac_stub/mac_stub.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac_stub/mac_stub.c,v retrieving revision 1.56 diff -u -r1.56 mac_stub.c --- sys/security/mac_stub/mac_stub.c 19 Sep 2005 18:52:51 -0000 1.56 +++ sys/security/mac_stub/mac_stub.c 7 Nov 2006 13:49:21 -0000 @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -68,8 +69,6 @@ #include #include -#include - #include #include Index: sys/security/mac_test/mac_test.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac_test/mac_test.c,v retrieving revision 1.63 diff -u -r1.63 mac_test.c --- sys/security/mac_test/mac_test.c 19 Sep 2005 18:52:51 -0000 1.63 +++ sys/security/mac_test/mac_test.c 7 Nov 2006 13:49:21 -0000 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -63,8 +64,6 @@ #include #include -#include - #include #include Index: sys/sys/sysproto.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sysproto.h,v retrieving revision 1.211 diff -u -r1.211 sysproto.h --- sys/sys/sysproto.h 3 Nov 2006 18:57:49 -0000 1.211 +++ sys/sys/sysproto.h 7 Nov 2006 13:49:31 -0000 @@ -11,8 +11,8 @@ #include #include -#include #include +#include #include Index: sys/sys/thr.h =================================================================== RCS file: /home/ncvs/src/sys/sys/thr.h,v retrieving revision 1.11 diff -u -r1.11 thr.h --- sys/sys/thr.h 22 Sep 2006 15:04:28 -0000 1.11 +++ sys/sys/thr.h 7 Nov 2006 13:49:31 -0000 @@ -30,7 +30,7 @@ #ifndef _SYS_THR_H_ #define _SYS_THR_H_ -#include +#include /* Create the thread in the suspended state. */ #define THR_SUSPENDED 0x0001 Index: usr.bin/kdump/mksubr =================================================================== RCS file: /home/ncvs/src/usr.bin/kdump/mksubr,v retrieving revision 1.4 diff -u -r1.4 mksubr --- usr.bin/kdump/mksubr 18 Sep 2006 13:49:57 -0000 1.4 +++ usr.bin/kdump/mksubr 7 Nov 2006 13:49:46 -0000 @@ -112,7 +112,7 @@ #include #include #include -#include +#include #include #define _KERNEL #include @@ -295,7 +295,7 @@ auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" -auto_switch_type "schedpolicyname" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" +auto_switch_type "schedpolicyname" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "psched.h" auto_switch_type "kldunloadfflagsname" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" auto_switch_type "ksethrcmdname" "KSE_INTR_[A-Z]+[[:space:]]+[0-9]+" "sys/kse.h" auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" From owner-freebsd-arch@FreeBSD.ORG Tue Nov 7 15:16:35 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 4323C16A4D1; Tue, 7 Nov 2006 15:16:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE12043DC9; Tue, 7 Nov 2006 15:15:33 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id kA7FFVGe058066; Tue, 7 Nov 2006 10:15:31 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-arch@freebsd.org Date: Tue, 7 Nov 2006 09:55:16 -0500 User-Agent: KMail/1.9.1 References: <20061107091128.063d0ae5.trhodes@FreeBSD.org> In-Reply-To: <20061107091128.063d0ae5.trhodes@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200611070955.17274.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Tue, 07 Nov 2006 10:15:31 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2172/Tue Nov 7 09:04:48 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Tom Rhodes , standards@freebsd.org Subject: Re: cvs rm sys/posix4 && enable sem 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: Tue, 07 Nov 2006 15:16:35 -0000 On Tuesday 07 November 2006 09:11, Tom Rhodes wrote: > Hi, > > I spent some time this morning working over the P1003_1B_SEMAPHORES > option and figured I might as well play with the task of merging > posix4/ into regular sys. In light of of this, I also enabled and > tested on all architectures, the sem module disabled by Alfred > for some unknown (later learned via old email) reason. > > Does anyone object to the following: > > 1: Repocopy posix4/* files to sys/sys and sys/kern; > 2: patch CURRENT for the change; > 3: remove posix4/*; > 4: enable sem module; > 5: add P1003_1B_SEMAPHORES to GENERIC; > 6: (eventually and maybe) merge psched.h and sched.h (I renamed > posix4/sched.h to sys/psched.h in this patch). This one is > completely optional. > > The included patch is pretty vanilla and does *most* of this, > not counting the repo-copy and added P1003_1B_SEMAPHORES to > GENERIC. It also passes my universe build. This also has the > side effect of differentiating between the two sched.h files we > have in the tree. Thanks, I think the psched.h rename needs more thought. I think POSIX says that you include sched.h (not psched.h) for various APIs such as sched_yield(), sched_setscheduler(), etc. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Tue Nov 7 15:27:29 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 BB0FC16A47B; Tue, 7 Nov 2006 15:27:29 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from pittgoth.com (ns1.pittgoth.com [216.38.206.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 362A943D6D; Tue, 7 Nov 2006 15:27:28 +0000 (GMT) (envelope-from trhodes@FreeBSD.org) Received: from localhost (ip70-177-190-239.dc.dc.cox.net [70.177.190.239]) (authenticated bits=0) by pittgoth.com (8.13.6/8.13.6) with ESMTP id kA7FRL5i070025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 7 Nov 2006 10:27:22 -0500 (EST) (envelope-from trhodes@FreeBSD.org) Date: Tue, 7 Nov 2006 10:27:08 -0500 From: Tom Rhodes To: John Baldwin Message-Id: <20061107102708.213d53ca.trhodes@FreeBSD.org> In-Reply-To: <200611070955.17274.jhb@freebsd.org> References: <20061107091128.063d0ae5.trhodes@FreeBSD.org> <200611070955.17274.jhb@freebsd.org> Organization: The FreeBSD Project X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: trhodes@FreeBSD.org, standards@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: cvs rm sys/posix4 && enable sem 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: Tue, 07 Nov 2006 15:27:29 -0000 On Tue, 7 Nov 2006 09:55:16 -0500 John Baldwin wrote: > On Tuesday 07 November 2006 09:11, Tom Rhodes wrote: > > Hi, > > > > I spent some time this morning working over the P1003_1B_SEMAPHORES > > option and figured I might as well play with the task of merging > > posix4/ into regular sys. In light of of this, I also enabled and > > tested on all architectures, the sem module disabled by Alfred > > for some unknown (later learned via old email) reason. > > > > Does anyone object to the following: > > > > 1: Repocopy posix4/* files to sys/sys and sys/kern; > > 2: patch CURRENT for the change; > > 3: remove posix4/*; > > 4: enable sem module; > > 5: add P1003_1B_SEMAPHORES to GENERIC; > > 6: (eventually and maybe) merge psched.h and sched.h (I renamed > > posix4/sched.h to sys/psched.h in this patch). This one is > > completely optional. > > > > The included patch is pretty vanilla and does *most* of this, > > not counting the repo-copy and added P1003_1B_SEMAPHORES to > > GENERIC. It also passes my universe build. This also has the > > side effect of differentiating between the two sched.h files we > > have in the tree. Thanks, > > I think the psched.h rename needs more thought. I think POSIX says that > you include sched.h (not psched.h) for various APIs such as sched_yield(), > sched_setscheduler(), etc. I'd like to merge them and will gladly go that route if people support it. ;) -- Tom Rhodes From owner-freebsd-arch@FreeBSD.ORG Fri Nov 10 03:04:41 2006 Return-Path: X-Original-To: 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 AC96B16A403; Fri, 10 Nov 2006 03:04:41 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from pittgoth.com (ns1.pittgoth.com [216.38.206.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2889043D46; Fri, 10 Nov 2006 03:04:41 +0000 (GMT) (envelope-from trhodes@FreeBSD.org) Received: from localhost (net-ix.gw.ai.net [205.134.160.6] (may be forged)) (authenticated bits=0) by pittgoth.com (8.13.6/8.13.6) with ESMTP id kAA34d1Y090497 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 9 Nov 2006 22:04:40 -0500 (EST) (envelope-from trhodes@FreeBSD.org) Date: Thu, 9 Nov 2006 22:04:29 -0500 From: Tom Rhodes To: standards@FreeBSD.org Message-Id: <20061109220429.14b933dd.trhodes@FreeBSD.org> In-Reply-To: <20061107091128.063d0ae5.trhodes@FreeBSD.org> References: <20061107091128.063d0ae5.trhodes@FreeBSD.org> Organization: The FreeBSD Project X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: arch@FreeBSD.org Subject: New Patch [was: Re: cvs rm sys/posix4 && enable sem] 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: Fri, 10 Nov 2006 03:04:41 -0000 On Tue, 7 Nov 2006 09:11:28 -0500 Tom Rhodes wrote: Following up to myself, > Hi, > > I spent some time this morning working over the P1003_1B_SEMAPHORES > option and figured I might as well play with the task of merging > posix4/ into regular sys. In light of of this, I also enabled and > tested on all architectures, the sem module disabled by Alfred > for some unknown (later learned via old email) reason. > > Does anyone object to the following: > > 1: Repocopy posix4/* files to sys/sys and sys/kern; > 2: patch CURRENT for the change; > 3: remove posix4/*; > 4: enable sem module; > 5: add P1003_1B_SEMAPHORES to GENERIC; > 6: (eventually and maybe) merge psched.h and sched.h (I renamed > posix4/sched.h to sys/psched.h in this patch). This one is > completely optional. > > The included patch is pretty vanilla and does *most* of this, > not counting the repo-copy and added P1003_1B_SEMAPHORES to > GENERIC. It also passes my universe build. This also has the > side effect of differentiating between the two sched.h files we > have in the tree. Thanks, > New patch which merges posix4/sched.h and sys/sched.h into the same file. This will add an extra step to my above list of "steps" as, in place of a repo-copy, I'll commit the diff to sys/sched.h with a note. And, because I'm not a lawyer, I also included the posix4/sched.h copyright; I'd prefer to be safe than sorry. I'm sorry for the wait on this new patch; but I wanted to give others a chance to chime in before making major changes. If there are no problems, I would hope to get this in the tree this weekend or perhaps Monday. Yes, it survived another make universe. Thanks, -- Tom Rhodes ? posix.diff ? sys/kern/ksched.c ? sys/kern/p1003_1b.c ? sys/kern/posix4_mib.c ? sys/sys/_semaphore.h ? sys/sys/ksem.h ? sys/sys/posix4.h ? sys/sys/semaphore.h Index: include/Makefile =================================================================== RCS file: /home/ncvs/src/include/Makefile,v retrieving revision 1.265 diff -u -r1.265 Makefile --- include/Makefile 31 Oct 2006 22:22:29 -0000 1.265 +++ include/Makefile 9 Nov 2006 11:06:09 -0000 @@ -36,7 +36,7 @@ LDIRS= bsm cam geom net net80211 netatalk netatm netgraph netinet netinet6 \ netipsec ${_netipx} netkey netnatm ${_netncp} netsmb \ nfs nfsclient nfsserver \ - pccard posix4 sys vm + pccard sys vm LSUBDIRS= cam/scsi \ dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ @@ -111,7 +111,7 @@ INCSLINKS+= machine/$i ${INCLUDEDIR}/$i .endfor .for i in ${PHDRS} -INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i +INCSLINKS+= sys/$i ${INCLUDEDIR}/$i .endfor .if ${MACHINE} != ${MACHINE_ARCH} Index: share/man/man4/sem.4 =================================================================== RCS file: /home/ncvs/src/share/man/man4/sem.4,v retrieving revision 1.2 diff -u -r1.2 sem.4 --- share/man/man4/sem.4 2 Jun 2003 11:19:23 -0000 1.2 +++ share/man/man4/sem.4 9 Nov 2006 11:06:44 -0000 @@ -24,19 +24,26 @@ .\" .\" $FreeBSD: src/share/man/man4/sem.4,v 1.2 2003/06/02 11:19:23 ru Exp $ .\" -.Dd January 14, 2003 +.Dd November 6, 2006 .Dt SEM 4 .Os .Sh NAME .Nm sem .Nd POSIX semaphores .Sh SYNOPSIS -To link into the kernel: +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: .Bd -ragged -offset indent .Cd "options P1003_1B_SEMAPHORES" .Ed .Pp -To load as a kernel loadable module: +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +sem_load="YES" +.Ed .Pp .Dl "kldload sem" .Sh DESCRIPTION @@ -47,6 +54,10 @@ to implement .Tn POSIX semaphores. +This facility offers support for such functions as +.Fn sem_init +and +.Fn sem_wait . It is available both as a kernel option for static inclusion and as a dynamic kernel module. .Sh SEE ALSO @@ -68,3 +79,4 @@ .Nm kernel module appeared in .Fx 5.0 . +.\" XXX: This manual page is weak with details and info. Index: sys/Makefile =================================================================== RCS file: /home/ncvs/src/sys/Makefile,v retrieving revision 1.38 diff -u -r1.38 Makefile --- sys/Makefile 10 Aug 2006 06:29:43 -0000 1.38 +++ sys/Makefile 9 Nov 2006 11:06:45 -0000 @@ -11,7 +11,7 @@ CSCOPEDIRS= coda compat conf contrib crypto ddb dev fs geom gnu i4b isa \ isofs kern libkern modules net net80211 netatalk netatm \ netgraph netinet netinet6 netipx netkey netnatm netncp \ - netsmb nfs nfsclient nfs4client rpc pccard pci posix4 sys \ + netsmb nfs nfsclient nfs4client rpc pccard pci sys \ ufs vm ${ARCHDIR} ARCHDIR ?= ${MACHINE} Index: sys/compat/linux/linux_misc.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_misc.c,v retrieving revision 1.192 diff -u -r1.192 linux_misc.c --- sys/compat/linux/linux_misc.c 6 Nov 2006 13:41:49 -0000 1.192 +++ sys/compat/linux/linux_misc.c 9 Nov 2006 11:06:46 -0000 @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -73,8 +74,6 @@ #include #include -#include - #include #include #include Index: sys/conf/files =================================================================== RCS file: /home/ncvs/src/sys/conf/files,v retrieving revision 1.1160 diff -u -r1.1160 files --- sys/conf/files 6 Nov 2006 13:37:18 -0000 1.1160 +++ sys/conf/files 9 Nov 2006 11:06:53 -0000 @@ -1315,6 +1315,7 @@ kern/inflate.c optional gzip kern/init_main.c standard kern/init_sysent.c standard +kern/ksched.c optional _kposix_priority_scheduling kern/kern_acct.c standard kern/kern_acl.c standard kern/kern_alq.c optional alq @@ -1375,6 +1376,8 @@ kern/linker_if.m standard kern/md4c.c optional netsmb kern/md5c.c standard +kern/p1003_1b.c standard +kern/posix4_mib.c standard kern/sched_4bsd.c optional sched_4bsd kern/sched_core.c optional sched_core kern/sched_ule.c optional sched_ule @@ -1919,9 +1922,6 @@ pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci pci/xrpu.c optional xrpu pci -posix4/ksched.c optional _kposix_priority_scheduling -posix4/p1003_1b.c standard -posix4/posix4_mib.c standard rpc/rpcclnt.c optional nfsclient security/audit/audit.c optional audit security/audit/audit_arg.c optional audit Index: sys/i386/ibcs2/ibcs2_proto.h =================================================================== RCS file: /home/ncvs/src/sys/i386/ibcs2/ibcs2_proto.h,v retrieving revision 1.30 diff -u -r1.30 ibcs2_proto.h --- sys/i386/ibcs2/ibcs2_proto.h 15 Aug 2006 17:37:00 -0000 1.30 +++ sys/i386/ibcs2/ibcs2_proto.h 9 Nov 2006 11:07:02 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/i386/ibcs2/ibcs2_xenix.h =================================================================== RCS file: /home/ncvs/src/sys/i386/ibcs2/ibcs2_xenix.h,v retrieving revision 1.21 diff -u -r1.21 ibcs2_xenix.h --- sys/i386/ibcs2/ibcs2_xenix.h 15 Aug 2006 17:37:00 -0000 1.21 +++ sys/i386/ibcs2/ibcs2_xenix.h 9 Nov 2006 11:07:02 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/i386/linux/linux_proto.h =================================================================== RCS file: /home/ncvs/src/sys/i386/linux/linux_proto.h,v retrieving revision 1.86 diff -u -r1.86 linux_proto.h --- sys/i386/linux/linux_proto.h 29 Oct 2006 14:12:44 -0000 1.86 +++ sys/i386/linux/linux_proto.h 9 Nov 2006 11:07:02 -0000 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include Index: sys/kern/Make.tags.inc =================================================================== RCS file: /home/ncvs/src/sys/kern/Make.tags.inc,v retrieving revision 1.15 diff -u -r1.15 Make.tags.inc --- sys/kern/Make.tags.inc 5 Mar 2003 19:24:21 -0000 1.15 +++ sys/kern/Make.tags.inc 9 Nov 2006 11:07:03 -0000 @@ -47,7 +47,6 @@ ${SYS}/netnatm/*.[ch] \ ${SYS}/nfs/*.[ch] \ ${SYS}/pci/*.[ch] \ - ${SYS}/posix4/*.[ch] \ ${SYS}/ufs/ffs/*.[ch] \ ${SYS}/ufs/ufs/*.[ch] \ ${SYS}/vm/*.[ch] \ @@ -64,7 +63,6 @@ ${SYS}/netnatm \ ${SYS}/nfs \ ${SYS}/pci \ - ${SYS}/posix4 \ ${SYS}/vm \ ${SYS}/sys Index: sys/kern/kern_time.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_time.c,v retrieving revision 1.135 diff -u -r1.135 kern_time.c --- sys/kern/kern_time.c 6 Nov 2006 13:42:01 -0000 1.135 +++ sys/kern/kern_time.c 9 Nov 2006 11:07:03 -0000 @@ -50,13 +50,12 @@ #include #include #include +#include #include #include #include #include -#include - #include #include Index: sys/kern/makesyscalls.sh =================================================================== RCS file: /home/ncvs/src/sys/kern/makesyscalls.sh,v retrieving revision 1.66 diff -u -r1.66 makesyscalls.sh --- sys/kern/makesyscalls.sh 15 Aug 2006 17:09:32 -0000 1.66 +++ sys/kern/makesyscalls.sh 9 Nov 2006 11:07:03 -0000 @@ -125,7 +125,7 @@ printf "#define\t%s\n\n", sysproto_h > sysarg printf "#include \n" > sysarg printf "#include \n" > sysarg - printf "#include \n" > sysarg + printf "#include \n" > sysarg printf "#include \n\n" > sysarg printf "#include \n\n" > sysarg printf "struct proc;\n\n" > sysarg Index: sys/kern/uipc_mqueue.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_mqueue.c,v retrieving revision 1.17 diff -u -r1.17 uipc_mqueue.c --- sys/kern/uipc_mqueue.c 6 Nov 2006 13:42:01 -0000 1.17 +++ sys/kern/uipc_mqueue.c 9 Nov 2006 11:07:03 -0000 @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -79,7 +80,6 @@ #include #include #include -#include /* * Limits and constants Index: sys/kern/uipc_sem.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_sem.c,v retrieving revision 1.26 diff -u -r1.26 uipc_sem.c --- sys/kern/uipc_sem.c 6 Nov 2006 13:42:01 -0000 1.26 +++ sys/kern/uipc_sem.c 9 Nov 2006 11:07:40 -0000 @@ -42,14 +42,17 @@ #include #include #include +#include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -57,11 +60,7 @@ #include #include #include - -#include -#include -#include -#include +#include #include Index: sys/kern/vfs_aio.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_aio.c,v retrieving revision 1.228 diff -u -r1.228 vfs_aio.c --- sys/kern/vfs_aio.c 15 Oct 2006 14:22:13 -0000 1.228 +++ sys/kern/vfs_aio.c 9 Nov 2006 11:07:40 -0000 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,6 @@ #include -#include #include #include #include Index: sys/modules/Makefile =================================================================== RCS file: /home/ncvs/src/sys/modules/Makefile,v retrieving revision 1.510 diff -u -r1.510 Makefile --- sys/modules/Makefile 9 Sep 2006 16:58:22 -0000 1.510 +++ sys/modules/Makefile 9 Nov 2006 11:07:41 -0000 @@ -219,6 +219,7 @@ scc \ scd \ ${_scsi_low} \ + sem \ sf \ ${_sio} \ sis \ Index: sys/security/mac/mac_posix_sem.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac/mac_posix_sem.c,v retrieving revision 1.3 diff -u -r1.3 mac_posix_sem.c --- sys/security/mac/mac_posix_sem.c 22 Oct 2006 11:52:18 -0000 1.3 +++ sys/security/mac/mac_posix_sem.c 9 Nov 2006 11:07:49 -0000 @@ -37,14 +37,13 @@ #include #include +#include #include #include #include #include #include -#include - #include #include Index: sys/security/mac_biba/mac_biba.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac_biba/mac_biba.c,v retrieving revision 1.94 diff -u -r1.94 mac_biba.c --- sys/security/mac_biba/mac_biba.c 12 Sep 2006 04:25:12 -0000 1.94 +++ sys/security/mac_biba/mac_biba.c 9 Nov 2006 11:07:49 -0000 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -66,8 +67,6 @@ #include #include -#include - #include #include Index: sys/security/mac_mls/mac_mls.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac_mls/mac_mls.c,v retrieving revision 1.77 diff -u -r1.77 mac_mls.c --- sys/security/mac_mls/mac_mls.c 12 Sep 2006 04:25:12 -0000 1.77 +++ sys/security/mac_mls/mac_mls.c 9 Nov 2006 11:07:49 -0000 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -66,8 +67,6 @@ #include #include -#include - #include #include Index: sys/security/mac_stub/mac_stub.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac_stub/mac_stub.c,v retrieving revision 1.57 diff -u -r1.57 mac_stub.c --- sys/security/mac_stub/mac_stub.c 6 Nov 2006 13:45:45 -0000 1.57 +++ sys/security/mac_stub/mac_stub.c 9 Nov 2006 11:07:49 -0000 @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -68,8 +69,6 @@ #include #include -#include - #include #include Index: sys/security/mac_test/mac_test.c =================================================================== RCS file: /home/ncvs/src/sys/security/mac_test/mac_test.c,v retrieving revision 1.63 diff -u -r1.63 mac_test.c --- sys/security/mac_test/mac_test.c 19 Sep 2005 18:52:51 -0000 1.63 +++ sys/security/mac_test/mac_test.c 9 Nov 2006 11:07:49 -0000 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -63,8 +64,6 @@ #include #include -#include - #include #include Index: sys/sys/sysproto.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sysproto.h,v retrieving revision 1.211 diff -u -r1.211 sysproto.h --- sys/sys/sysproto.h 3 Nov 2006 18:57:49 -0000 1.211 +++ sys/sys/sysproto.h 9 Nov 2006 11:08:05 -0000 @@ -11,8 +11,8 @@ #include #include -#include #include +#include #include Index: sys/sys/thr.h =================================================================== RCS file: /home/ncvs/src/sys/sys/thr.h,v retrieving revision 1.11 diff -u -r1.11 thr.h --- sys/sys/thr.h 22 Sep 2006 15:04:28 -0000 1.11 +++ sys/sys/thr.h 9 Nov 2006 11:08:05 -0000 @@ -30,7 +30,7 @@ #ifndef _SYS_THR_H_ #define _SYS_THR_H_ -#include +#include /* Create the thread in the suspended state. */ #define THR_SUSPENDED 0x0001 Index: sys/sys/sched.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sched.h,v retrieving revision 1.28 diff -u -r1.28 sched.h --- sys/sys/sched.h 26 Oct 2006 21:42:22 -0000 1.28 +++ sys/sys/sched.h 9 Nov 2006 11:38:13 -0000 @@ -1,4 +1,37 @@ /*- + * Copyright (c) 1996, 1997 + * HD Associates, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by HD Associates, Inc + * and Jukka Antero Ukkonen. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/*- * Copyright (c) 2002, Jeffrey Roberson * All rights reserved. * @@ -26,9 +59,10 @@ * $FreeBSD: src/sys/sys/sched.h,v 1.28 2006/10/26 21:42:22 jb Exp $ */ -#ifndef _SYS_SCHED_H_ -#define _SYS_SCHED_H_ +#ifndef _SCHED_H_ +#define _SCHED_H_ +#ifdef _KERNEL /* * General scheduling info. * @@ -138,5 +172,45 @@ void sched_thread_exit(struct thread *td); #endif void sched_newthread(struct thread *td); +#endif /* _KERNEL */ + +/* POSIX 1003.1b Process Scheduling */ -#endif /* !_SYS_SCHED_H_ */ +/* + * POSIX scheduling policies + */ +#define SCHED_FIFO 1 +#define SCHED_OTHER 2 +#define SCHED_RR 3 + +struct sched_param { + int sched_priority; +}; + +/* + * POSIX scheduling declarations for userland. + */ +#ifndef _KERNEL +#include +#include + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif + +struct timespec; + +__BEGIN_DECLS +int sched_get_priority_max(int); +int sched_get_priority_min(int); +int sched_getparam(pid_t, struct sched_param *); +int sched_getscheduler(pid_t); +int sched_rr_get_interval(pid_t, struct timespec *); +int sched_setparam(pid_t, const struct sched_param *); +int sched_setscheduler(pid_t, int, const struct sched_param *); +int sched_yield(void); +__END_DECLS + +#endif +#endif /* !_SCHED_H_ */ Index: sys/kern/kern_sig.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_sig.c,v retrieving revision 1.335 diff -u -r1.335 kern_sig.c --- sys/kern/kern_sig.c 26 Oct 2006 21:42:19 -0000 1.335 +++ sys/kern/kern_sig.c 9 Nov 2006 11:42:43 -0000 @@ -57,9 +57,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -76,7 +76,6 @@ #include #include -#include #include #include From owner-freebsd-arch@FreeBSD.ORG Sat Nov 11 09:03:42 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 DE16A16A412; Sat, 11 Nov 2006 09:03:41 +0000 (UTC) (envelope-from ssouhlal@FreeBSD.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61C2043D73; Sat, 11 Nov 2006 09:03:41 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from [192.168.0.103] (c-24-6-50-125.hsd1.ca.comcast.net [24.6.50.125]) by elvis.mu.org (Postfix) with ESMTP id C7E3C1A4D82; Sat, 11 Nov 2006 01:03:40 -0800 (PST) Message-ID: <455591E0.5070509@FreeBSD.org> Date: Sat, 11 Nov 2006 01:03:28 -0800 From: Suleiman Souhlal User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051204) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Attilio Rao References: <3bbf2fe10610181518k68356528i154267c0bd1b1a77@mail.gmail.com> <3bbf2fe10611051857m4c644ad2o7d71a86e46eaf9a8@mail.gmail.com> In-Reply-To: <3bbf2fe10611051857m4c644ad2o7d71a86e46eaf9a8@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, kmacy@freebsd.org, freebsd-arch@freebsd.org Subject: Re: sx locks rewriting - needs testers 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: Sat, 11 Nov 2006 09:03:42 -0000 Attilio Rao wrote: > 2006/10/18, Attilio Rao : > >> In my P4 branch: //depot/user/attilio/attilio_smpng/... >> you can find a sx locks rewriting using the optimized semantic of >> rwlocks; in the end this might result in a valuable performance >> improvement. Excellent work. Do you have any benchmark results? You might have a hard time convincing someone to commit this if you don't show that it's worth it, especially if you consider how much it complicates the code. > After have received very positive stress-test feedbacks from pho@ > (that I would like to thank for his patience and work) I went ahead > and rather completed the implementation. Now this is ready to be > reviewed and possibly committed into the CVS. > Even if I plan a longer work on this branch (about syncronizing > primitives), I think it is time for a revision of the work done until > now from SMPng people (jhb, kmacy, etc.) and possibily an inclusion > into HEAD (patch actually is 58k...). > > Some few hints about the patch: > - LOCK_DEBUG adds a dependence between sx.h and lock.h (as for rwlocks > and mutex) and a the new options SXLOCK_NOINLINE is added > - XFS locking is still disabled in the patch (I hope to do it for > tomorrow, I'm in GMT+1). > - Possibly the sleepqueue interface modifies and new flags might be > documented in the manpages (and NOTES file too, in order to reflect > SXLOCK_NOINLINE inclusion). > - It misses still of the adaptive spinning code, but it can be > inserted after without problems. We might want to avoid adaptive spinning, since sx locks may be held for quite long periods of time. > You can download the code directly from perforce > (//depot/user/attilio/attilio_smpng/...) but patches are available > here: > http://users.gufi.org/~rookie/works/patches/smpng06112006.diff > http://users.gufi.org/~rookie/works/patches/_sx.h > > I hope you will enjoy it (feedbacks, ideas, comments would be very > appreciated). > > Attilio A few comments: --- //depot/vendor/freebsd/src/sys/i386/include/param.h 2006/01/09 06:10:20 +++ //depot/user/attilio/attilio_smpng/i386/include/param.h 2006/10/03 21:33:06 @@ -109,6 +109,15 @@ #endif /* + * Define our own cache alignment mask for syncronizing primitives. Pentium4 + * and Xeon want a 128-byte wide aligned syncronizing primitive in order to + * minimize cache bus traffic on CPUs cache lines movements. + */ +#ifndef SYNC_ALIGN +#define SYNC_ALIGN (128 - 1) +#endif + Please also add this to amd64, and maybe rename it to UMA_ALIGN_SYNC. On other architectures, have it be the same as UMA_ALIGN_CACHE. This way, you don't have to define SYNC_ALIGN in every C file that uses it. While there, you might also want to make UMA_ALIGN_CACHE the correct size for i386/amd64 (64 bytes, on most machines, i believe?). Ideally, this would be a variable set at boot time, depending on what the CPU reports. I also feel that the part that makes turnstiles and sleepqueues 128 byte aligned should be broken up as as a separate patch/commit, as it doesn't really have much to do with your sx rewriting, as I understand it. --- //depot/vendor/freebsd/src/sys/kern/kern_sx.c 2006/08/15 18:31:36 +++ //depot/user/attilio/attilio_smpng/kern/kern_sx.c 2006/11/06 02:24:27 @@ -78,13 +50,8 @@ sx_init(struct sx *sx, const char *description) { - sx->sx_lock = mtx_pool_find(mtxpool_lockbuilder, sx); - sx->sx_cnt = 0; - cv_init(&sx->sx_shrd_cv, description); - sx->sx_shrd_wcnt = 0; - cv_init(&sx->sx_excl_cv, description); - sx->sx_excl_wcnt = 0; - sx->sx_xholder = NULL; + sx->sx_lock = SX_UNHELD; + sx->sx_desc = "sx lock"; lock_init(&sx->sx_object, &lock_class_sx, description, NULL, LO_WITNESS | LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE); Shouldn't it be sx->sx_desc = description; ? Keep up the good work! I hope to see some benchmark results and to see it committed soon! :-) -- Suleiman From owner-freebsd-arch@FreeBSD.ORG Sat Nov 11 13:32:24 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 CF08916A49E for ; Sat, 11 Nov 2006 13:32:24 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B5B443D5F for ; Sat, 11 Nov 2006 13:32:21 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so669571wxc for ; Sat, 11 Nov 2006 05:32:21 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=oofqBI+3y9NHLfK19KLqi63BkwzrYrpLg5c2+Y2rsOnj1h1WlSEkJ++k24IRqTnUq576jv2nyDKSxg0q+zKlsnGsDG87dcK9UJMMQdhOfliJw5QSnvjkZzrNMRTQqSx3reP8AgzyJPDJ4QYo09h1Kb0XjMPotp7PIZAze7KkOw4= Received: by 10.70.117.3 with SMTP id p3mr5308926wxc.1163251941271; Sat, 11 Nov 2006 05:32:21 -0800 (PST) Received: by 10.70.12.2 with HTTP; Sat, 11 Nov 2006 05:32:21 -0800 (PST) Message-ID: <3bbf2fe10611110532j5e1fb1f9t2e4399650abaac12@mail.gmail.com> Date: Sat, 11 Nov 2006 14:32:21 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Suleiman Souhlal" In-Reply-To: <455591E0.5070509@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3bbf2fe10610181518k68356528i154267c0bd1b1a77@mail.gmail.com> <3bbf2fe10611051857m4c644ad2o7d71a86e46eaf9a8@mail.gmail.com> <455591E0.5070509@FreeBSD.org> X-Google-Sender-Auth: 2945fec0e10f4f88 Cc: freebsd-current@freebsd.org, kmacy@freebsd.org, freebsd-arch@freebsd.org Subject: Re: sx locks rewriting - needs testers 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: Sat, 11 Nov 2006 13:32:24 -0000 2006/11/11, Suleiman Souhlal : > Attilio Rao wrote: > > 2006/10/18, Attilio Rao : > > > >> In my P4 branch: //depot/user/attilio/attilio_smpng/... > >> you can find a sx locks rewriting using the optimized semantic of > >> rwlocks; in the end this might result in a valuable performance > >> improvement. > > Excellent work. > Do you have any benchmark results? You might have a hard time convincing > someone to commit this if you don't show that it's worth it, especially > if you consider how much it complicates the code. I'm going to produce them but before I would really add the support for adaptive spinning. jhb@ has a patch [1] that might reduce it but we need more benchmarks. I'm trying to provide them too. > > After have received very positive stress-test feedbacks from pho@ > > (that I would like to thank for his patience and work) I went ahead > > and rather completed the implementation. Now this is ready to be > > reviewed and possibly committed into the CVS. > > Even if I plan a longer work on this branch (about syncronizing > > primitives), I think it is time for a revision of the work done until > > now from SMPng people (jhb, kmacy, etc.) and possibily an inclusion > > into HEAD (patch actually is 58k...). > > > > Some few hints about the patch: > > - LOCK_DEBUG adds a dependence between sx.h and lock.h (as for rwlocks > > and mutex) and a the new options SXLOCK_NOINLINE is added > > - XFS locking is still disabled in the patch (I hope to do it for > > tomorrow, I'm in GMT+1). > > - Possibly the sleepqueue interface modifies and new flags might be > > documented in the manpages (and NOTES file too, in order to reflect > > SXLOCK_NOINLINE inclusion). > > - It misses still of the adaptive spinning code, but it can be > > inserted after without problems. > > We might want to avoid adaptive spinning, since sx locks may be held for > quite long periods of time. I'm not sure I got it. Adaptive spinning really only acts if the exclusive holder is running on another CPU. BTW, it needs more evaluations. > > You can download the code directly from perforce > > (//depot/user/attilio/attilio_smpng/...) but patches are available > > here: > > http://users.gufi.org/~rookie/works/patches/smpng06112006.diff > > http://users.gufi.org/~rookie/works/patches/_sx.h > > > > I hope you will enjoy it (feedbacks, ideas, comments would be very > > appreciated). > > > > Attilio > > A few comments: > --- //depot/vendor/freebsd/src/sys/i386/include/param.h 2006/01/09 06:10:20 > +++ //depot/user/attilio/attilio_smpng/i386/include/param.h 2006/10/03 > 21:33:06 > @@ -109,6 +109,15 @@ > #endif > > /* > + * Define our own cache alignment mask for syncronizing primitives. > Pentium4 > + * and Xeon want a 128-byte wide aligned syncronizing primitive in order to > + * minimize cache bus traffic on CPUs cache lines movements. > + */ > +#ifndef SYNC_ALIGN > +#define SYNC_ALIGN (128 - 1) > +#endif > + > > Please also add this to amd64, and maybe rename it to UMA_ALIGN_SYNC. > On other architectures, have it be the same as UMA_ALIGN_CACHE. This > way, you don't have to define SYNC_ALIGN in every C file that uses it. > > While there, you might also want to make UMA_ALIGN_CACHE the correct > size for i386/amd64 (64 bytes, on most machines, i believe?). Ideally, > this would be a variable set at boot time, depending on what the CPU > reports. 32 for ia32, 64 for amd64, I guess. BTW, I think you are right, I will modify. > I also feel that the part that makes turnstiles and sleepqueues 128 byte > aligned should be broken up as as a separate patch/commit, as it doesn't > really have much to do with your sx rewriting, as I understand it. Yes, but this branch contains all the modifies I'm doing in order to improve our syncronizing primitives. I'm a little bit scared about patch dimensions... (actually is 60k and it necessarily needs to grow). > --- //depot/vendor/freebsd/src/sys/kern/kern_sx.c 2006/08/15 18:31:36 > +++ //depot/user/attilio/attilio_smpng/kern/kern_sx.c 2006/11/06 02:24:27 > @@ -78,13 +50,8 @@ > sx_init(struct sx *sx, const char *description) > { > > - sx->sx_lock = mtx_pool_find(mtxpool_lockbuilder, sx); > - sx->sx_cnt = 0; > - cv_init(&sx->sx_shrd_cv, description); > - sx->sx_shrd_wcnt = 0; > - cv_init(&sx->sx_excl_cv, description); > - sx->sx_excl_wcnt = 0; > - sx->sx_xholder = NULL; > + sx->sx_lock = SX_UNHELD; > + sx->sx_desc = "sx lock"; > lock_init(&sx->sx_object, &lock_class_sx, description, NULL, > LO_WITNESS | LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE); > > Shouldn't it be sx->sx_desc = description; ? right, thanks. > Keep up the good work! I hope to see some benchmark results and to see > it committed soon! :-) Thanks a lot for your feedbacks, Attilio -- Peace can only be achieved by understanding - A. Einstein