From owner-freebsd-threads@FreeBSD.ORG Sun Jul 13 06:33:40 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B521937B401 for ; Sun, 13 Jul 2003 06:33:40 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id ECA8843F85 for ; Sun, 13 Jul 2003 06:33:39 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from alpha (p508B1D97.dip.t-dialin.net [80.139.29.151]) by dust.freshx.de (Postfix) with ESMTP id 02E2515E136 for ; Sun, 13 Jul 2003 15:33:32 +0200 (CEST) From: "Kai Mosebach" To: Date: Sun, 13 Jul 2003 15:33:42 +0200 Message-ID: <001b01c34943$60e25cf0$0100000a@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal Subject: EAGAIN failure on pthread_create X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2003 13:33:41 -0000 Hi, i started using libkse instead of linuxthreads in my sapdb port, but now on kernelstart i get the message : 2003-07-13 15:29:20 4826 ERR 11008 TASKING Could not create thread: 'Resource exeeed (curr:48)', rc = 1 2003-07-13 15:29:20 4826 ERR 11908 SYSTEM FATAL: Could not start all user task threads saying, that the return code of pthread_create is 1, and the number of created threads so far is 48, max_threads_per_proc is 150. I am using 5.1-CURRENT from Juli 10th. [root@devil:~] # sysctl -a |grep proc kern.maxproc: 4052 kern.maxfilesperproc: 7293 kern.maxprocperuid: 3646 subproc 132 430K 478K 5512 32,256,4096 proc 2 4K 4K 2 2048 proc-args 50 4K 4K 17887 16,32,64,128,256 kern.shutdown.kproc_shutdown_wait: 60 kern.threads.max_threads_per_proc: 150 kern.threads.max_groups_per_proc: 50 vm.max_proc_mmap: 28894 debug.sizeof.proc: 484 debug.sizeof.kinfo_proc: 648 security.bsd.unprivileged_proc_debug: 1 Any ideas ? Cheers Kai From owner-freebsd-threads@FreeBSD.ORG Sun Jul 13 06:49:42 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8209537B401 for ; Sun, 13 Jul 2003 06:49:42 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA91243F93 for ; Sun, 13 Jul 2003 06:49:41 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6DDneAI015502; Sun, 13 Jul 2003 09:49:40 -0400 (EDT) Date: Sun, 13 Jul 2003 09:49:40 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Kai Mosebach In-Reply-To: <001b01c34943$60e25cf0$0100000a@alpha> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: EAGAIN failure on pthread_create X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2003 13:49:42 -0000 On Sun, 13 Jul 2003, Kai Mosebach wrote: > Hi, > > i started using libkse instead of linuxthreads in my sapdb port, but now > on kernelstart i get the message : > > 2003-07-13 15:29:20 4826 ERR 11008 TASKING Could not create thread: > 'Resource exeeed (curr:48)', rc = 1 > 2003-07-13 15:29:20 4826 ERR 11908 SYSTEM FATAL: Could not start all > user task threads > > saying, that the return code of pthread_create is 1, and the number of > created threads so far is 48, max_threads_per_proc is 150. You probably are creating all your threads as scope system threads. Each scope system threads consumes a KSEG (limited by kern.threads.max_grpups_per_proc). I don't think you really need each thread to be scope system; try making the port use scope process[1]. If you insist that it does need scope system threads, then raise max_groups_per_proc. [1] To anticipate the question, "will one thread blocking block the entire process", no, other threads will be run. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sun Jul 13 06:52:48 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1BB4D37B401; Sun, 13 Jul 2003 06:52:48 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73AF143F75; Sun, 13 Jul 2003 06:52:47 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from alpha (p508B1D97.dip.t-dialin.net [80.139.29.151]) by dust.freshx.de (Postfix) with ESMTP id 371F015E2B0; Sun, 13 Jul 2003 15:52:40 +0200 (CEST) From: "Kai Mosebach" To: Date: Sun, 13 Jul 2003 15:52:50 +0200 Message-ID: <001e01c34946$0d718e30$0100000a@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal cc: freebsd-threads@freebsd.org Subject: AW: EAGAIN failure on pthread_create X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2003 13:52:48 -0000 > > On Sun, 13 Jul 2003, Kai Mosebach wrote: > > Hi, > > > > i started using libkse instead of linuxthreads in my sapdb port, but now > > on kernelstart i get the message : > > > > 2003-07-13 15:29:20 4826 ERR 11008 TASKING Could not create thread: > > 'Resource exeeed (curr:48)', rc = 1 > > 2003-07-13 15:29:20 4826 ERR 11908 SYSTEM FATAL: Could not start all > > user task threads > > > > saying, that the return code of pthread_create is 1, and the number of > > created threads so far is 48, max_threads_per_proc is 150. > > You probably are creating all your threads as scope system > threads. Each scope system threads consumes a KSEG (limited > by kern.threads.max_grpups_per_proc). I don't think you > really need each thread to be scope system; try making > the port use scope process[1]. If you insist that it does > need scope system threads, then raise max_groups_per_proc. Thought of this too, because max_groups_per_proc is 50 ... First want it to run as system scope threads, (they are, you are right;), Then if working nice, i try to switch. I think the threading part is the most tricky on in sapdb to port ... > > [1] To anticipate the question, "will one thread blocking > block the entire process", no, other threads will be > run. > > -- > Dan Eischen > From owner-freebsd-threads@FreeBSD.ORG Sun Jul 13 16:44:28 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD01737B404; Sun, 13 Jul 2003 16:44:28 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABA0443F85; Sun, 13 Jul 2003 16:44:27 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from alpha (p508B3231.dip.t-dialin.net [80.139.50.49]) by dust.freshx.de (Postfix) with ESMTP id E008015E0C9; Mon, 14 Jul 2003 01:44:14 +0200 (CEST) From: "Kai Mosebach" To: Date: Mon, 14 Jul 2003 01:44:29 +0200 Message-ID: <005d01c34998$b4c6a600$0100000a@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: geteuid hangs in sigsuspend X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2003 23:44:29 -0000 Hi, when i update from 5.0-REL to 5.1-REL / 5.1-CURRENT, using a program compiled against linuxthreads, might there be a different behaviour in the geteuid function of libc ? on my sapdb port the database manager called dbmcli starts fine on 5.0-REL, on 5.1-REL/CURRENT it hangs on a sigsuspend. When i use the FreeBSD 5.0 libs on my FreeBSD 5.1 system, the program runs fine ! Could someone help ? 5.1-CURRENT is from 2003-July-10 Best regards Kai ---------------------------------------------------------- The program output looks like this : [root@devil:/usr/sapdb/src/FreeBSD/sys/src] # dbmcli HERE 1 HERE 3 canceladdr 0x00000000 component 'dbmcli' DBLANG=(null) SERVERDB=(null) HERE 3 ---------------------------------------------------- The code looks like this : #ifdef FREEBSD_DEBUG printf("HERE 3\n"); // 1st one #endif en01assignStdFiledescriptors(); en01CheckForDBUmask (); eo46PtoC ( sql01_component , component , COMPSIZ ); DBG1 (( MF__,"canceladdr 0x%08lx component '%s' \n", (long) canceladdr , sql01_component )) sql01_dblang = getenv ( "DBLOCALE" ); if ( sql01_dblang == NULL ) sql01_dblang = getenv ( "DBLANG" ); DBG1 (( MF__,"DBLANG=%s\n", sql01_dblang )) sql01_dbname = getenv ( "SERVERDB" ); DBG1 (( MF__,"SERVERDB=%s\n", sql01_dbname )) #ifdef FREEBSD_DEBUG printf("HERE 3\n"); // 2nd one #endif uid = geteuid (); pwdp = getpwuid ( uid ); #ifdef FREEBSD_DEBUG printf("HERE 3\n"); // 3rd one (not appearing) #endif ------------------------------------------ strace looks like this : [root@devil:/usr/sapdb/src/FreeBSD/sys/src] # strace dbmcli execve(0xbfbff108, [0xbfbff5cc], [/* 0 vars */]) = 0 mmap(0, 3392, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0) = 0x281a6000 munmap(0x281a6000, 3392) = 0 __sysctl([...], 0x281a3e68, 0xbfbff39c, NULL, 0) = 0 mmap(0, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0x281a6000 issetugid(0x28185000) = 0 access("/usr/sapdb/depend/lib/libcrypt.so.2", F_OK) = -1 ENOENT (No such file or directory) open("/var/run/ld-elf.so.hints", O_RDONLY) = 3 read(3, "\305q\376\377\271q\376\377.p\376\377 From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 04:15:23 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22CFE37B401; Mon, 14 Jul 2003 04:15:23 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1004F43F3F; Mon, 14 Jul 2003 04:15:22 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from alpha (p508B3231.dip.t-dialin.net [80.139.50.49]) by dust.freshx.de (Postfix) with ESMTP id 4CB0B15E201; Mon, 14 Jul 2003 13:15:15 +0200 (CEST) From: "Kai Mosebach" To: Date: Mon, 14 Jul 2003 13:15:24 +0200 Message-ID: <000601c349f9$39b69fe0$0100000a@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal cc: freebsd-hackers@freebsd.org cc: freebsd-threads@freebsd.org Subject: AW: getpwnam + getpwnam_r + LinuxThreads port = deadlock X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 11:15:23 -0000 > -----Urspr=FCngliche Nachricht----- > Von: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- > hackers@freebsd.org] Im Auftrag von Daniel Eischen > Gesendet: Samstag, 12. Juli 2003 21:07 > An: Joshua Oreman > Cc: hackers@freebsd.org > Betreff: Re: getpwnam + getpwnam_r + LinuxThreads port =3D deadlock >=20 > On Sat, 12 Jul 2003, Joshua Oreman wrote: >=20 > > On Sat, Jul 12, 2003 at 10:47:50AM -0400 or thereabouts, Daniel Eischen > wrote: > > > On Fri, 11 Jul 2003, Joshua Oreman wrote: > > > > > > > Hi -hackers, > > > > > > > > System: FreeBSD 5.0-CURRENT cvsupped around 5.0-RELEASE > > > > > > > > I'm writing an app that links with the LinuxThreads > > > > (/usr/ports/devel/linuxthreads) and also uses getpwnam(). The > problem: > > > > a deadlock. GDB backtrace: > > > > > > > > Basically: FreeBSD implements getpwnam() as a wrapper around > > > > getpwnam_r(), as seen in src/lib/libc/gen/getpwent.c: > > > > > > > > So basically, my app calls getpwnam(), which calls the overridden > > > > getpwnam_r() from LinuxThreads, which calls getpwnam() from libc > > > > again, and then calls getpwnam_r() from LinuxThreads again, and > > > > deadlocks trying to recursively lock its own mutex. Obviously, if > > > > there was no mutex the stack would leak out the back of my computer > > > > :-) > > > > > > > > Any ideas here? > > > > > > Three ideas: > > > > > > 1) Change the linuxthreads port to not implement getpwname > > > in the way that it is (or at all and let it use libc's > > > version). > > > > Probably the easiest way; just include the getpw(nam|uid)_r > > code in #ifndef BSD (or #ifndef __FreeBSD__ if it's only > > a FBSD problem). > > > > > > > > 2) Change libc so that getpwnam and getpwnam_r are weak > > > references to _getpwnam and _getpwnam_r respectively > > > and have the "_" versions be the real implementation. > > > Make all references in libc use _getpwname and > > > _getpwnam_r (including the call to _getpwnam_r in > > > _getpwnam). > > > > I think this would still cause the same problem, but not sure. > > > > > > > > 3) CVSup to the latest 5.x and use libthr or libkse and > > > forget linuxthreads. > > I am having the same problems in my sapdb port, as mentioned in another mail. For me its also not this simple to simply switch to kse, because then other kse related problems occur. Wouldnt it be more "clean", to fix the issue in the linuxthreads implementation instead ? (For example many users might use linuxthreads for mysql compilation for example, not knowing what they await ...) Btw : why was this problem not occuring in 5.0-RELEASE ? Cheers Kai From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 05:53:08 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1059537B401 for ; Mon, 14 Jul 2003 05:53:08 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 237DF43F93 for ; Mon, 14 Jul 2003 05:51:47 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6ECpkAI021047; Mon, 14 Jul 2003 08:51:46 -0400 (EDT) Date: Mon, 14 Jul 2003 08:51:46 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Kai Mosebach In-Reply-To: <000601c349f9$39b69fe0$0100000a@alpha> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: AW: getpwnam + getpwnam_r + LinuxThreads port = deadlock X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 12:53:08 -0000 On Mon, 14 Jul 2003, Kai Mosebach wrote: > > On Sat, 12 Jul 2003, Joshua Oreman wrote: > > > > > > > > > > 3) CVSup to the latest 5.x and use libthr or libkse and > > > > forget linuxthreads. > > > > > I am having the same problems in my sapdb port, as mentioned in another > mail. For me its also not this simple to simply switch to kse, because > then > other kse related problems occur. Like what? The -threads list is a good place to post these problems. > Wouldnt it be more "clean", to fix the issue in the linuxthreads > implementation instead ? (For example many users might use linuxthreads > for mysql compilation for example, not knowing what they await ...) Have you tried sending the problem to the maintainer? Our main concern is libthr and libkse stability for 5.2-release. Eventually the ports system will learn about our other thread libraries and will allow their use in preference to linuxthreads. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 10:55:00 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B965737B47B for ; Mon, 14 Jul 2003 10:54:59 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC2E243F75 for ; Mon, 14 Jul 2003 10:54:58 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38ldu3s.dialup.mindspring.com ([209.86.248.124] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19c7XH-000363-00; Mon, 14 Jul 2003 10:54:52 -0700 Message-ID: <3F12EE22.A145A9B5@mindspring.com> Date: Mon, 14 Jul 2003 10:53:38 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Petri Helenius References: <003501c348ad$a599fba0$812a40c1@PETEX31> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a46ba338030ad9f7623eba5dcc82691eaf3ca473d225a0f487350badd9bab72f9c350badd9bab72f9c cc: freebsd-threads@freebsd.org cc: Julian Elischer cc: Andrew Gallatin Subject: Re: dumb KSE question X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 17:55:00 -0000 Petri Helenius wrote: > The cv I=B4m talking about would be signaled by a device driver which > shares some memory with the netgraph device node and the question > is about if in the ng_device like thing I can have the d_ioctl_t block > on the cv. People always want to do this sort of thing, but it's a really bogus thing to want to do. The problem with it is that you are crossing a protection domain, and, in doing that, all bets are off, in terms of allowable locking, etc.. The big issue you are going to hit is that you will deadlock. The proper thing to do is perform a blocking operation on the device itself, and unblock it when the condition is true in order to signal the user space process. -- Terry From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 11:00:10 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD26D37B418 for ; Mon, 14 Jul 2003 11:00:10 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id E248E43F75 for ; Mon, 14 Jul 2003 11:00:08 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38ldu3s.dialup.mindspring.com ([209.86.248.124] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19c7c6-0004UF-00; Mon, 14 Jul 2003 10:59:51 -0700 Message-ID: <3F12EF5A.71249E4D@mindspring.com> Date: Mon, 14 Jul 2003 10:58:50 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Petri Helenius References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a46ba338030ad9f7625196744213bac568548b785378294e88350badd9bab72f9c350badd9bab72f9c cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@freebsd.org Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 18:00:11 -0000 Petri Helenius wrote: > > get up to speed with thread implementations. Is it just me, or > > are threads just a complete evil, which very few people > > understand correctly and are able to implement and/or use them > > correctly? > > Threads are harder to understand and debug. Once you get to think > in threads it actually helps productivity and creates simpler programs > because you can create a thread for a task instead of going trough > dozens of condition statements every time you return from a select or > similar. Other such advantages exist. Threads are for people who can't write finite state automatons. > Also, since future CPUs and systems are likely to have more parallel > execution units, threaded programs are ready to take advantage > of such beasts if your memory coherency protocol does not eat up > your performance. SMP scaling is an argument for threads. It's also an argument for processes. -- Terry From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 11:03:45 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F50937B401 for ; Mon, 14 Jul 2003 11:03:45 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BBD143F75 for ; Mon, 14 Jul 2003 11:03:44 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6EI3iUp085576 for ; Mon, 14 Jul 2003 11:03:44 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6EI3igC085570 for threads@freebsd.org; Mon, 14 Jul 2003 11:03:44 -0700 (PDT) Date: Mon, 14 Jul 2003 11:03:44 -0700 (PDT) Message-Id: <200307141803.h6EI3igC085570@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: threads@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 18:03:45 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- a [2003/04/08] bin/50733 threads buildworld won't build, because of linkin 1 problem total. Non-critical problems From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 11:16:59 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 005F637B401; Mon, 14 Jul 2003 11:16:58 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id F334F43FA3; Mon, 14 Jul 2003 11:16:57 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38ldu3s.dialup.mindspring.com ([209.86.248.124] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19c7se-00074i-00; Mon, 14 Jul 2003 11:16:57 -0700 Message-ID: <3F12F35D.51E82488@mindspring.com> Date: Mon, 14 Jul 2003 11:15:57 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Kris Kennaway References: <200307130133.h6D1Xs3O052775@freefall.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a48302656b10e1973bfebb0561c3be0e61548b785378294e88350badd9bab72f9c350badd9bab72f9c cc: freebsd-bugs@FreeBSD.org cc: freebsd-threads@FreeBSD.org Subject: Re: bin/35329: Linking against libc_r.* provokes nastylinkermessages about unsafe functions X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 18:16:59 -0000 Kris Kennaway wrote: > Assign to threads mailing list I appreciate that you are paying attention to problems like this, but assigning them to the mailing list is the wrong way to go. The fact is that the idiotic disabling of the web form was a direct result of people assigning bugs to specific mailing lists. If you are going to do this anyway, then you might as well reenable the send-pr web form. Otherwise, this appears to be an annoyance factor as part of a political statement on what you personally feel should get attention and be fixed. I dislike the fact, but this will not get your pet bugs fixed any faster, and will just piss people off. -- Terry From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 11:53:17 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3C8337B401 for ; Mon, 14 Jul 2003 11:53:16 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0EB0943F75 for ; Mon, 14 Jul 2003 11:53:15 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from PETEX31 (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with SMTP id h6EIr4sL088721; Mon, 14 Jul 2003 21:53:05 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <03b901c34a39$27c614b0$812a40c1@PETEX31> From: "Petri Helenius" To: "Terry Lambert" References: <003501c348ad$a599fba0$812a40c1@PETEX31> <3F12EE22.A145A9B5@mindspring.com> Date: Mon, 14 Jul 2003 21:53:02 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-threads@freebsd.org cc: Julian Elischer cc: Andrew Gallatin Subject: Re: dumb KSE question X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 18:53:18 -0000 >The proper thing to do is perform a blocking operation on the device >itself, and unblock it when the condition is true in order to signal >the user space process. Which of the available operations would you recommend for this purpose if no data is transferred between kernel and user when the go ahead is signaled? Pete From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 12:02:07 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC53137B401 for ; Mon, 14 Jul 2003 12:02:07 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDBC043FA3 for ; Mon, 14 Jul 2003 12:02:05 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from PETEX31 (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with SMTP id h6EJ1gsL088806; Mon, 14 Jul 2003 22:01:42 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <03cd01c34a3a$5c0d25f0$812a40c1@PETEX31> From: "Petri Helenius" To: "Terry Lambert" References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <3F12EF5A.71249E4D@mindspring.com> Date: Mon, 14 Jul 2003 22:01:38 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@freebsd.org Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 19:02:08 -0000 > > Threads are for people who can't write finite state automatons. > Although this is OT, I have to disagree with this. Due to the limited interfaces between kernel and user spaces, threads apply nicer than very large condition sets to system which need to take in hundreds or thousands of inputs. > > SMP scaling is an argument for threads. It's also an argument for > processes. > True. Pete From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 12:03:00 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D178737B401 for ; Mon, 14 Jul 2003 12:03:00 -0700 (PDT) Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06D0743F93 for ; Mon, 14 Jul 2003 12:02:59 -0700 (PDT) (envelope-from nate@yogotech.com) Received: from emerger.yogotech.com (emerger.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3p2/8.9.3) with ESMTP id NAA17795; Mon, 14 Jul 2003 13:02:24 -0600 (MDT) (envelope-from nate@yogotech.com) Received: (from nate@localhost) by emerger.yogotech.com (8.12.9/8.12.8) id h6EJ2NZ9091113; Mon, 14 Jul 2003 13:02:23 -0600 (MDT) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16146.65087.69689.594109@emerger.yogotech.com> Date: Mon, 14 Jul 2003 13:02:23 -0600 To: Terry Lambert In-Reply-To: <3F12EF5A.71249E4D@mindspring.com> References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <3F12EF5A.71249E4D@mindspring.com> X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid cc: freebsd-threads@freebsd.org cc: 'Kai Mosebach' cc: Chris Knight Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Nate Williams List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 19:03:01 -0000 > Threads are for people who can't write finite state automatons. High-level languages are for people who can't write proper assembly code. Nate ps. Yes, the above was written tongue-in-cheek. People who make broad statements like Terry often makes deserve to have their statements thrown back at them. Threads, like any other tool used by programmers, can be used for both good and evil purposes, depending on the ability and experience of the programmer doing the work. From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 16:18:00 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E80A337B401 for ; Mon, 14 Jul 2003 16:17:58 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1690043F3F for ; Mon, 14 Jul 2003 16:17:57 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from alpha (p508B0F2A.dip.t-dialin.net [80.139.15.42]) by dust.freshx.de (Postfix) with ESMTP id 4C95B15E201 for ; Tue, 15 Jul 2003 01:17:42 +0200 (CEST) From: "Kai Mosebach" To: Date: Tue, 15 Jul 2003 01:17:56 +0200 Message-ID: <002701c34a5e$29cc6c30$0100000a@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal Subject: truss says null() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 23:18:00 -0000 Hi, could anyone give me a hint what this program might be doing ? regards Kai [root@devil:/usr/sapdb/src/FreeBSD] # truss -p 96257 (null)() = 383 (0x17f) kse_release(0x87cbfb4) = 383 (0x17f) kse_release(0x87cbfb4) = 383 (0x17f) kse_release(0x87cbfb4) = 383 (0x17f) kse_release(0x87cbfb4) = 383 (0x17f) kse_release(0x87cbfb4) = 0 (0x0) kse_release(0x87cbfac) = 0 (0x0) kse_release(0x87cbfac) = 0 (0x0) kse_release(0x87e7fac) = 0 (0x0) kse_release(0x87e7fac) = 0 (0x0) kse_wakeup(0x87c7000) = 0 (0x0) kse_release(0x87cbfac) = 0 (0x0) kse_release(0x87cbfac) = 0 (0x0) kse_release(0x87cbfb4) = 383 (0x17f) kse_release(0x87cbfb4) = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) kse_release(0x87cbfb4) = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) (null)() = 383 (0x17f) kse_release(0x87cbfb4) = 383 (0x17f) kse_release(0x87d4fac) = 383 (0x17f) kse_release(0x87d4fac) = 383 (0x17f) From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 17:16:38 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAADA37B401 for ; Mon, 14 Jul 2003 17:16:38 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DA0343FA3 for ; Mon, 14 Jul 2003 17:16:38 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6F0GaAI010996; Mon, 14 Jul 2003 20:16:36 -0400 (EDT) Date: Mon, 14 Jul 2003 20:16:36 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Kai Mosebach In-Reply-To: <002701c34a5e$29cc6c30$0100000a@alpha> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: truss says null() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 00:16:39 -0000 On Tue, 15 Jul 2003, Kai Mosebach wrote: > Hi, > > could anyone give me a hint what this program might be doing ? > > regards Kai > > [root@devil:/usr/sapdb/src/FreeBSD] # truss -p 96257 > > (null)() = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) [ ... ] The KSEs (their appear to be at least 3 of them) are waiting for work. The lone kse_wakeup() is trying to wake one up, but it doesn't appear to be woken at least in this snippet. The parameter to kse_release() and kse_wakeup() is the address of the KSE's mailbox (each KSE has one mailbox). I don't know what the (null)'s are. What does ktrace show? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 17:37:19 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA2B137B401 for ; Mon, 14 Jul 2003 17:37:19 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C9B343F3F for ; Mon, 14 Jul 2003 17:37:19 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc12) with ESMTP id <2003071500371701400s5uc7e>; Tue, 15 Jul 2003 00:37:17 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id RAA79602; Mon, 14 Jul 2003 17:37:14 -0700 (PDT) Date: Mon, 14 Jul 2003 17:37:12 -0700 (PDT) From: Julian Elischer To: Kai Mosebach In-Reply-To: <002701c34a5e$29cc6c30$0100000a@alpha> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: truss says null() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 00:37:20 -0000 those might be upcalls I would guess ktrace probably gives better results how do they compare? On Tue, 15 Jul 2003, Kai Mosebach wrote: > Hi, > > could anyone give me a hint what this program might be doing ? > > regards Kai > > [root@devil:/usr/sapdb/src/FreeBSD] # truss -p 96257 > > (null)() = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) > kse_release(0x87cbfb4) = 0 (0x0) > kse_release(0x87cbfac) = 0 (0x0) > kse_release(0x87cbfac) = 0 (0x0) > kse_release(0x87e7fac) = 0 (0x0) > kse_release(0x87e7fac) = 0 (0x0) > kse_wakeup(0x87c7000) = 0 (0x0) > kse_release(0x87cbfac) = 0 (0x0) > kse_release(0x87cbfac) = 0 (0x0) > kse_release(0x87cbfb4) = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > (null)() = 383 (0x17f) > kse_release(0x87cbfb4) = 383 (0x17f) > kse_release(0x87d4fac) = 383 (0x17f) > kse_release(0x87d4fac) = 383 (0x17f) > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 17:40:07 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B7A137B401 for ; Mon, 14 Jul 2003 17:40:07 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FF3A43F93 for ; Mon, 14 Jul 2003 17:40:06 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from alpha (p508B0F2A.dip.t-dialin.net [80.139.15.42]) by dust.freshx.de (Postfix) with ESMTP id 74C8915E0DA; Tue, 15 Jul 2003 02:39:52 +0200 (CEST) From: "Kai Mosebach" To: "'Julian Elischer'" Date: Tue, 15 Jul 2003 02:40:07 +0200 Message-ID: <003001c34a69$a50d7550$0100000a@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal cc: freebsd-threads@freebsd.org Subject: AW: truss says null() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 00:40:07 -0000 Ktrace drops me back to the console, without a word. > -----Urspr=FCngliche Nachricht----- > Von: Julian Elischer [mailto:julian@elischer.org] > Gesendet: Dienstag, 15. Juli 2003 02:37 > An: Kai Mosebach > Cc: freebsd-threads@freebsd.org > Betreff: Re: truss says null() >=20 >=20 >=20 >=20 > those might be upcalls I would guess > ktrace probably gives better results > how do they compare? >=20 > On Tue, 15 Jul 2003, Kai Mosebach wrote: >=20 > > Hi, > > > > could anyone give me a hint what this program might be doing ? > > > > regards Kai > > > > [root@devil:/usr/sapdb/src/FreeBSD] # truss -p 96257 > > > > (null)() =3D 383 (0x17f) > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > kse_release(0x87cbfb4) =3D 0 (0x0) > > kse_release(0x87cbfac) =3D 0 (0x0) > > kse_release(0x87cbfac) =3D 0 (0x0) > > kse_release(0x87e7fac) =3D 0 (0x0) > > kse_release(0x87e7fac) =3D 0 (0x0) > > kse_wakeup(0x87c7000) =3D 0 (0x0) > > kse_release(0x87cbfac) =3D 0 (0x0) > > kse_release(0x87cbfac) =3D 0 (0x0) > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > (null)() =3D 383 (0x17f) > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > kse_release(0x87d4fac) =3D 383 (0x17f) > > kse_release(0x87d4fac) =3D 383 (0x17f) > > > > _______________________________________________ > > freebsd-threads@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > > To unsubscribe, send any mail to "freebsd-threads- > unsubscribe@freebsd.org" > > >=20 From owner-freebsd-threads@FreeBSD.ORG Mon Jul 14 17:44:16 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B82F837B401 for ; Mon, 14 Jul 2003 17:44:16 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCA1643FBF for ; Mon, 14 Jul 2003 17:44:15 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc12) with ESMTP id <2003071500441501400s57ove>; Tue, 15 Jul 2003 00:44:15 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id RAA79658; Mon, 14 Jul 2003 17:44:11 -0700 (PDT) Date: Mon, 14 Jul 2003 17:44:10 -0700 (PDT) From: Julian Elischer To: Kai Mosebach In-Reply-To: <003001c34a69$a50d7550$0100000a@alpha> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: freebsd-threads@freebsd.org Subject: Re: AW: truss says null() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 00:44:17 -0000 On Tue, 15 Jul 2003, Kai Mosebach wrote: >=20 > Ktrace drops me back to the console, without a word. >=20 well of course.. ktrace just outputs the data to a file. use kdump to look at it.. (man ktrace man kdump) >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Julian Elischer [mailto:julian@elischer.org] > > Gesendet: Dienstag, 15. Juli 2003 02:37 > > An: Kai Mosebach > > Cc: freebsd-threads@freebsd.org > > Betreff: Re: truss says null() > >=20 > >=20 > >=20 > >=20 > > those might be upcalls I would guess > > ktrace probably gives better results > > how do they compare? > >=20 > > On Tue, 15 Jul 2003, Kai Mosebach wrote: > >=20 > > > Hi, > > > > > > could anyone give me a hint what this program might be doing ? > > > > > > regards Kai > > > > > > [root@devil:/usr/sapdb/src/FreeBSD] # truss -p 96257 > > > > > > (null)() =3D 383 (0x17f) > > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > > kse_release(0x87cbfb4) =3D 0 (0x0) > > > kse_release(0x87cbfac) =3D 0 (0x0) > > > kse_release(0x87cbfac) =3D 0 (0x0) > > > kse_release(0x87e7fac) =3D 0 (0x0) > > > kse_release(0x87e7fac) =3D 0 (0x0) > > > kse_wakeup(0x87c7000) =3D 0 (0x0) > > > kse_release(0x87cbfac) =3D 0 (0x0) > > > kse_release(0x87cbfac) =3D 0 (0x0) > > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > (null)() =3D 383 (0x17f) > > > kse_release(0x87cbfb4) =3D 383 (0x17f) > > > kse_release(0x87d4fac) =3D 383 (0x17f) > > > kse_release(0x87d4fac) =3D 383 (0x17f) > > > > > > _______________________________________________ > > > freebsd-threads@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > > > To unsubscribe, send any mail to "freebsd-threads- > > unsubscribe@freebsd.org" > > > > >=20 >=20 >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org= " >=20 From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 00:19:11 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCDDE37B408 for ; Tue, 15 Jul 2003 00:19:10 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CD5843F93 for ; Tue, 15 Jul 2003 00:19:10 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc12t.dialup.mindspring.com ([209.86.4.93] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19cK5Y-0006Jp-00; Tue, 15 Jul 2003 00:19:05 -0700 Message-ID: <3F13AAA2.EEE7ED2C@mindspring.com> Date: Tue, 15 Jul 2003 00:17:54 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Petri Helenius References: <003501c348ad$a599fba0$812a40c1@PETEX31> <3F12EE22.A145A9B5@mindspring.com> <03b901c34a39$27c614b0$812a40c1@PETEX31> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a479f70078d5a37dd0bd005e149cef8ad2387f7b89c61deb1d350badd9bab72f9c350badd9bab72f9c cc: freebsd-threads@freebsd.org cc: Julian Elischer cc: Andrew Gallatin Subject: Re: dumb KSE question X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 07:19:11 -0000 Petri Helenius wrote: > >The proper thing to do is perform a blocking operation on the device > >itself, and unblock it when the condition is true in order to signal > >the user space process. > > Which of the available operations would you recommend for this purpose > if no data is transferred between kernel and user when the go ahead > is signaled? An ioctl() that sets a flag that it wants a wakeup, and then calls tsleep(). Signal by calling wakeup() on the sleep address. -- Terry From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 00:49:39 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92ECA37B401 for ; Tue, 15 Jul 2003 00:49:39 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBD5543FBF for ; Tue, 15 Jul 2003 00:49:38 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc12t.dialup.mindspring.com ([209.86.4.93] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19cKYs-0001eq-00; Tue, 15 Jul 2003 00:49:23 -0700 Message-ID: <3F13B1B4.8765B8F3@mindspring.com> Date: Tue, 15 Jul 2003 00:48:04 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Nate Williams References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <16146.65087.69689.594109@emerger.yogotech.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4c787fc55896d4fef17fe940914f2b972350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: freebsd-threads@freebsd.org cc: 'Kai Mosebach' cc: Chris Knight Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 07:49:39 -0000 Nate Williams wrote: > > Threads are for people who can't write finite state automatons. > > High-level languages are for people who can't write proper assembly > code. > > Nate > > ps. Yes, the above was written tongue-in-cheek. People who make broad > statements like Terry often makes deserve to have their statements > thrown back at them. Threads, like any other tool used by programmers, > can be used for both good and evil purposes, depending on the ability > and experience of the programmer doing the work. One evil purpose threads can be used for is to intentionally exploit a decriptor close race with a blocking fd operation not protected by giant, such that the close invalidates the descriptor before the blocking operation completes, after which the code following the blocking operation dereferences the (now invalid) descriptor contents. Not that anyone would ever write such code on purpose to attack a FreeBSD box from a shell account. Yes, threads is a necessary checkbox item. But I don't need to be all sweetness and light about a facility that I think is badly designed in the standard, and which tends to open up more problems than it's been intended to solve. I can also guarantee you from a performance perspective that an FSA will beat almost anything else you could write, in terms of raw ability to move data, or support high client loads, and will handily beat threads, unless you are on an SMP system, and aren't willing to run multiple copies of the program to do your scaling. Yes, this is somewhat mitigated by the fact that it's easier to write threads code than an FSA, such that a lesser coder is still able to be productive. As a class, it's a tool I would lump in with things like "perl". All that said, FreeBSD's libkse is much less offensive, in terms of overhead and cost, than a raw 1:1 implementation, like the one in the current Solaris, or Linux. Solaris' argument is that it's hard to get something like that correct, and they were worried about the implementation bugs; that just adds fodder to the argument that you should avoid threaded code, where possible. -- Terry From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 01:29:39 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6559737B401 for ; Tue, 15 Jul 2003 01:29:39 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9071343F93 for ; Tue, 15 Jul 2003 01:29:38 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h6F8TCLv034805; Tue, 15 Jul 2003 01:29:12 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h6F8TASL034804; Tue, 15 Jul 2003 01:29:10 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 15 Jul 2003 01:29:10 -0700 From: David Schultz To: Terry Lambert Message-ID: <20030715082910.GA34696@HAL9000.homeunix.com> Mail-Followup-To: Terry Lambert , Nate Williams , freebsd-threads@FreeBSD.org, 'Kai Mosebach' , Chris Knight References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <16146.65087.69689.594109@emerger.yogotech.com> <3F13B1B4.8765B8F3@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F13B1B4.8765B8F3@mindspring.com> cc: Nate Williams cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@FreeBSD.ORG Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 08:29:39 -0000 On Tue, Jul 15, 2003, Terry Lambert wrote: > > ps. Yes, the above was written tongue-in-cheek. People who make broad > > statements like Terry often makes deserve to have their statements > > thrown back at them. Threads, like any other tool used by programmers, > > can be used for both good and evil purposes, depending on the ability > > and experience of the programmer doing the work. [...] > Yes, this is somewhat mitigated by the fact that it's easier to write > threads code than an FSA, such that a lesser coder is still able to > be productive. As a class, it's a tool I would lump in with things > like "perl". Actually, event-based programming is usually easier, since it does not require synchronization. A number of people, myself included, think that threads are overused, and often used incorrectly. But as Nate pointed out, threads are useful for many purposes, the most fundamental of which are SMP scalability and reduced latency. Also, threads are simply the natural programming model for many applications. For instance, you wouldn't rewrite the FreeBSD kernel to use one thread per processor with an event loop and L4-style continuations, would you? From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 01:32:25 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC7F037B401 for ; Tue, 15 Jul 2003 01:32:25 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BB5243F75 for ; Tue, 15 Jul 2003 01:32:24 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from PETEX31 (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with SMTP id h6F8W9sL094129; Tue, 15 Jul 2003 11:32:09 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <049201c34aab$9361d070$812a40c1@PETEX31> From: "Petri Helenius" To: "Terry Lambert" , "Nate Williams" References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <3F12EF5A.71249E4D@mindspring.com> <16146.65087.69689.594109@emerger.yogotech.com> <3F13B1B4.8765B8F3@mindspring.com> Date: Tue, 15 Jul 2003 11:32:06 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@freebsd.org Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 08:32:26 -0000 > > One evil purpose threads can be used for is to intentionally exploit > a decriptor close race with a blocking fd operation not protected by > giant, such that the close invalidates the descriptor before the > blocking operation completes, after which the code following the > blocking operation dereferences the (now invalid) descriptor contents. > Are you saying that this is a fundamental flaw in the design or a bug that hasn´t been fixed as of yet? > > I can also guarantee you from a performance perspective that an FSA > will beat almost anything else you could write, in terms of raw > ability to move data, or support high client loads, and will handily > beat threads, unless you are on an SMP system, and aren't willing to > run multiple copies of the program to do your scaling. > The usual thing I run across is to how effectively manage large fd_set´s without using threaded architechture. Spinning through a few thousand descriptors for almost each read gets expensive quickly. (or write, if you´re going that way) As usual, suggestions are welcome and might lead to more better code in the world... > Yes, this is somewhat mitigated by the fact that it's easier to write > threads code than an FSA, such that a lesser coder is still able to > be productive. As a class, it's a tool I would lump in with things > like "perl". > perl is good "Leatherman(TM)" tool. > All that said, FreeBSD's libkse is much less offensive, in terms of > overhead and cost, than a raw 1:1 implementation, like the one in > the current Solaris, or Linux. Solaris' argument is that it's hard > to get something like that correct, and they were worried about the > implementation bugs; that just adds fodder to the argument that you > should avoid threaded code, where possible. > There are people who solve their database performance problems by adding memory until everything is cached. Putting more hardware in seems to be default operating pattern for Solaris environments. And everybody seems to be happy with it. At least there the OS does not bloat constantly like it does in the WinTel land. Pete From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 01:52:41 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 508AB37B401 for ; Tue, 15 Jul 2003 01:52:41 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFB2943F3F for ; Tue, 15 Jul 2003 01:52:40 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc12t.dialup.mindspring.com ([209.86.4.93] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19cLY2-0000Rg-00; Tue, 15 Jul 2003 01:52:36 -0700 Message-ID: <3F13C04F.EF0D2649@mindspring.com> Date: Tue, 15 Jul 2003 01:50:23 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Daniel Eischen References: Content-Type: multipart/mixed; boundary="------------6C4224CCB339F4B7608C57C1" X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a42243b7f433c7c6cb224d6fb4358c870a350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: truss says null() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 08:52:41 -0000 This is a multi-part message in MIME format. --------------6C4224CCB339F4B7608C57C1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Daniel Eischen wrote: > On Tue, 15 Jul 2003, Kai Mosebach wrote: > > (null)() = 383 (0x17f) > > I don't know what the (null)'s are. What does > ktrace show? The normal cause of this is a system call has been added, and truss was not updated. It needs to be given the names of the system calls for it to be able to display them. It could probably be a little more graceful about it, and cons up a name, instead, when it gets stale relative to the system (I have attached the patch I use locally for this, if you want to commit something like it; it's probably more proper to increase the number of arguments by one and shift them all, and change the name of the system call to "syscall", rather than do it this way, but it's enough to pass you the information you need). Note that applying this patch and recompiling will make applying this patch unnecessary. 8-). But if you commit it (or the "right" one, described above), it will be there for the next person who has the same problem. If you don't care about that, then just go to /usr/src/usr.bin/truss and "make clean all install". -- Terry --------------6C4224CCB339F4B7608C57C1 Content-Type: text/plain; charset=us-ascii; name="truss.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="truss.diff" 225,231c225 < if (fsc.name == NULL) { < static char xbuf[20]; < snprintf(buf, sizeof(xbuf), "syscall(%d)", fsc.number); < print_syscall(outfile, xbuf, fsc.nargs, fsc.s_args); < } else { < print_syscall(outfile, fsc.name, fsc.nargs, fsc.s_args); < } --- > print_syscall(outfile, fsc.name, fsc.nargs, fsc.s_args); --------------6C4224CCB339F4B7608C57C1-- From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 03:12:08 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41F9637B401; Tue, 15 Jul 2003 03:12:08 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 775D943F85; Tue, 15 Jul 2003 03:12:07 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc12t.dialup.mindspring.com ([209.86.4.93] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19cMmx-0000Kt-00; Tue, 15 Jul 2003 03:12:04 -0700 Message-ID: <3F13D2CC.68D9DEC9@mindspring.com> Date: Tue, 15 Jul 2003 03:09:16 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: David Schultz References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <16146.65087.69689.594109@emerger.yogotech.com> <3F13B1B4.8765B8F3@mindspring.com> <20030715082910.GA34696@HAL9000.homeunix.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4a9e38bd33962dfdd763f821e79cdd388350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: Nate Williams cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@FreeBSD.ORG Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 10:12:08 -0000 David Schultz wrote: > On Tue, Jul 15, 2003, Terry Lambert wrote: > > Yes, this is somewhat mitigated by the fact that it's easier to write > > threads code than an FSA, such that a lesser coder is still able to > > be productive. As a class, it's a tool I would lump in with things > > like "perl". > > Actually, event-based programming is usually easier, since it does > not require synchronization. A number of people, myself included, > think that threads are overused, and often used incorrectly. But > as Nate pointed out, threads are useful for many purposes, the > most fundamental of which are SMP scalability and reduced latency. I really dislike the TLS model that attributes global data in order to turn it into per-thread data instead. I realize that this probably has to go forward due to OpenGL relying on this model, but it's just the most recent in a long line of really evil things. An FSA wouldn't have this problem, because the data would already be compartmentalized into a stateite that could be replicated N times without causing problems. You could combine that with a kqueue mechanism, and automatically get the right context handed back to you any time there was work to do. The first in that long line is that POSIX signals are not set to restart by default, as the old BSD 4.2/4.3 signals were. The BSD 4.3 release was actually the first release to even support the idea of system call restar being able to be switched off (via signinterrupt(2), which came from DEC Ultrix). This means a lot of gross masking and unmasking of signals is required, unless you wrapper all of the signals implementation in your own, establish handlers for all signals, and, effectively, have the user space scheduler rethrow them. This is Very Evil(tm), because of what it has to do to deal with implementing the POSIX-mandated per-process signal mask; sigaltstack glue code would likely be painful as well. Add to this that it's mutually impossible to both correctly implement PTHREAD_SCOPE_PROCESS/PTHREAD_SCOPE_SYSTEM, and at the same time build a kernel-only implementation, at least not without rewriting your scheduler and adding implementation specific knowledge into it, which is exactly the wrong way to go with the scheduler. Among other things, it would mean that you will have starvation issues when trying to enforce thread affinity on context switches, during trying to keep the thread cost down where threads are less expensive than processes because you don't trash your cache lines or TLBs on each switch. Ingo Molnar did a lot of work in the Linux scheduler to try and address this issue for Linux. FreeBSD doesn't really address it fully yet. On top of this, you need to deal with cancellation of things that are not easily cancelled, to correctly deal with things like the close(2) races vs. other blocking operations. You effectively have to cause an operation that's potentially many function calls deep before it blocks to fail out properly (which is what Sun does), or you have to fail the close(2) call with the allowable failure for a non-zero reference count on the descriptor - EINTR - which could leave you spinning trying to close the thing over and over, thinking you were being interrupted by a signal. This assumes that you even check the close(2) return value, which most programmers don't, and as a result, you'll leak descriptors. Basically, it wants the code to be rewritten to flatten out all the call graphs OR to take all resources up front (The Banker's Algorithm) so that the cancellation can be handled high up. I guess there's a third option, which would be to block the close(2) call until the reference count on the struct file goes from 2->1, but that's not really practical, either. Certainly it's not an expected behaviour; what's expected these days is the Sun behaviour, and that's very hard to implement without rewriting. If you look at some of the descriptor-using functions, the ones that try to deal with this deal with it by taking a reference; but they don't reference it down as far as they need to; and those that do, don't take an object lock on all the intermediate objects to protect the reference count. For sockets, for example, it's not safe to dereference the f_data element and continue to use it, unless you continue to hold a reference over the time that you are doing the referencing. There are some nice comments about mutexes in socketvar.h, but no mutexes yet. All of this complexity to deal with the fact that naieve threads users close descriptors out from under themselves, not really having their head in the right programming model, and malicious programmers can crash the system intentionally by exploiting these races. I'm sure it will all be sorted out eventually, but I'm also sure that this is just the tip of the iceberg when it comes to the new problems that having a real threads implementation which isn't based on a user space call conversion scheduler are going to cause. > Also, threads are simply the natural programming model for many > applications. For instance, you wouldn't rewrite the FreeBSD > kernel to use one thread per processor with an event loop and > L4-style continuations, would you? I might do the continuations; or actually, Mach-style activations would be a better match. They would also be inherently safe, in terms of providing cancellation points. But you'd still need to flatten the call graph and/or prereserve your resources. Doing the prereserve thing might be the most expedient approach, but Djikstra's Banker's Algorithm has really poor overall performance, and you'd really damage concurrency prereserving resources that you might only need in some obscure corner case. Best case, you will end up taking a lot of locks you don't need to to protect things that don't end up being contended. Without explicit support for cancellation in the OS primitives, though, probably you'd want to turn your object locks into SIX locks, instead of straight mutexes, so that you could implement read/write locks and intention upgrade locks for things you might need to write, and explicitly support cancellation flags on a per structure basis which are protected by a global mutex for write (or a pool mutex), and are generally readable at an time due to being set/cleared atomically. -- Terry From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 03:38:54 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43BF737B404 for ; Tue, 15 Jul 2003 03:38:54 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C17043F93 for ; Tue, 15 Jul 2003 03:38:53 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc12t.dialup.mindspring.com ([209.86.4.93] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19cNCQ-0002X9-00; Tue, 15 Jul 2003 03:38:24 -0700 Message-ID: <3F13D8EC.8899DA42@mindspring.com> Date: Tue, 15 Jul 2003 03:35:24 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Petri Helenius References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <3F12EF5A.71249E4D@mindspring.com> <16146.65087.69689.594109@emerger.yogotech.com> <3F13B1B4.8765B8F3@mindspring.com> <049201c34aab$9361d070$812a40c1@PETEX31> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4ea5b2cc8357b749ccf8670d542b90dfd350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: Nate Williams cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@freebsd.org Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 10:38:54 -0000 Petri Helenius wrote: > > One evil purpose threads can be used for is to intentionally exploit > > a decriptor close race with a blocking fd operation not protected by > > giant, such that the close invalidates the descriptor before the > > blocking operation completes, after which the code following the > > blocking operation dereferences the (now invalid) descriptor contents= =2E > > > Are you saying that this is a fundamental flaw in the design or a bug > that hasn=B4t been fixed as of yet? It depends on how you intend to handle close(2) in the case that there is a positive reference count greater than 1 for the fd being closed out from under the kernel, and it depends on how you intend to handle references on the f_data (and, now, f_vnode) members of struct file to protect them. The really evil way to do this would be to either fail or block the close. I think there is actually a lot of Java code that expects the close call to abort the pending blocked operation in progess on thread #2 when thread #1 closes the descriptor out from under it (that's what Solaris does), which probably means that's the only really viable option. > > I can also guarantee you from a performance perspective that an FSA > > will beat almost anything else you could write, in terms of raw > > ability to move data, or support high client loads, and will handily > > beat threads, unless you are on an SMP system, and aren't willing to > > run multiple copies of the program to do your scaling. > = > The usual thing I run across is to how effectively manage large > fd_set=B4s without using threaded architechture. Spinning through a few= > thousand descriptors for almost each read gets expensive quickly. > (or write, if you=B4re going that way) > As usual, suggestions are welcome and might lead to more better > code in the world... The general answer is "kqueue is your friend". 8-). One thing that is very helpful to do is to seperate out the flags and hint arguments to KNOTE(), and then pass the user void argument through to the knote() code. Doing this is very handy, besides enabling you to raise maxproc higher than the point where it collides with the hints bits, I mean. One of the things Linux-ites always complain about when talking about kqueue() is "it's level triggered, not edge triggered". By this, they mean that you don't get a separate event per source event (e.g. if you get three packets of data, and you haven't reaped the note in the time it takes to do this, then you will only reap a single note with the aggregate byte count in it, rather than three notes with the bytecount per packet). By passing in the user's void * address, you can guarantee that the user and a given new kevent can make a contract to deal with event disposition, e.g. into a buffer to contain a list of events. This lets you address the Linux argument. For example, if you were writing an AnitVirus package (speaking hypothetically), then you could trap all opens and/or writes to files, and find the guilty party who's doing the infecting, at the time of the infection. Then you terminate the program. > > Yes, this is somewhat mitigated by the fact that it's easier to write= > > threads code than an FSA, such that a lesser coder is still able to > > be productive. As a class, it's a tool I would lump in with things > > like "perl". > = > perl is good "Leatherman(TM)" tool. "Perl is a tool for other people." 8-). It's good for a quick-and-dirty implementation of something, and, as far as scripting languages go, it's possible to write readable perl; in practice, however, almost no one does. Everyone has their favorite method of solving a problem, and perl offers lots of ways to skin a cat. In practice, that tends to make the code only easily readable by the original author. Alfred told me he was helping someone out with some threads code the other day, and they ended up managing the server connections in a threads separate from the worker thread that had to deal with the descriptor. As a result, the tended to do things like close fd's out from under their worker threads (which is what put me in mind of the close race problem). I put this in the same class of naieve coding errors that one commonly makes when trying to maintain someone else's perl code. It's not so much that either one is inherently bad, but that they both tend to magnetize your feet any time you pick up a gun. 8-). > > All that said, FreeBSD's libkse is much less offensive, in terms of > > overhead and cost, than a raw 1:1 implementation, like the one in > > the current Solaris, or Linux. Solaris' argument is that it's hard > > to get something like that correct, and they were worried about the > > implementation bugs; that just adds fodder to the argument that you > > should avoid threaded code, where possible. > = > There are people who solve their database performance problems by > adding memory until everything is cached. Putting more hardware in > seems to be default operating pattern for Solaris environments. And > everybody seems to be happy with it. At least there the OS does not > bloat constantly like it does in the WinTel land. I guess to a large degree the ability to do this for Solaris comes from the fact that they are a 64bit OS, so they can just stuff RAM into the box until the power supply can no longer cope with it. 8-). It helps to have the necessary head room to be *able* to throw hardware at the problem. -- Terry From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 03:58:17 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC88A37B401 for ; Tue, 15 Jul 2003 03:58:17 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86A3643F3F for ; Tue, 15 Jul 2003 03:58:16 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from PETEX31 (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with SMTP id h6FAw4sL095123; Tue, 15 Jul 2003 13:58:05 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <04fa01c34abf$f672e640$812a40c1@PETEX31> From: "Petri Helenius" To: "Terry Lambert" References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <3F12EF5A.71249E4D@mindspring.com> <16146.65087.69689.594109@emerger.yogotech.com> <3F13B1B4.8765B8F3@mindspring.com> <049201c34aab$9361d070$812a40c1@PETEX31> <3F13D8EC.8899DA42@mindspring.com> Date: Tue, 15 Jul 2003 13:58:01 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: Nate Williams cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@freebsd.org Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 10:58:18 -0000 >The general answer is "kqueue is your friend". 8-). >One thing that is very helpful to do is to seperate out the flags >and hint arguments to KNOTE(), and then pass the user void argument >through to the knote() code. Doing this is very handy, besides >enabling you to raise maxproc higher than the point where it >collides with the hints bits, I mean. My large fd_set argument was actually targeted towards user space processes using existing interfaces. Where the viable options seem to have large select´s and do work based by spinning the descriptor set or have a thread block on the read on the descriptor. Pete From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 04:21:52 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D98937B401 for ; Tue, 15 Jul 2003 04:21:52 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id B64F843F85 for ; Tue, 15 Jul 2003 04:21:51 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc12t.dialup.mindspring.com ([209.86.4.93] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19cNsJ-000052-00; Tue, 15 Jul 2003 04:21:40 -0700 Message-ID: <3F13E2FF.60CC7107@mindspring.com> Date: Tue, 15 Jul 2003 04:18:23 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Petri Helenius References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <3F12EF5A.71249E4D@mindspring.com> <16146.65087.69689.594109@emerger.yogotech.com> <3F13B1B4.8765B8F3@mindspring.com> <049201c34aab$9361d070$812a40c1@PETEX31> <3F13D8EC.8899DA42@mindspring.com> <04fa01c34abf$f672e640$812a40c1@PETEX31> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4f9fd5bd8a261a8df5b4ae47966e1acb2350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: Nate Williams cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@freebsd.org Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 11:21:52 -0000 Petri Helenius wrote: > >The general answer is "kqueue is your friend". 8-). > = > >One thing that is very helpful to do is to seperate out the flags > >and hint arguments to KNOTE(), and then pass the user void argument > >through to the knote() code. Doing this is very handy, besides > >enabling you to raise maxproc higher than the point where it > >collides with the hints bits, I mean. > = > My large fd_set argument was actually targeted towards user space > processes using existing interfaces. Where the viable options seem to > have large select=B4s and do work based by spinning the descriptor set > or have a thread block on the read on the descriptor. I understood that; but kqueue has been around in FreeBSD as an existing interface for longer than libthr or libkse. By rights, it's a much more "existing interface" than threads are. 8-). It's also the same in FreeBSD, OpenBSD, and MacOS X. I don't know if NetBSD has it or not; they don't have the man page up yet, if they do. You could also use poll(2), which gets around many of the major complaints about select(2). Actually, select(2) is an excellent example of an interface that's going to be a holy terror to make thread safe against the close(2) race. Basically, it will need to hold a reference for the entire fd table during the select, and it will have to deal with the possibility of another thread closing and then reopening a given individual descriptor after the first pass through selscan(), but before the second pass. Otherwise it's going to be able to return false positives to user space, and potentially cause a blocking call to be made which will simply hang the worker thread making the call. Enough of those, with a set of worker threads that's smaller than the total number of open fd's, and you're server becomes totally unresponsive to further requests because all your worker threads are wedged. Short of non-blocking I/O, the only thing you could do is deal with implementing the Sun-style cancellation-on-close. -- Terry From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 10:48:47 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF2B937B401 for ; Tue, 15 Jul 2003 10:48:47 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id D031D43FBD for ; Tue, 15 Jul 2003 10:48:44 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h6FHmTLv037159; Tue, 15 Jul 2003 10:48:30 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h6FHmSC8037158; Tue, 15 Jul 2003 10:48:28 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 15 Jul 2003 10:48:28 -0700 From: David Schultz To: Terry Lambert Message-ID: <20030715174828.GA37077@HAL9000.homeunix.com> Mail-Followup-To: Terry Lambert , Nate Williams , freebsd-threads@FreeBSD.ORG, 'Kai Mosebach' , Chris Knight References: <007601c3467b$5f20e960$020aa8c0@aims.private> <004d01c348ae$583084f0$812a40c1@PETEX31> <16146.65087.69689.594109@emerger.yogotech.com> <3F13B1B4.8765B8F3@mindspring.com> <20030715082910.GA34696@HAL9000.homeunix.com> <3F13D2CC.68D9DEC9@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F13D2CC.68D9DEC9@mindspring.com> cc: Nate Williams cc: Chris Knight cc: 'Kai Mosebach' cc: freebsd-threads@FreeBSD.ORG Subject: Re: LinuxThreads replacement X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 17:48:48 -0000 On Tue, Jul 15, 2003, Terry Lambert wrote: > David Schultz wrote: > > On Tue, Jul 15, 2003, Terry Lambert wrote: > > > Yes, this is somewhat mitigated by the fact that it's easier to write > > > threads code than an FSA, such that a lesser coder is still able to > > > be productive. As a class, it's a tool I would lump in with things > > > like "perl". > > > > Actually, event-based programming is usually easier, since it does > > not require synchronization. A number of people, myself included, > > think that threads are overused, and often used incorrectly. But > > as Nate pointed out, threads are useful for many purposes, the > > most fundamental of which are SMP scalability and reduced latency. > > [graphics contexts in OpenGL] > [restartable system calls] > [thread contention scope in 1x1] > [interrupting close(2) with a signal] > [the Banker's Algorithm] > [races involving sockets] > [Mach activations] > [intention-mode locking] You have made some interesting points, but are you sure you're responding to the right thread? :-P Perhaps we need to adjust your contention scope... From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 10:50:35 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15C5D37B401 for ; Tue, 15 Jul 2003 10:50:35 -0700 (PDT) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id B146843FAF for ; Tue, 15 Jul 2003 10:50:33 -0700 (PDT) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1])h6FHpgrx099727; Tue, 15 Jul 2003 13:51:42 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)h6FHpfnX099726; Tue, 15 Jul 2003 13:51:41 -0400 (EDT) Date: Tue, 15 Jul 2003 13:51:41 -0400 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20030715175141.GA99650@crodrigues.org> References: <20030411234140.GA51044@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i cc: Craig Rodrigues Subject: ACE Proactor and libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 17:50:35 -0000 On Fri, Apr 11, 2003 at 07:51:49PM -0400, Daniel Eischen wrote: > > > > > > libkse libc_r > > > ACE 5.3.1 Test Pass? Pass? > > > ------------------------------------------------ > > > Cached_Conn_Test No No > > > Conn_Test No Yes > > > MT_Reactor_Timer_Test No Yes > > > Malloc_Test No No > > > Proactor_Test No No > > > Proactor_Timer_Test No No Hi, I just contributed a patch to ACE which I believe fixes the Proactor_Test under FreeBSD. The Proactor_Test seems to *only* work with with KSE, i.e. I specified that libkse should be used in my /etc/libmap.conf. If anyone is interested in trying this out, you can check out the head of the ACE CVS repository by doing: (0) Make sure that /etc/libmap.conf is configured to use libkse (1) cvs -d :pserver:anonymous@anoncvs.ociweb.com:/cvs login (2) (just press when prompted for password) (3) cvs -d :pserver:anonymous@anoncvs.ociweb.com:/cvs co ACE (4) Set the environment ACE_ROOT environment variable to the root directory of where all the ACE files get extracted to (5) Set the environment variable LD_LIBRARY_PATH to $ACE_ROOT/ace (6) Create a file $ACE_ROOT/ace/config.h with one line: #include "ace/config-freebsd.h" (7) Create a file $ACE_ROOT/include/makeinclude/platform_macros.GNU with one line: include $(ACE_ROOT)/include/makeinclude/platform_freebsd.GNU (8) cd $ACE_ROOT; gmake (9) cd $ACE_ROOT/tests ; run_tests.pl What is the status of KSE + signals? Signals seem to make a big difference with the ACE Proactor. The Proactor_Test seems to work with libkse, but not libc_r, and I think it is due to signals. Thanks. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 11:01:09 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F80937B401 for ; Tue, 15 Jul 2003 11:01:09 -0700 (PDT) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDCBD43F85 for ; Tue, 15 Jul 2003 11:01:05 -0700 (PDT) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1])h6FI2Grx099816 for ; Tue, 15 Jul 2003 14:02:17 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)h6FI2G3s099815 for freebsd-threads@freebsd.org; Tue, 15 Jul 2003 14:02:16 -0400 (EDT) Date: Tue, 15 Jul 2003 14:02:16 -0400 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20030715180216.GA99807@crodrigues.org> References: <20030411234140.GA51044@attbi.com> <20030715175141.GA99650@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030715175141.GA99650@crodrigues.org> User-Agent: Mutt/1.4i Subject: Re: ACE Proactor and libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 18:01:09 -0000 Hi, One thing I forgot to mention is that in order for the Proactor_Test to work, you need to either kldload aio, or set option VFS_AIO in your kernel config, because POSIX asynch I/O is not in the default kernel build. On Tue, Jul 15, 2003 at 01:51:41PM -0400, Craig Rodrigues wrote: > On Fri, Apr 11, 2003 at 07:51:49PM -0400, Daniel Eischen wrote: > > > > > > > > libkse libc_r > > > > ACE 5.3.1 Test Pass? Pass? > > > > ------------------------------------------------ > > > > Cached_Conn_Test No No > > > > Conn_Test No Yes > > > > MT_Reactor_Timer_Test No Yes > > > > Malloc_Test No No > > > > Proactor_Test No No > > > > Proactor_Timer_Test No No > > > Hi, > > I just contributed a patch to ACE which I believe fixes > the Proactor_Test under FreeBSD. The Proactor_Test seems > to *only* work with with KSE, i.e. I specified that libkse > should be used in my /etc/libmap.conf. > > If anyone is interested in trying this out, you can check out > the head of the ACE CVS repository by doing: > > (0) Make sure that /etc/libmap.conf is configured to use libkse > (1) cvs -d :pserver:anonymous@anoncvs.ociweb.com:/cvs login > (2) (just press when prompted for password) > (3) cvs -d :pserver:anonymous@anoncvs.ociweb.com:/cvs co ACE > (4) Set the environment ACE_ROOT environment variable to the root > directory of where all the ACE files get extracted to > (5) Set the environment variable LD_LIBRARY_PATH to $ACE_ROOT/ace > (6) Create a file $ACE_ROOT/ace/config.h with one line: > #include "ace/config-freebsd.h" > (7) Create a file $ACE_ROOT/include/makeinclude/platform_macros.GNU with one line: > include $(ACE_ROOT)/include/makeinclude/platform_freebsd.GNU > > > (8) cd $ACE_ROOT; gmake > (9) cd $ACE_ROOT/tests ; run_tests.pl > > > What is the status of KSE + signals? Signals seem to make a big difference > with the ACE Proactor. The Proactor_Test seems to work with libkse, > but not libc_r, and I think it is due to signals. > > Thanks. > -- > Craig Rodrigues > http://crodrigues.org > rodrigc@crodrigues.org -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 11:24:49 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF76837B401 for ; Tue, 15 Jul 2003 11:24:49 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E91643F75 for ; Tue, 15 Jul 2003 11:24:49 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6FIOfAI029031; Tue, 15 Jul 2003 14:24:41 -0400 (EDT) Date: Tue, 15 Jul 2003 14:24:41 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Rodrigues In-Reply-To: <20030715175141.GA99650@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: ACE Proactor and libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 18:24:50 -0000 On Tue, 15 Jul 2003, Craig Rodrigues wrote: > On Fri, Apr 11, 2003 at 07:51:49PM -0400, Daniel Eischen wrote: > > > > > > > > libkse libc_r > > > > ACE 5.3.1 Test Pass? Pass? > > > > ------------------------------------------------ > > > > Cached_Conn_Test No No > > > > Conn_Test No Yes > > > > MT_Reactor_Timer_Test No Yes > > > > Malloc_Test No No > > > > Proactor_Test No No > > > > Proactor_Timer_Test No No Just a note; we now pass all the ACE tests with the exception of Cached_Conn_Test and the sigset ops test (which fails because our sigfooset macros don't check for signals out of bounds -- nothing to do with our threads libraries). You can also build ACE so that it will use scope system threads when it wants (don't define ACE_LACKS_THREAD_PROCESS_SCOPING in config-freebsd.h). > Hi, > > I just contributed a patch to ACE which I believe fixes > the Proactor_Test under FreeBSD. The Proactor_Test seems > to *only* work with with KSE, i.e. I specified that libkse > should be used in my /etc/libmap.conf. Yeah, I knew that's why the proactor tests failed; I didn't ever bother to load the aio module to see if it would then pass. > If anyone is interested in trying this out, you can check out > the head of the ACE CVS repository by doing: > > (0) Make sure that /etc/libmap.conf is configured to use libkse > (1) cvs -d :pserver:anonymous@anoncvs.ociweb.com:/cvs login > (2) (just press when prompted for password) > (3) cvs -d :pserver:anonymous@anoncvs.ociweb.com:/cvs co ACE > (4) Set the environment ACE_ROOT environment variable to the root > directory of where all the ACE files get extracted to > (5) Set the environment variable LD_LIBRARY_PATH to $ACE_ROOT/ace > (6) Create a file $ACE_ROOT/ace/config.h with one line: > #include "ace/config-freebsd.h" > (7) Create a file $ACE_ROOT/include/makeinclude/platform_macros.GNU with one line: > include $(ACE_ROOT)/include/makeinclude/platform_freebsd.GNU > > > (8) cd $ACE_ROOT; gmake > (9) cd $ACE_ROOT/tests ; run_tests.pl > > > What is the status of KSE + signals? Signals seem to make a big difference > with the ACE Proactor. The Proactor_Test seems to work with libkse, > but not libc_r, and I think it is due to signals. It could be. Signals are mostly done; there are a few changes that David will be checking in really soon that should leave just one issue with signals and sigwait() which we are not sure about. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 16:14:51 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B05D237B401 for ; Tue, 15 Jul 2003 16:14:51 -0700 (PDT) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8E9543F85 for ; Tue, 15 Jul 2003 16:14:50 -0700 (PDT) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1])h6FNG1rx000708 for ; Tue, 15 Jul 2003 19:16:01 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)h6FNG1LZ000707 for freebsd-threads@freebsd.org; Tue, 15 Jul 2003 19:16:01 -0400 (EDT) Date: Tue, 15 Jul 2003 19:16:00 -0400 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20030715231600.GA676@crodrigues.org> References: <20030715175141.GA99650@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Subject: Re: ACE Proactor and libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 23:14:52 -0000 On Tue, Jul 15, 2003 at 02:24:41PM -0400, Daniel Eischen wrote: > > You can also build ACE so that it will use scope system > threads when it wants (don't define ACE_LACKS_THREAD_PROCESS_SCOPING > in config-freebsd.h). Should this become the default for config-freebsd.h, or should we leave it alone? I can submit a patch which does something like: #if (__FreeBSD_version < 501102 /* or whatever value is appropriate */) #define ACE_LACKS_THREAD_PROCESS_SCOPING #endif > Yeah, I knew that's why the proactor tests failed; I didn't > ever bother to load the aio module to see if it would then > pass. The Proactor test now works, but it only works with libkse. My patch was not signal related: Mon Jul 14 11:16:25 2003 Craig Rodrigues * ace/POSIX_Proactor.cpp: FreeBSD defines the sysconf value for _SC_AIO_LISTIO_MAX to 16, and the sysconf value for _SC_AIO_MAX to be 1024. The lower value must be assigned to aiocb_list_max_size_ otherwise aio_suspend() will fail. There was already already some logic in here to support HPUX that also works for FreeBSD, so use that. > It could be. Signals are mostly done; there are a few changes > that David will be checking in really soon that should leave just > one issue with signals and sigwait() which we are not sure about. OK, that's very nice! At what point will the signal support be good enough to comply with POSIX Real-time signals? Thanks. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 16:27:31 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B707F37B401; Tue, 15 Jul 2003 16:27:31 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4709A43F3F; Tue, 15 Jul 2003 16:27:31 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from tiger (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with SMTP id h6FNRTUp016578; Tue, 15 Jul 2003 16:27:30 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <002801c34b29$1a9831b0$0701a8c0@tiger> From: "David Xu" To: "Craig Rodrigues" , References: <20030411234140.GA51044@attbi.com> <20030715175141.GA99650@crodrigues.org> Date: Wed, 16 Jul 2003 07:30:39 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 cc: Craig Rodrigues Subject: Re: ACE Proactor and libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 23:27:32 -0000 Can you test my libkse patch ? http://people.freebsd.org/~davidxu/libpthread_bound.diffs If you can test the patch to make sure I don't break signal code, then I will commit this patch.=20 The patch is used to remove system scope thread's upcall, and make libkse to have ability to run in pure 1:1 mode, the patch also changes the way of delivering signal to bound thread. Make sure to update your kernel source code to most recent, I have committed a fix for kse_create yesterday. I have already past all 2 hours MySQL server benchmark test. its funny test suit mysql-test is also past except some problems which may not related to thread library. You can test libkse in two modes: M:N and 1:1, uncomment line "CFLAGS+=3D-DSYSTEM_SCOPE_ONLY" in Makefile will make libkse in 1:1 mode, comment out the line will make libkse in M:N mode. Your help is always appreciated, David Xu ----- Original Message -----=20 From: "Craig Rodrigues" To: Cc: "Craig Rodrigues" Sent: Wednesday, July 16, 2003 1:51 AM Subject: ACE Proactor and libkse > On Fri, Apr 11, 2003 at 07:51:49PM -0400, Daniel Eischen wrote: > > > >=20 > > > > libkse libc_r > > > > ACE 5.3.1 Test Pass? Pass? > > > > ------------------------------------------------ > > > > Cached_Conn_Test No No > > > > Conn_Test No Yes > > > > MT_Reactor_Timer_Test No Yes > > > > Malloc_Test No No > > > > Proactor_Test No No > > > > Proactor_Timer_Test No No >=20 >=20 > Hi, >=20 > I just contributed a patch to ACE which I believe fixes > the Proactor_Test under FreeBSD. The Proactor_Test seems > to *only* work with with KSE, i.e. I specified that libkse > should be used in my /etc/libmap.conf. >=20 > If anyone is interested in trying this out, you can check out > the head of the ACE CVS repository by doing: >=20 > (0) Make sure that /etc/libmap.conf is configured to use libkse > (1) cvs -d :pserver:anonymous@anoncvs.ociweb.com:/cvs login > (2) (just press when prompted for password) > (3) cvs -d :pserver:anonymous@anoncvs.ociweb.com:/cvs co ACE > (4) Set the environment ACE_ROOT environment variable to the root=20 > directory of where all the ACE files get extracted to > (5) Set the environment variable LD_LIBRARY_PATH to $ACE_ROOT/ace > (6) Create a file $ACE_ROOT/ace/config.h with one line: > #include "ace/config-freebsd.h" > (7) Create a file $ACE_ROOT/include/makeinclude/platform_macros.GNU = with one line: > include $(ACE_ROOT)/include/makeinclude/platform_freebsd.GNU >=20 >=20 > (8) cd $ACE_ROOT; gmake > (9) cd $ACE_ROOT/tests ; run_tests.pl >=20 >=20 > What is the status of KSE + signals? Signals seem to make a big = difference > with the ACE Proactor. The Proactor_Test seems to work with libkse, > but not libc_r, and I think it is due to signals. >=20 > Thanks. > --=20 > Craig Rodrigues =20 > http://crodrigues.org > rodrigc@crodrigues.org > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to = "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 16:30:43 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 910A437B401 for ; Tue, 15 Jul 2003 16:30:43 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17FB243F85 for ; Tue, 15 Jul 2003 16:30:43 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <2003071523304201500r5iqpe>; Tue, 15 Jul 2003 23:30:42 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA88543; Tue, 15 Jul 2003 16:30:41 -0700 (PDT) Date: Tue, 15 Jul 2003 16:30:39 -0700 (PDT) From: Julian Elischer To: Craig Rodrigues In-Reply-To: <20030715231600.GA676@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: ACE Proactor and libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 23:30:43 -0000 On Tue, 15 Jul 2003, Craig Rodrigues wrote: > On Tue, Jul 15, 2003 at 02:24:41PM -0400, Daniel Eischen wrote: > > > > You can also build ACE so that it will use scope system > > threads when it wants (don't define ACE_LACKS_THREAD_PROCESS_SCOPING > > in config-freebsd.h). > > Should this become the default for config-freebsd.h, or should > we leave it alone? I can submit a patch which does something like: > > #if (__FreeBSD_version < 501102 /* or whatever value is appropriate */) > #define ACE_LACKS_THREAD_PROCESS_SCOPING > #endif > > > Yeah, I knew that's why the proactor tests failed; I didn't > > ever bother to load the aio module to see if it would then > > pass. > > The Proactor test now works, but it only works with libkse. > My patch was not signal related: > > Mon Jul 14 11:16:25 2003 Craig Rodrigues > > * ace/POSIX_Proactor.cpp: FreeBSD defines the sysconf value > for _SC_AIO_LISTIO_MAX to 16, and the sysconf value for > _SC_AIO_MAX to be 1024. The lower value must be assigned to > aiocb_list_max_size_ otherwise aio_suspend() will fail. There > was already already some logic in here to support HPUX that also > works for FreeBSD, so use that. > > > > > It could be. Signals are mostly done; there are a few changes > > that David will be checking in really soon that should leave just > > one issue with signals and sigwait() which we are not sure about. > > OK, that's very nice! At what point will the signal support > be good enough to comply with POSIX Real-time signals? Ummm RT signals are a different thing from thread signals. the two questions are different.. (And I might add, not orthogonal.. RT signals make thread signals more difficult). (last time I looked). From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 18:36:11 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D3E537B404 for ; Tue, 15 Jul 2003 18:36:11 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E3BC43F93 for ; Tue, 15 Jul 2003 18:36:10 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6G1a6AI011501; Tue, 15 Jul 2003 21:36:06 -0400 (EDT) Date: Tue, 15 Jul 2003 21:36:06 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Rodrigues In-Reply-To: <20030715231600.GA676@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: ACE Proactor and libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 01:36:11 -0000 On Tue, 15 Jul 2003, Craig Rodrigues wrote: > On Tue, Jul 15, 2003 at 02:24:41PM -0400, Daniel Eischen wrote: > > > > You can also build ACE so that it will use scope system > > threads when it wants (don't define ACE_LACKS_THREAD_PROCESS_SCOPING > > in config-freebsd.h). > > Should this become the default for config-freebsd.h, or should > we leave it alone? I can submit a patch which does something like: I guess that depends on what ACE does when it (pthread_attr_setscope) fails (in libc_r, and perhaps libthr if scope process is specified). > > It could be. Signals are mostly done; there are a few changes > > that David will be checking in really soon that should leave just > > one issue with signals and sigwait() which we are not sure about. > > OK, that's very nice! At what point will the signal support > be good enough to comply with POSIX Real-time signals? FreeBSD doesn't support them yet AFAIK. I don't think it would be that difficult to make libpthread comply when we do support them (basically, we just need to deliver RT signals in a certain order). -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Tue Jul 15 22:53:02 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7BE137B401; Tue, 15 Jul 2003 22:53:02 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7715243F85; Tue, 15 Jul 2003 22:53:01 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h6G5qlLv040052; Tue, 15 Jul 2003 22:52:47 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h6G5qlmF040051; Tue, 15 Jul 2003 22:52:47 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 15 Jul 2003 22:52:47 -0700 From: David Schultz To: David Xu Message-ID: <20030716055247.GA39968@HAL9000.homeunix.com> Mail-Followup-To: David Xu , Craig Rodrigues , freebsd-threads@freebsd.org References: <20030715175141.GA99650@crodrigues.org> <002801c34b29$1a9831b0$0701a8c0@tiger> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002801c34b29$1a9831b0$0701a8c0@tiger> cc: Craig Rodrigues cc: freebsd-threads@FreeBSD.ORG Subject: Threads regression tests (was: Re: ACE Proactor and libkse) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 05:53:03 -0000 On Wed, Jul 16, 2003, David Xu wrote: > Can you test my libkse patch ? > http://people.freebsd.org/~davidxu/libpthread_bound.diffs > If you can test the patch to make sure I don't break signal > code, then I will commit this patch. Is there interest in incrementally building a threads-related regression test suite in src/tools/regression? This would mean less breakage for people who are trying to use KSE/libthr, and an easy way for threads developers to be somewhat confident that their changes are correct. For example, two weeks ago I was tearing my hair out over a sigwait() problem that caused the following program to deadlock. Since I already bothered to isolate the bug, why not do the last 1% of the work and check in a test so that it never comes back? Thoughts? #include #include #include int main() { sigset_t mask; int sig; sigemptyset(&mask); sigaddset(&mask, SIGALRM); if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) err(1, "sigprocmask"); if (raise(SIGALRM) < 0) err(1, "raise"); if (sigwait(&mask, &sig) < 0) err(1, "sigwait"); return (0); } From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 01:22:32 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 666CD37B401; Wed, 16 Jul 2003 01:22:32 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD40443F3F; Wed, 16 Jul 2003 01:22:31 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6G8M3AI014761; Wed, 16 Jul 2003 04:22:03 -0400 (EDT) Date: Wed, 16 Jul 2003 04:22:03 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Schultz In-Reply-To: <20030716055247.GA39968@HAL9000.homeunix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Craig Rodrigues cc: David Xu cc: freebsd-threads@freebsd.org Subject: Re: Threads regression tests (was: Re: ACE Proactor and libkse) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 08:22:32 -0000 On Tue, 15 Jul 2003, David Schultz wrote: > On Wed, Jul 16, 2003, David Xu wrote: > > Can you test my libkse patch ? > > http://people.freebsd.org/~davidxu/libpthread_bound.diffs > > If you can test the patch to make sure I don't break signal > > code, then I will commit this patch. > > Is there interest in incrementally building a threads-related > regression test suite in src/tools/regression? This would mean > less breakage for people who are trying to use KSE/libthr, and an > easy way for threads developers to be somewhat confident that > their changes are correct. For example, two weeks ago I was > tearing my hair out over a sigwait() problem that caused the > following program to deadlock. Since I already bothered to > isolate the bug, why not do the last 1% of the work and check in a > test so that it never comes back? Thoughts? That's why lib{c_r|pthread|thr}/test/ exists. > #include > #include > #include > > int main() { > > sigset_t mask; > int sig; > > sigemptyset(&mask); > sigaddset(&mask, SIGALRM); > if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) > err(1, "sigprocmask"); > > if (raise(SIGALRM) < 0) > err(1, "raise"); > > if (sigwait(&mask, &sig) < 0) > err(1, "sigwait"); > > return (0); > } This seems to be kernel bug (if it is a bug). If you build it without linking any of the threads libraries it still exits the program without sigwait receiving the signal. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 01:42:52 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6906E37B42F; Wed, 16 Jul 2003 01:42:50 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0366643FA3; Wed, 16 Jul 2003 01:42:50 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from davidw2k (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with SMTP id h6G8ggUp075350; Wed, 16 Jul 2003 01:42:45 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <00ca01c34b76$b6a3ad30$f001a8c0@davidw2k> From: "David Xu" To: , "David Schultz" References: Date: Wed, 16 Jul 2003 16:46:06 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 cc: Craig Rodrigues cc: freebsd-threads@freebsd.org Subject: Re: Threads regression tests (was: Re: ACE Proactor and libkse) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 08:42:52 -0000 ----- Original Message -----=20 From: "Daniel Eischen" To: "David Schultz" Cc: "Craig Rodrigues" ; "David Xu" = ; Sent: Wednesday, July 16, 2003 4:22 PM Subject: Re: Threads regression tests (was: Re: ACE Proactor and libkse) > That's why lib{c_r|pthread|thr}/test/ exists. >=20 > > #include > > #include > > #include > >=20 > > int main() { > >=20 > > sigset_t mask; > > int sig; > >=20 > > sigemptyset(&mask); > > sigaddset(&mask, SIGALRM); > > if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) > > err(1, "sigprocmask"); > >=20 > > if (raise(SIGALRM) < 0) > > err(1, "raise"); > >=20 > > if (sigwait(&mask, &sig) < 0) > > err(1, "sigwait"); > > =20 > > return (0); > > } >=20 > This seems to be kernel bug (if it is a bug). If you build > it without linking any of the threads libraries it still > exits the program without sigwait receiving the signal. >=20 Yes, kern_sig.c's kern_sigtimedwait has bug, it shouldn't terminate process. However libkse current relies on this bug, unless I extend kse_thr_interrupt, fixing this bug would break libkse. I have already worked out a patch for kse_thr_interrupt, so when UTS receives a signal and finds that signal action is SIG_DFL, it would call kse_thr_interrupt to terminate process with signal, and possible core dumps itself. Coming commit will fix libkse to not rely on this bug. > --=20 > Dan Eischen >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to = "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 11:07:01 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E534437B401 for ; Wed, 16 Jul 2003 11:07:01 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 385F043F75 for ; Wed, 16 Jul 2003 11:07:01 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from dread (p508B327B.dip.t-dialin.net [80.139.50.123]) by dust.freshx.de (Postfix) with ESMTP id E7A2B15E107 for ; Wed, 16 Jul 2003 20:06:48 +0200 (CEST) From: "Kai Mosebach" To: Date: Wed, 16 Jul 2003 20:06:59 +0200 Message-ID: <003401c34bc5$104dcac0$0400a8c0@dread> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Subject: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 18:07:02 -0000 Hi, is it somehow possible to hide the threads in top / only see the master process ? cheers Kai From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 11:10:46 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D73337B401 for ; Wed, 16 Jul 2003 11:10:46 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1BAD43FAF for ; Wed, 16 Jul 2003 11:10:45 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc11) with ESMTP id <2003071618104501300nlam6e>; Wed, 16 Jul 2003 18:10:45 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA95602; Wed, 16 Jul 2003 11:10:33 -0700 (PDT) Date: Wed, 16 Jul 2003 11:10:32 -0700 (PDT) From: Julian Elischer To: Kai Mosebach In-Reply-To: <003401c34bc5$104dcac0$0400a8c0@dread> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 18:10:46 -0000 By default you see the threads (at this time). Well, you see all teh thrteads in libthr, and in libkse you see all the active kernel contexts, (which is not the same as the threads, as totally idle threads will not show up.) On Wed, 16 Jul 2003, Kai Mosebach wrote: > Hi, > > is it somehow possible to hide the threads in top / only see the master > process ? > > cheers > > Kai > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 12:16:52 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7CE1537B401; Wed, 16 Jul 2003 12:16:52 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C28EA43F85; Wed, 16 Jul 2003 12:16:51 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6GJFoAI024690; Wed, 16 Jul 2003 15:15:50 -0400 (EDT) Date: Wed, 16 Jul 2003 15:15:50 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Schultz In-Reply-To: <20030716055247.GA39968@HAL9000.homeunix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Craig Rodrigues cc: David Xu cc: freebsd-threads@freebsd.org Subject: sigwait() brokeness (was Re: Threads regression tests) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 19:16:52 -0000 On Tue, 15 Jul 2003, David Schultz wrote: > On Wed, Jul 16, 2003, David Xu wrote: > > Can you test my libkse patch ? > > http://people.freebsd.org/~davidxu/libpthread_bound.diffs > > If you can test the patch to make sure I don't break signal > > code, then I will commit this patch. > > Is there interest in incrementally building a threads-related > regression test suite in src/tools/regression? This would mean > less breakage for people who are trying to use KSE/libthr, and an > easy way for threads developers to be somewhat confident that > their changes are correct. For example, two weeks ago I was > tearing my hair out over a sigwait() problem that caused the > following program to deadlock. Since I already bothered to > isolate the bug, why not do the last 1% of the work and check in a > test so that it never comes back? Thoughts? Yes, sigwait() appears to be broken in the kernel. If the process is sigwait()ing on a signal set, and one of those signals is pending or occurs, the signal handler should not be invoked, especially if the signal is masked. The waitset is independent of the thread's signal mask. I think struct thread needs to grow a td_waitset member. If a signal arrives (or is already pending) and it is present in the waitset, then the thread should be woken up with the signal removed from the pending set and no signal handler installed. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 12:57:28 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B9EAE37B401 for ; Wed, 16 Jul 2003 12:57:28 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 303C343FBD for ; Wed, 16 Jul 2003 12:57:27 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from PETEX31 (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with SMTP id h6GJu9sL009338; Wed, 16 Jul 2003 22:56:09 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <06a201c34bd4$4a251500$812a40c1@PETEX31> From: "Petri Helenius" To: "Julian Elischer" , "Kai Mosebach" References: Date: Wed, 16 Jul 2003 22:56:04 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-threads@freebsd.org Subject: Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 19:57:29 -0000 > > Well, you see all teh thrteads in libthr, and in > libkse you see all the active kernel contexts, (which > is not the same as the threads, as totally idle threads > will not show up.) > With the exception that the WCPU% and CPU% is zero for KSEs currently not runnable. When it gets runnable, it remembers the percentage and immediately shows numbers like 30% until it goes idle again. Pete From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 15:31:29 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3294B37B401 for ; Wed, 16 Jul 2003 15:31:29 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id D482443FAF for ; Wed, 16 Jul 2003 15:31:27 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <20030716223127015004nc01e>; Wed, 16 Jul 2003 22:31:27 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA97339; Wed, 16 Jul 2003 15:31:24 -0700 (PDT) Date: Wed, 16 Jul 2003 15:31:23 -0700 (PDT) From: Julian Elischer To: Petri Helenius In-Reply-To: <06a201c34bd4$4a251500$812a40c1@PETEX31> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 22:31:29 -0000 On Wed, 16 Jul 2003, Petri Helenius wrote: > > > > Well, you see all teh thrteads in libthr, and in > > libkse you see all the active kernel contexts, (which > > is not the same as the threads, as totally idle threads > > will not show up.) > > > With the exception that the WCPU% and CPU% is zero for KSEs > currently not runnable. When it gets runnable, it remembers the > percentage and immediately shows numbers like 30% until it goes > idle again. > errr, I guess I should look at that.. reporting has taken a back seat to working so far... :-) > Pete > > From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 15:44:52 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D952C37B404 for ; Wed, 16 Jul 2003 15:44:52 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A4B043F3F for ; Wed, 16 Jul 2003 15:44:49 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from alpha (p508B327B.dip.t-dialin.net [80.139.50.123]) by dust.freshx.de (Postfix) with ESMTP id CA02715E0BE; Thu, 17 Jul 2003 00:44:37 +0200 (CEST) From: "Kai Mosebach" To: "'Julian Elischer'" Date: Thu, 17 Jul 2003 00:44:37 +0200 Message-ID: <000a01c34beb$dcb011b0$0100000a@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal cc: freebsd-threads@freebsd.org Subject: AW: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 22:44:53 -0000 I wonder then, that i only see "0.00%"-threads hanging around, making top nearly useless :| regards last pid: 13568; load averages: 1.54, 1.38, 1.33 up 0+09:53:22 00:34:21 172 processes: 4 running, 167 sleeping, 1 zombie CPU states: 76.9% user, 0.0% nice, 11.5% system, 3.8% interrupt, 7.7% idle Mem: 435M Active, 421M Inact, 100M Wired, 39M Cache, 111M Buf, 2912K Free Swap: 588M Total, 232K Used, 587M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 12893 root 130 0 297M 255M RUN 160:07 73.49% 73.49% kernel 892 root 99 0 70740K 68716K RUN 43:29 6.01% 6.01% mlnet 513 root 98 0 3540K 2136K RUN 27:38 4.39% 4.39% ppp 13149 root 96 0 2412K 1388K RUN 1:31 0.05% 0.05% top 12893 root 96 0 297M 255M select 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > -----Urspr=FCngliche Nachricht----- > Von: Julian Elischer [mailto:julian@elischer.org] > Gesendet: Donnerstag, 17. Juli 2003 00:31 > An: Petri Helenius > Cc: Kai Mosebach; freebsd-threads@freebsd.org > Betreff: Re: Threads in top >=20 >=20 >=20 > On Wed, 16 Jul 2003, Petri Helenius wrote: >=20 > > > > > > Well, you see all teh thrteads in libthr, and in > > > libkse you see all the active kernel contexts, (which > > > is not the same as the threads, as totally idle threads > > > will not show up.) From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 16:32:42 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21CB537B401 for ; Wed, 16 Jul 2003 16:32:42 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76C7243F85 for ; Wed, 16 Jul 2003 16:32:41 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <2003071623324001500gn3uke>; Wed, 16 Jul 2003 23:32:40 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA97700; Wed, 16 Jul 2003 16:32:38 -0700 (PDT) Date: Wed, 16 Jul 2003 16:32:37 -0700 (PDT) From: Julian Elischer To: Kai Mosebach In-Reply-To: <000a01c34beb$dcb011b0$0100000a@alpha> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: freebsd-threads@freebsd.org Subject: Re: AW: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 23:32:42 -0000 On Thu, 17 Jul 2003, Kai Mosebach wrote: > I wonder then, that i only see "0.00%"-threads hanging around, making > top nearly useless :| there is a bit that can be set in the sysctl that allows the kernel to produce only one line per process.. I guess top should use it.. btw why on earth did you call your program "kernel"? :-) to see just processes, change KERN_PROC_ALL in machine.c /usr/src/usr.bin/top to KERN_PROC_PROC of course if you didn't define them all as system scope threads, you'd not see them all, just the active ones. >=20 > regards >=20 > last pid: 13568; load averages: 1.54, 1.38, 1.33 > up 0+09:53:22 00:34:21 > 172 processes: 4 running, 167 sleeping, 1 zombie > CPU states: 76.9% user, 0.0% nice, 11.5% system, 3.8% interrupt, 7.7% > idle > Mem: 435M Active, 421M Inact, 100M Wired, 39M Cache, 111M Buf, 2912K > Free > Swap: 588M Total, 232K Used, 587M Free >=20 > PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU > COMMAND > 12893 root 130 0 297M 255M RUN 160:07 73.49% 73.49% kernel > 892 root 99 0 70740K 68716K RUN 43:29 6.01% 6.01% mlnet > 513 root 98 0 3540K 2136K RUN 27:38 4.39% 4.39% ppp > 13149 root 96 0 2412K 1388K RUN 1:31 0.05% 0.05% top > 12893 root 96 0 297M 255M select 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel > 12893 root 20 0 297M 255M kserel 160:07 0.00% 0.00% kernel >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Julian Elischer [mailto:julian@elischer.org] > > Gesendet: Donnerstag, 17. Juli 2003 00:31 > > An: Petri Helenius > > Cc: Kai Mosebach; freebsd-threads@freebsd.org > > Betreff: Re: Threads in top > >=20 > >=20 > >=20 > > On Wed, 16 Jul 2003, Petri Helenius wrote: > >=20 > > > > > > > > Well, you see all teh thrteads in libthr, and in > > > > libkse you see all the active kernel contexts, (which > > > > is not the same as the threads, as totally idle threads > > > > will not show up.) >=20 >=20 >=20 From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 17:58:57 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D206437B401; Wed, 16 Jul 2003 17:58:57 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5072E43FD7; Wed, 16 Jul 2003 17:58:57 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from davidw2k (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with SMTP id h6H0wqUp006516; Wed, 16 Jul 2003 17:58:54 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <001c01c34bff$13a21980$f001a8c0@davidw2k> From: "David Xu" To: , "David Schultz" References: Date: Thu, 17 Jul 2003 09:02:16 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 cc: Craig Rodrigues cc: freebsd-threads@freebsd.org Subject: Re: sigwait() brokeness (was Re: Threads regression tests) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 00:58:58 -0000 ----- Original Message -----=20 From: "Daniel Eischen" To: "David Schultz" Cc: "Craig Rodrigues" ; "David Xu" = ; Sent: Thursday, July 17, 2003 3:15 AM Subject: sigwait() brokeness (was Re: Threads regression tests) > On Tue, 15 Jul 2003, David Schultz wrote: >=20 > > On Wed, Jul 16, 2003, David Xu wrote: > > > Can you test my libkse patch ? > > > http://people.freebsd.org/~davidxu/libpthread_bound.diffs > > > If you can test the patch to make sure I don't break signal > > > code, then I will commit this patch.=20 > >=20 > > Is there interest in incrementally building a threads-related > > regression test suite in src/tools/regression? This would mean > > less breakage for people who are trying to use KSE/libthr, and an > > easy way for threads developers to be somewhat confident that > > their changes are correct. For example, two weeks ago I was > > tearing my hair out over a sigwait() problem that caused the > > following program to deadlock. Since I already bothered to > > isolate the bug, why not do the last 1% of the work and check in a > > test so that it never comes back? Thoughts? >=20 > Yes, sigwait() appears to be broken in the kernel. > If the process is sigwait()ing on a signal set, and > one of those signals is pending or occurs, the > signal handler should not be invoked, especially > if the signal is masked. >=20 > The waitset is independent of the thread's signal > mask. I think struct thread needs to grow a td_waitset > member. If a signal arrives (or is already pending) > and it is present in the waitset, then the thread > should be woken up with the signal removed from the > pending set and no signal handler installed. >=20 I am working on it now.=20 > --=20 > Dan Eischen >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to = "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Wed Jul 16 22:50:46 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6121437B401 for ; Wed, 16 Jul 2003 22:50:46 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC39343F75 for ; Wed, 16 Jul 2003 22:50:45 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-uinj8ql.dialup.mindspring.com ([165.121.163.85] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19d1f9-0001cD-00; Wed, 16 Jul 2003 22:50:43 -0700 Message-ID: <3F1638F6.F32171DA@mindspring.com> Date: Wed, 16 Jul 2003 22:49:42 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Kai Mosebach References: <003401c34bc5$104dcac0$0400a8c0@dread> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4cb71d4917caf698f79b4f33d26fba8eb350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: freebsd-threads@freebsd.org Subject: Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 05:50:46 -0000 Kai Mosebach wrote: > is it somehow possible to hide the threads in top / only see the master > process ? The ps program does this by not showing threads unless invoked with the "-H" option. Probably someone who wants to hide the threads in top (hint hint) should do what ps does in order to make top act the same way (Darwin uses "-M" instead of "-H", but FreeBSD uses this for system dump image files). FWIW, the implementation detail is that everything is returned, and the filtering occurs on display. -- Terry From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 12:45:28 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0883937B401 for ; Thu, 17 Jul 2003 12:45:28 -0700 (PDT) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 038A643F3F for ; Thu, 17 Jul 2003 12:45:27 -0700 (PDT) (envelope-from jkim@niksun.com) Received: from daemon.mj.niksun.com (daemon.mj.niksun.com [10.70.0.244]) h6HJjKlT080072; Thu, 17 Jul 2003 15:45:20 -0400 (EDT) (envelope-from jkim@niksun.com) X-RAV-AntiVirus: This e-mail has been scanned for viruses. From: Jung-uk Kim Organization: Niksun, Inc. To: Terry Lambert , Kai Mosebach Date: Thu, 17 Jul 2003 15:45:18 -0400 User-Agent: KMail/1.5.1 References: <003401c34bc5$104dcac0$0400a8c0@dread> <3F1638F6.F32171DA@mindspring.com> In-Reply-To: <3F1638F6.F32171DA@mindspring.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_OzvF/XgRLXEQHVU" Message-Id: <200307171545.18232.jkim@niksun.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: freebsd-threads@freebsd.org Subject: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 19:45:28 -0000 --Boundary-00=_OzvF/XgRLXEQHVU Content-Type: text/plain; charset="euc-kr" Content-Transfer-Encoding: 7bit Content-Disposition: inline The patch adds command line option "-H" and interactive command "H". Enjoy, Jung-uk Kim On Thursday 17 July 2003 01:49 am, Terry Lambert wrote: > Kai Mosebach wrote: > > is it somehow possible to hide the threads in top / only see the > > master process ? > > The ps program does this by not showing threads unless invoked > with the "-H" option. Probably someone who wants to hide the > threads in top (hint hint) should do what ps does in order to > make top act the same way (Darwin uses "-M" instead of "-H", > but FreeBSD uses this for system dump image files). > > FWIW, the implementation detail is that everything is returned, > and the filtering occurs on display. > > -- Terry --Boundary-00=_OzvF/XgRLXEQHVU-- From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 12:49:14 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E3BF37B401 for ; Thu, 17 Jul 2003 12:49:14 -0700 (PDT) Received: from lakemtao07.cox.net (lakemtao07.cox.net [68.1.17.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3B9043FBD for ; Thu, 17 Jul 2003 12:49:13 -0700 (PDT) (envelope-from mezz7@cox.net) Received: from mezz.mezzweb.com ([68.103.32.11]) by lakemtao07.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030717194913.XETC26675.lakemtao07.cox.net@mezz.mezzweb.com>; Thu, 17 Jul 2003 15:49:13 -0400 To: Jung-uk Kim References: <003401c34bc5$104dcac0$0400a8c0@dread> <3F1638F6.F32171DA@mindspring.com> <200307171545.18232.jkim@niksun.com> Message-ID: Content-Type: text/plain; charset=utf-8; format=flowed From: Jeremy Messenger MIME-Version: 1.0 Date: Thu, 17 Jul 2003 14:49:03 -0500 In-Reply-To: <200307171545.18232.jkim@niksun.com> User-Agent: Opera7.11/Linux M2 build 406 cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 19:49:14 -0000 On Thu, 17 Jul 2003 15:45:18 -0400, Jung-uk Kim wrote: > The patch adds command line option "-H" and interactive command "H". I think, you have forgotten to attach your patch. ;-) Cheers, Mezz > Enjoy, > > Jung-uk Kim > > On Thursday 17 July 2003 01:49 am, Terry Lambert wrote: >> Kai Mosebach wrote: >> > is it somehow possible to hide the threads in top / only see the >> > master process ? >> >> The ps program does this by not showing threads unless invoked >> with the "-H" option. Probably someone who wants to hide the >> threads in top (hint hint) should do what ps does in order to >> make top act the same way (Darwin uses "-M" instead of "-H", >> but FreeBSD uses this for system dump image files). >> >> FWIW, the implementation detail is that everything is returned, >> and the filtering occurs on display. >> >> -- Terry -- bsdforums.org 's moderator, mezz. From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 12:56:05 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BDAC637B401 for ; Thu, 17 Jul 2003 12:56:05 -0700 (PDT) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD52E43F93 for ; Thu, 17 Jul 2003 12:56:04 -0700 (PDT) (envelope-from jkim@niksun.com) Received: from daemon.mj.niksun.com (daemon.mj.niksun.com [10.70.0.244]) h6HJt3lT080339; Thu, 17 Jul 2003 15:55:03 -0400 (EDT) (envelope-from jkim@niksun.com) X-RAV-AntiVirus: This e-mail has been scanned for viruses. From: Jung-uk Kim Organization: Niksun, Inc. To: Jeremy Messenger Date: Thu, 17 Jul 2003 15:55:01 -0400 User-Agent: KMail/1.5.1 References: <003401c34bc5$104dcac0$0400a8c0@dread> <200307171545.18232.jkim@niksun.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="euc-kr" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307171555.01584.jkim@niksun.com> cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 19:56:06 -0000 On Thursday 17 July 2003 03:49 pm, Jeremy Messenger wrote: > On Thu, 17 Jul 2003 15:45:18 -0400, Jung-uk Kim wrote: > > The patch adds command line option "-H" and interactive command > > "H". > > I think, you have forgotten to attach your patch. ;-) I haven't. :-/ Mailman is always cutting my attachment. This time I inlined it. Sorry for the inconvenience. Jung-uk Kim > Cheers, > Mezz > > > Enjoy, > > > > Jung-uk Kim > > > > On Thursday 17 July 2003 01:49 am, Terry Lambert wrote: > >> Kai Mosebach wrote: > >> > is it somehow possible to hide the threads in top / only see > >> > the master process ? > >> > >> The ps program does this by not showing threads unless invoked > >> with the "-H" option. Probably someone who wants to hide the > >> threads in top (hint hint) should do what ps does in order to > >> make top act the same way (Darwin uses "-M" instead of "-H", > >> but FreeBSD uses this for system dump image files). > >> > >> FWIW, the implementation detail is that everything is returned, > >> and the filtering occurs on display. > >> > >> -- Terry ------ src/contrib/top/commands.c Thu Jan 24 12:52:26 2002 +++ src/contrib/top.new/commands.c Thu Jul 17 15:02:32 2003 @@ -70,6 +70,7 @@ fputs("\ d - change number of displays to show\n\ e - list errors generated by last \"kill\" or \"renice\" command\n\ +H - toggle the displaying of threads\n\ i - toggle the displaying of idle processes\n\ I - same as 'i'\n\ k - kill processes; send a signal to a list of processes\n\ --- src/contrib/top/machine.h Thu Jan 24 12:58:42 2002 +++ src/contrib/top.new/machine.h Thu Jul 17 14:48:19 2003 @@ -59,6 +59,7 @@ int idle; /* show idle processes */ int self; /* show self */ int system; /* show system processes */ + int thread; /* show threads */ int uid; /* only this uid (unless uid == -1) */ char *command; /* only this command (unless == NULL) */ }; --- src/contrib/top/top.c Thu Jan 24 12:55:40 2002 +++ src/contrib/top.new/top.c Thu Jul 17 15:04:42 2003 @@ -192,9 +192,9 @@ fd_set readfds; #ifdef ORDER - static char command_chars[] = "\f qh?en#sdkriIuto"; + static char command_chars[] = "\f qh?en#sdkriIutHo"; #else - static char command_chars[] = "\f qh?en#sdkriIut"; + static char command_chars[] = "\f qh?en#sdkriIutH"; #endif /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 @@ -214,8 +214,9 @@ #define CMD_idletog2 13 #define CMD_user 14 #define CMD_selftog 15 +#define CMD_thrtog 16 #ifdef ORDER -#define CMD_order 16 +#define CMD_order 17 #endif /* set the buffer for stdout */ @@ -245,6 +246,7 @@ ps.self = -1; ps.system = No; ps.uid = -1; + ps.thread = Yes; ps.command = NULL; /* get preset options from the environment */ @@ -270,7 +272,7 @@ optind = 1; } - while ((i = getopt(ac, av, "SIbinquvs:d:U:o:t")) != EOF) + while ((i = getopt(ac, av, "SIHbinquvs:d:U:o:t")) != EOF) { switch(i) { @@ -364,11 +366,15 @@ case 't': ps.self = (ps.self == -1) ? getpid() : -1; break; - + + case 'H': + ps.thread = !ps.thread; + break; + default: fprintf(stderr, "\ Top version %s\n\ -Usage: %s [-ISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n", +Usage: %s [-HISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n", version_string(), myname); exit(1); } @@ -955,6 +961,14 @@ } break; + case CMD_thrtog: + ps.thread = !ps.thread; + new_message(MT_standout | MT_delayed, + " %sisplaying threads.", + ps.thread ? "D" : "Not d"); + putchar('\r'); + break; + #ifdef ORDER case CMD_order: new_message(MT_standout, @@ -979,7 +993,7 @@ } break; #endif - + default: new_message(MT_standout, " BAD CASE IN SWITCH!"); putchar('\r'); --- src/usr.bin/top/machine.c Sun Feb 16 09:09:52 2003 +++ src/usr.bin/top.new/machine.c Thu Jul 17 14:56:13 2003 @@ -414,7 +414,10 @@ int show_command; - pbase = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); + if (sel->thread) + pbase = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); + else + pbase = kvm_getprocs(kd, KERN_PROC_PROC, 0, &nproc); if (nproc > onproc) pref = (struct kinfo_proc **) realloc(pref, sizeof(struct kinfo_proc *) * (onproc = nproc)); From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 13:59:31 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1017037B401 for ; Thu, 17 Jul 2003 13:59:31 -0700 (PDT) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3969D43F93 for ; Thu, 17 Jul 2003 13:59:30 -0700 (PDT) (envelope-from jkim@niksun.com) Received: from daemon.mj.niksun.com (daemon.mj.niksun.com [10.70.0.244]) h6HKwglT082177; Thu, 17 Jul 2003 16:58:43 -0400 (EDT) (envelope-from jkim@niksun.com) X-RAV-AntiVirus: This e-mail has been scanned for viruses. From: Jung-uk Kim Organization: Niksun, Inc. To: freebsd-threads@freebsd.org Date: Thu, 17 Jul 2003 16:58:40 -0400 User-Agent: KMail/1.5.1 References: <003401c34bc5$104dcac0$0400a8c0@dread> <200307171545.18232.jkim@niksun.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307171658.40674.jkim@niksun.com> cc: Kai Mosebach Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 20:59:31 -0000 This is revised version of the patch. The previous version was made in haste. It's actually one-line-style-change(TM) and functionally the same. ;-) Anyway, can anybody edit man page for this change, i.e., src/usr.bin/top/top.local.1? I am a terrible doc writer. Thanks, Jung-uk Kim --- src/contrib/top/commands.c Thu Jan 24 12:52:26 2002 +++ src/contrib/top.new/commands.c Thu Jul 17 15:02:32 2003 @@ -70,6 +70,7 @@ fputs("\ d - change number of displays to show\n\ e - list errors generated by last \"kill\" or \"renice\" command\n\ +H - toggle the displaying of threads\n\ i - toggle the displaying of idle processes\n\ I - same as 'i'\n\ k - kill processes; send a signal to a list of processes\n\ --- src/contrib/top/machine.h Thu Jan 24 12:58:42 2002 +++ src/contrib/top.new/machine.h Thu Jul 17 14:48:19 2003 @@ -59,6 +59,7 @@ int idle; /* show idle processes */ int self; /* show self */ int system; /* show system processes */ + int thread; /* show threads */ int uid; /* only this uid (unless uid == -1) */ char *command; /* only this command (unless == NULL) */ }; --- src/contrib/top/top.c Thu Jan 24 12:55:40 2002 +++ src/contrib/top.new/top.c Thu Jul 17 15:04:42 2003 @@ -192,9 +192,9 @@ fd_set readfds; #ifdef ORDER - static char command_chars[] = "\f qh?en#sdkriIuto"; + static char command_chars[] = "\f qh?en#sdkriIutHo"; #else - static char command_chars[] = "\f qh?en#sdkriIut"; + static char command_chars[] = "\f qh?en#sdkriIutH"; #endif /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 @@ -214,8 +214,9 @@ #define CMD_idletog2 13 #define CMD_user 14 #define CMD_selftog 15 +#define CMD_thrtog 16 #ifdef ORDER -#define CMD_order 16 +#define CMD_order 17 #endif /* set the buffer for stdout */ @@ -245,6 +246,7 @@ ps.self = -1; ps.system = No; ps.uid = -1; + ps.thread = Yes; ps.command = NULL; /* get preset options from the environment */ @@ -270,7 +272,7 @@ optind = 1; } - while ((i = getopt(ac, av, "SIbinquvs:d:U:o:t")) != EOF) + while ((i = getopt(ac, av, "SIHbinquvs:d:U:o:t")) != EOF) { switch(i) { @@ -364,11 +366,15 @@ case 't': ps.self = (ps.self == -1) ? getpid() : -1; break; - + + case 'H': + ps.thread = !ps.thread; + break; + default: fprintf(stderr, "\ Top version %s\n\ -Usage: %s [-ISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n", +Usage: %s [-HISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n", version_string(), myname); exit(1); } @@ -955,6 +961,14 @@ } break; + case CMD_thrtog: + ps.thread = !ps.thread; + new_message(MT_standout | MT_delayed, + " %sisplaying threads.", + ps.thread ? "D" : "Not d"); + putchar('\r'); + break; + #ifdef ORDER case CMD_order: new_message(MT_standout, @@ -979,7 +993,7 @@ } break; #endif - + default: new_message(MT_standout, " BAD CASE IN SWITCH!"); putchar('\r'); --- src/usr.bin/top/machine.c Sun Feb 16 09:09:52 2003 +++ src/usr.bin/top.new/machine.c Thu Jul 17 14:56:13 2003 @@ -414,7 +414,8 @@ int show_command; - pbase = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); + pbase = kvm_getprocs(kd, sel->thread ? KERN_PROC_ALL : KERN_PROC_PROC, 0, + &nproc); if (nproc > onproc) pref = (struct kinfo_proc **) realloc(pref, sizeof(struct kinfo_proc *) * (onproc = nproc)); From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 14:44:52 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18A7337B401 for ; Thu, 17 Jul 2003 14:44:52 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 63ACE43F93 for ; Thu, 17 Jul 2003 14:44:51 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6HLioAI000258; Thu, 17 Jul 2003 17:44:50 -0400 (EDT) Date: Thu, 17 Jul 2003 17:44:50 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Jung-uk Kim In-Reply-To: <200307171658.40674.jkim@niksun.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 21:44:52 -0000 On Thu, 17 Jul 2003, Jung-uk Kim wrote: > This is revised version of the patch. The previous version was > made in haste. It's actually one-line-style-change(TM) and > functionally the same. ;-) [ ... ] > @@ -214,8 +214,9 @@ > #define CMD_idletog2 13 > #define CMD_user 14 > #define CMD_selftog 15 > +#define CMD_thrtog 16 > #ifdef ORDER > -#define CMD_order 16 > +#define CMD_order 17 > #endif > > /* set the buffer for stdout */ > @@ -245,6 +246,7 @@ > ps.self = -1; > ps.system = No; > ps.uid = -1; > + ps.thread = Yes; Can you make showing threads No by default? I know the current top shows threads by default, but I don't think it should. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 14:51:29 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4167337B401; Thu, 17 Jul 2003 14:51:29 -0700 (PDT) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6086943FAF; Thu, 17 Jul 2003 14:51:28 -0700 (PDT) (envelope-from jkim@niksun.com) Received: from daemon.mj.niksun.com (daemon.mj.niksun.com [10.70.0.244]) h6HLorlT083985; Thu, 17 Jul 2003 17:50:53 -0400 (EDT) (envelope-from jkim@niksun.com) X-RAV-AntiVirus: This e-mail has been scanned for viruses. From: Jung-uk Kim Organization: Niksun, Inc. To: deischen@freebsd.org, Daniel Eischen Date: Thu, 17 Jul 2003 17:50:51 -0400 User-Agent: KMail/1.5.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="euc-kr" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307171750.51176.jkim@niksun.com> cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 21:51:29 -0000 On Thursday 17 July 2003 05:44 pm, Daniel Eischen wrote: > On Thu, 17 Jul 2003, Jung-uk Kim wrote: > > Can you make showing threads No by default? I know the > current top shows threads by default, but I don't think > it should. Well, I just wanted to keep default behavior intact, just like ps(1). *shrug* Jung-uk Kim From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 14:55:15 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 52B4737B401 for ; Thu, 17 Jul 2003 14:55:15 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EFCC43F3F for ; Thu, 17 Jul 2003 14:55:12 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6HLtBAI002115; Thu, 17 Jul 2003 17:55:11 -0400 (EDT) Date: Thu, 17 Jul 2003 17:55:11 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Jung-uk Kim In-Reply-To: <200307171750.51176.jkim@niksun.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 21:55:15 -0000 On Thu, 17 Jul 2003, Jung-uk Kim wrote: > On Thursday 17 July 2003 05:44 pm, Daniel Eischen wrote: > > On Thu, 17 Jul 2003, Jung-uk Kim wrote: > > > > Can you make showing threads No by default? I know the > > current top shows threads by default, but I don't think > > it should. > > Well, I just wanted to keep default behavior intact, just like ps(1). > *shrug* Yeah, I realize that, but the default behavior is wrong ;-) This was brought up in a different thread a few weeks ago, and there was no heartburn over defaulting it to not showing threads by default. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 15:09:28 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F058637B401; Thu, 17 Jul 2003 15:09:28 -0700 (PDT) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26C1043FE0; Thu, 17 Jul 2003 15:09:28 -0700 (PDT) (envelope-from jkim@niksun.com) Received: from daemon.mj.niksun.com (daemon.mj.niksun.com [10.70.0.244]) h6HM8llT084584; Thu, 17 Jul 2003 18:08:47 -0400 (EDT) (envelope-from jkim@niksun.com) X-RAV-AntiVirus: This e-mail has been scanned for viruses. From: Jung-uk Kim Organization: Niksun, Inc. To: deischen@freebsd.org, Daniel Eischen Date: Thu, 17 Jul 2003 18:08:45 -0400 User-Agent: KMail/1.5.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307171808.45353.jkim@niksun.com> cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 22:09:29 -0000 On Thursday 17 July 2003 05:55 pm, Daniel Eischen wrote: > On Thu, 17 Jul 2003, Jung-uk Kim wrote: > > On Thursday 17 July 2003 05:44 pm, Daniel Eischen wrote: > > > On Thu, 17 Jul 2003, Jung-uk Kim wrote: > > > > > > Can you make showing threads No by default? I know the > > > current top shows threads by default, but I don't think > > > it should. > > > > Well, I just wanted to keep default behavior intact, just like > > ps(1). *shrug* > > Yeah, I realize that, but the default behavior is wrong ;-) > This was brought up in a different thread a few weeks > ago, and there was no heartburn over defaulting it to > not showing threads by default. If majority thinks that's the way it should be, I have no problem as long as it behaves like ps(1). After all, I am not a committer. ;-) Jung-uk Kim From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 15:12:39 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0590B37B401 for ; Thu, 17 Jul 2003 15:12:39 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5485243FDD for ; Thu, 17 Jul 2003 15:12:38 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6HMCbAI004742; Thu, 17 Jul 2003 18:12:37 -0400 (EDT) Date: Thu, 17 Jul 2003 18:12:37 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Jung-uk Kim In-Reply-To: <200307171808.45353.jkim@niksun.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 22:12:39 -0000 On Thu, 17 Jul 2003, Jung-uk Kim wrote: > On Thursday 17 July 2003 05:55 pm, Daniel Eischen wrote: > > On Thu, 17 Jul 2003, Jung-uk Kim wrote: > > > On Thursday 17 July 2003 05:44 pm, Daniel Eischen wrote: > > > > On Thu, 17 Jul 2003, Jung-uk Kim wrote: > > > > > > > > Can you make showing threads No by default? I know the > > > > current top shows threads by default, but I don't think > > > > it should. > > > > > > Well, I just wanted to keep default behavior intact, just like > > > ps(1). *shrug* > > > > Yeah, I realize that, but the default behavior is wrong ;-) > > This was brought up in a different thread a few weeks > > ago, and there was no heartburn over defaulting it to > > not showing threads by default. > > If majority thinks that's the way it should be, I have no problem as > long as it behaves like ps(1). After all, I am not a committer. ;-) Oh, sorry. Sometimes I just assume that someone that commits a nice patch like that is a committer :-) -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 16:51:01 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7791A37B401 for ; Thu, 17 Jul 2003 16:51:01 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9CBA643FB1 for ; Thu, 17 Jul 2003 16:50:59 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc12) with ESMTP id <2003071723505701400s643je>; Thu, 17 Jul 2003 23:50:57 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA07044; Thu, 17 Jul 2003 16:50:56 -0700 (PDT) Date: Thu, 17 Jul 2003 16:50:55 -0700 (PDT) From: Julian Elischer To: Jung-uk Kim In-Reply-To: <200307171658.40674.jkim@niksun.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 23:51:01 -0000 checking in with reversed default (not shown by default) On Thu, 17 Jul 2003, Jung-uk Kim wrote: > This is revised version of the patch. The previous version was > made in haste. It's actually one-line-style-change(TM) and > functionally the same. ;-) > > Anyway, can anybody edit man page for this change, > i.e., src/usr.bin/top/top.local.1? I am a terrible doc writer. > > Thanks, > > Jung-uk Kim > --- src/contrib/top/commands.c Thu Jan 24 12:52:26 2002 > +++ src/contrib/top.new/commands.c Thu Jul 17 15:02:32 2003 > @@ -70,6 +70,7 @@ > fputs("\ > d - change number of displays to show\n\ > e - list errors generated by last \"kill\" or \"renice\" command\n\ > +H - toggle the displaying of threads\n\ > i - toggle the displaying of idle processes\n\ > I - same as 'i'\n\ > k - kill processes; send a signal to a list of processes\n\ > --- src/contrib/top/machine.h Thu Jan 24 12:58:42 2002 > +++ src/contrib/top.new/machine.h Thu Jul 17 14:48:19 2003 > @@ -59,6 +59,7 @@ > int idle; /* show idle processes */ > int self; /* show self */ > int system; /* show system processes */ > + int thread; /* show threads */ > int uid; /* only this uid (unless uid == -1) */ > char *command; /* only this command (unless == NULL) */ > }; > --- src/contrib/top/top.c Thu Jan 24 12:55:40 2002 > +++ src/contrib/top.new/top.c Thu Jul 17 15:04:42 2003 > @@ -192,9 +192,9 @@ > fd_set readfds; > > #ifdef ORDER > - static char command_chars[] = "\f qh?en#sdkriIuto"; > + static char command_chars[] = "\f qh?en#sdkriIutHo"; > #else > - static char command_chars[] = "\f qh?en#sdkriIut"; > + static char command_chars[] = "\f qh?en#sdkriIutH"; > #endif > /* these defines enumerate the "strchr"s of the commands in command_chars */ > #define CMD_redraw 0 > @@ -214,8 +214,9 @@ > #define CMD_idletog2 13 > #define CMD_user 14 > #define CMD_selftog 15 > +#define CMD_thrtog 16 > #ifdef ORDER > -#define CMD_order 16 > +#define CMD_order 17 > #endif > > /* set the buffer for stdout */ > @@ -245,6 +246,7 @@ > ps.self = -1; > ps.system = No; > ps.uid = -1; > + ps.thread = Yes; > ps.command = NULL; > > /* get preset options from the environment */ > @@ -270,7 +272,7 @@ > optind = 1; > } > > - while ((i = getopt(ac, av, "SIbinquvs:d:U:o:t")) != EOF) > + while ((i = getopt(ac, av, "SIHbinquvs:d:U:o:t")) != EOF) > { > switch(i) > { > @@ -364,11 +366,15 @@ > case 't': > ps.self = (ps.self == -1) ? getpid() : -1; > break; > - > + > + case 'H': > + ps.thread = !ps.thread; > + break; > + > default: > fprintf(stderr, "\ > Top version %s\n\ > -Usage: %s [-ISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n", > +Usage: %s [-HISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n", > version_string(), myname); > exit(1); > } > @@ -955,6 +961,14 @@ > } > break; > > + case CMD_thrtog: > + ps.thread = !ps.thread; > + new_message(MT_standout | MT_delayed, > + " %sisplaying threads.", > + ps.thread ? "D" : "Not d"); > + putchar('\r'); > + break; > + > #ifdef ORDER > case CMD_order: > new_message(MT_standout, > @@ -979,7 +993,7 @@ > } > break; > #endif > - > + > default: > new_message(MT_standout, " BAD CASE IN SWITCH!"); > putchar('\r'); > --- src/usr.bin/top/machine.c Sun Feb 16 09:09:52 2003 > +++ src/usr.bin/top.new/machine.c Thu Jul 17 14:56:13 2003 > @@ -414,7 +414,8 @@ > int show_command; > > > - pbase = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); > + pbase = kvm_getprocs(kd, sel->thread ? KERN_PROC_ALL : KERN_PROC_PROC, 0, > + &nproc); > if (nproc > onproc) > pref = (struct kinfo_proc **) realloc(pref, sizeof(struct kinfo_proc *) > * (onproc = nproc)); > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Thu Jul 17 19:52:08 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7AADD37B401 for ; Thu, 17 Jul 2003 19:52:08 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C859343F75 for ; Thu, 17 Jul 2003 19:52:07 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6I2q6AI020118; Thu, 17 Jul 2003 22:52:06 -0400 (EDT) Date: Thu, 17 Jul 2003 22:52:06 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Petri Helenius In-Reply-To: <3F0A7425.9080300@he.iki.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: thread scheduling priority with libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 02:52:08 -0000 On Tue, 8 Jul 2003, Petri Helenius wrote: > Daniel Eischen wrote: > > >The current thread. As I said before, if there are idle KSEs, then > >one is woken to run the newly runnable thread. > > > I'm seeing about 200 microsecond latency when scheduling the thread on > the other > KSE. Which translates to maximum of 2500 "spins" of the contested loop > a second. > > Same code runs about 500000 spins a second when no locking is involved. I just committed a change to libpthread so that preemption points are added when threads are made runnable after a mutex is released or a condition variable is signaled. You might try your test again with this change and see if it helps. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 00:01:51 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D7A7D37B401 for ; Fri, 18 Jul 2003 00:01:51 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3406843F85 for ; Fri, 18 Jul 2003 00:01:49 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfi0c.dialup.mindspring.com ([165.247.200.12] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19dPFS-00032D-00; Fri, 18 Jul 2003 00:01:47 -0700 Message-ID: <3F179B16.1251C762@mindspring.com> Date: Fri, 18 Jul 2003 00:00:38 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Jung-uk Kim References: <003401c34bc5$104dcac0$0400a8c0@dread> <200307171545.18232.jkim@niksun.com> <200307171555.01584.jkim@niksun.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4ef239c604debd9e1844aa01c946721bca8438e0f32a48e08350badd9bab72f9c350badd9bab72f9c cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: [PATCH] Re: Threads in top X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 07:01:52 -0000 Jung-uk Kim wrote: > On Thursday 17 July 2003 03:49 pm, Jeremy Messenger wrote: > > On Thu, 17 Jul 2003 15:45:18 -0400, Jung-uk Kim wrote: > > > The patch adds command line option "-H" and interactive command > > > "H". > > > > I think, you have forgotten to attach your patch. ;-) > > I haven't. :-/ Mailman is always cutting my attachment. This time I > inlined it. Sorry for the inconvenience. FWIW, this patch works for me, and makes "top" much nicer when running threaded programs (a single threaded program doesn't push everything off the screen to show me threads I don't really care about because I'm not interested in that specific application). -- Terry From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 12:46:57 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A663637B401 for ; Fri, 18 Jul 2003 12:46:57 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B2FB43F85 for ; Fri, 18 Jul 2003 12:46:57 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6IJkuAI020059 for ; Fri, 18 Jul 2003 15:46:56 -0400 (EDT) Date: Fri, 18 Jul 2003 15:46:56 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: threads@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 19:46:58 -0000 Before we switch from libkse to libpthread, let's take a look at the mailboxes and see if we want to reorder them for better alignment. I took a cut at it. I moved the context from the beginning of the thread mailbox to the end since it was the largest field and most likely to change (for non-i386 archs). struct kse_thr_mailbox { struct kse_thr_mailbox *tm_next; /* Next thread in list */ void *tm_udata; /* For use by the UTS */ uint32_t tm_flags; /* Thread flags */ uint32_t tm_uticks; uint32_t tm_sticks; uint32_t tm_spare2[9]; siginfo_t tm_syncsig; ucontext_t tm_context; /* User and machine context */ }; struct kse_mailbox { uint32_t km_version; /* Mailbox version */ uint32_t km_flags; /* KSE flags */ struct kse_thr_mailbox *km_curthread; /* Currently running thread */ struct kse_thr_mailbox *km_completed; /* Threads back from kernel */ sigset_t km_sigscaught; /* Caught signals */ kse_func_t *km_func; /* UTS function */ stack_t km_stack; /* UTS context */ void *km_udata; /* For use by the UTS */ struct timespec km_timeofday; /* Time of day */ int32_t km_quantum; /* Upcall quantum in msecs */ uint32_t km_spare[8]; }; Comments, suggestions? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 12:52:05 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF47037B401; Fri, 18 Jul 2003 12:52:05 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0F8143F85; Fri, 18 Jul 2003 12:52:03 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <2003071819520301500bjqt3e>; Fri, 18 Jul 2003 19:52:03 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA14802; Fri, 18 Jul 2003 12:52:02 -0700 (PDT) Date: Fri, 18 Jul 2003 12:52:00 -0700 (PDT) From: Julian Elischer To: deischen@freebsd.org In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 19:52:06 -0000 for TLS we need to ensure that the first few (actually, 1 but a couple more can't hurt) entry in the KSE mailbox is available as a pointer to the TLS. (on 386 at least). Marcel probablyt has more to say on the topic. Also, in the latest version I assume there is still a KSE mailbox for 1:1 threads, as it'll be needed for TLS. (is there still a pair of mailboxen for bound, NON-SA threads?) (even if not used..?) On Fri, 18 Jul 2003, Daniel Eischen wrote: > Before we switch from libkse to libpthread, let's take a look > at the mailboxes and see if we want to reorder them for better > alignment. > > I took a cut at it. I moved the context from the beginning > of the thread mailbox to the end since it was the largest > field and most likely to change (for non-i386 archs). > > struct kse_thr_mailbox { > struct kse_thr_mailbox *tm_next; /* Next thread in list */ > void *tm_udata; /* For use by the UTS */ > uint32_t tm_flags; /* Thread flags */ > uint32_t tm_uticks; > uint32_t tm_sticks; > uint32_t tm_spare2[9]; > siginfo_t tm_syncsig; > ucontext_t tm_context; /* User and machine context */ > }; > > struct kse_mailbox { > uint32_t km_version; /* Mailbox version */ > uint32_t km_flags; /* KSE flags */ > struct kse_thr_mailbox *km_curthread; /* Currently running thread */ > struct kse_thr_mailbox *km_completed; /* Threads back from kernel */ > sigset_t km_sigscaught; /* Caught signals */ > kse_func_t *km_func; /* UTS function */ > stack_t km_stack; /* UTS context */ > void *km_udata; /* For use by the UTS */ > struct timespec km_timeofday; /* Time of day */ > int32_t km_quantum; /* Upcall quantum in msecs */ > uint32_t km_spare[8]; > }; > > Comments, suggestions? > > -- > Dan Eischen > > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 13:06:42 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 493B837B401 for ; Fri, 18 Jul 2003 13:06:42 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DC2743FA3 for ; Fri, 18 Jul 2003 13:06:41 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6IK6XAI023656; Fri, 18 Jul 2003 16:06:33 -0400 (EDT) Date: Fri, 18 Jul 2003 16:06:33 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Julian Elischer In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 20:06:42 -0000 On Fri, 18 Jul 2003, Julian Elischer wrote: > for TLS we need to ensure that the first few (actually, 1 but a couple > more can't hurt) entry in the KSE mailbox is available as a pointer to > the TLS. (on 386 at least). Marcel probablyt has more to say on the > topic. OK. We really want the version as the first field, but if it can't be that way, we'll have to move it down a tad. This also reminds me. We need to add the per-KSE storage and size to the KSE mailbox so the kernel can do the LDT allocation (for i386 and amd64). > Also, in the latest version I assume there is still a KSE mailbox for > 1:1 threads, as it'll be needed for TLS. (is there still a pair of > mailboxen for bound, NON-SA threads?) (even if not used..?) Yes, there is. Both the thread and KSE mailbox are used for bound threads. > > > > On Fri, 18 Jul 2003, Daniel Eischen wrote: > > > Before we switch from libkse to libpthread, let's take a look > > at the mailboxes and see if we want to reorder them for better > > alignment. > > > > I took a cut at it. I moved the context from the beginning > > of the thread mailbox to the end since it was the largest > > field and most likely to change (for non-i386 archs). > > > > struct kse_thr_mailbox { > > struct kse_thr_mailbox *tm_next; /* Next thread in list */ > > void *tm_udata; /* For use by the UTS */ > > uint32_t tm_flags; /* Thread flags */ > > uint32_t tm_uticks; > > uint32_t tm_sticks; > > uint32_t tm_spare2[9]; > > siginfo_t tm_syncsig; > > ucontext_t tm_context; /* User and machine context */ > > }; > > > > struct kse_mailbox { > > uint32_t km_version; /* Mailbox version */ > > uint32_t km_flags; /* KSE flags */ > > struct kse_thr_mailbox *km_curthread; /* Currently running thread */ > > struct kse_thr_mailbox *km_completed; /* Threads back from kernel */ > > sigset_t km_sigscaught; /* Caught signals */ > > kse_func_t *km_func; /* UTS function */ > > stack_t km_stack; /* UTS context */ > > void *km_udata; /* For use by the UTS */ > > struct timespec km_timeofday; /* Time of day */ > > int32_t km_quantum; /* Upcall quantum in msecs */ > > uint32_t km_spare[8]; > > }; struct kse_mailbox { void *km_spare1[4]; /* Allocated for TLS */ uint32_t km_version; /* Mailbox version */ uint32_t km_flags; /* KSE flags */ struct kse_thr_mailbox *km_curthread; /* Currently running thread */ struct kse_thr_mailbox *km_completed; /* Threads back from kernel */ sigset_t km_sigscaught; /* Caught signals */ kse_func_t *km_func; /* UTS function */ stack_t km_stack; /* UTS context */ void *km_udata; /* For use by the UTS */ struct timespec km_timeofday; /* Time of day */ void *km_ksdaddr; /* KSE specific data address */ uint32_t km_ksdsize; /* KSE specific data size */ int32_t km_quantum; /* Upcall quantum in msecs */ uint32_t km_spare[8]; }; -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 13:26:26 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB09E37B401; Fri, 18 Jul 2003 13:26:26 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1459743FB1; Fri, 18 Jul 2003 13:26:26 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6IKQPv1070037; Fri, 18 Jul 2003 13:26:25 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6IKQPNd035039; Fri, 18 Jul 2003 13:26:25 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6IKQPgT035038; Fri, 18 Jul 2003 13:26:25 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 13:26:25 -0700 From: Marcel Moolenaar To: deischen@freebsd.org Message-ID: <20030718202625.GA34991@dhcp01.pn.xcllnt.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 20:26:27 -0000 On Fri, Jul 18, 2003 at 03:46:56PM -0400, Daniel Eischen wrote: > I took a cut at it. > > Comments, suggestions? Looks good in general. As a suggestion: On ia64 the context is 128-bit aligned due to having FP registers. I would suggest to order the structs so that both the context and sigset_t are 16-byte aligned on 64-bit platforms. Alignment of sigset_t to 16 bytes allows machines that have 16-byte atomic operations to read/write the sigset_t atomically. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 13:42:41 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B65C37B401; Fri, 18 Jul 2003 13:42:41 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4BB743F3F; Fri, 18 Jul 2003 13:42:39 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6IKg7v1070131; Fri, 18 Jul 2003 13:42:07 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6IKg7Nd035077; Fri, 18 Jul 2003 13:42:07 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6IKg6Wm035076; Fri, 18 Jul 2003 13:42:06 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 13:42:06 -0700 From: Marcel Moolenaar To: Julian Elischer Message-ID: <20030718204206.GB34991@dhcp01.pn.xcllnt.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 20:42:41 -0000 On Fri, Jul 18, 2003 at 12:52:00PM -0700, Julian Elischer wrote: > for TLS we need to ensure that the first few (actually, 1 but a couple > more can't hurt) entry in the KSE mailbox is available as a pointer to > the TLS. (on 386 at least). Marcel probablyt has more to say on the > topic. Good point. I forgot about TLS. I'll bump it up on my todo list. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 14:04:15 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43F4937B401; Fri, 18 Jul 2003 14:04:15 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D25A43F3F; Fri, 18 Jul 2003 14:04:14 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc12) with ESMTP id <2003071821041401400s6euge>; Fri, 18 Jul 2003 21:04:14 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA15332; Fri, 18 Jul 2003 14:04:10 -0700 (PDT) Date: Fri, 18 Jul 2003 14:04:08 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: <20030718204206.GB34991@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 21:04:15 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > On Fri, Jul 18, 2003 at 12:52:00PM -0700, Julian Elischer wrote: > > for TLS we need to ensure that the first few (actually, 1 but a couple > > more can't hurt) entry in the KSE mailbox is available as a pointer to > > the TLS. (on 386 at least). Marcel probablyt has more to say on the > > topic. > > Good point. I forgot about TLS. I'll bump it up on my todo list. I don't have teh TLS spec with me here.. I don't know if other architectures would make other requirements.. %gs on x86 'points' to a segment containing the KSE mailbox. I'm not sure how we'd go on other architectures.. maybe we end up doing it in reverse.. ([TLS reg]->our_kse_mbox might be a pointer to the mailbox?) > > -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net > From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 14:45:51 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B431C37B401; Fri, 18 Jul 2003 14:45:51 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA71843F3F; Fri, 18 Jul 2003 14:45:50 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6ILjHv1070461; Fri, 18 Jul 2003 14:45:17 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6ILjGNd035296; Fri, 18 Jul 2003 14:45:16 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6ILjG6n035295; Fri, 18 Jul 2003 14:45:16 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 14:45:16 -0700 From: Marcel Moolenaar To: Julian Elischer Message-ID: <20030718214516.GA35221@dhcp01.pn.xcllnt.net> References: <20030718204206.GB34991@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 21:45:52 -0000 On Fri, Jul 18, 2003 at 02:04:08PM -0700, Julian Elischer wrote: > > > On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > > > On Fri, Jul 18, 2003 at 12:52:00PM -0700, Julian Elischer wrote: > > > for TLS we need to ensure that the first few (actually, 1 but a couple > > > more can't hurt) entry in the KSE mailbox is available as a pointer to > > > the TLS. (on 386 at least). Marcel probablyt has more to say on the > > > topic. > > > > Good point. I forgot about TLS. I'll bump it up on my todo list. > > I don't have teh TLS spec with me here.. > I don't know if other architectures would make other requirements.. I'll see if I can write something up this weekend. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 15:08:50 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 301AE37B401; Fri, 18 Jul 2003 15:08:50 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F96543FCB; Fri, 18 Jul 2003 15:08:49 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc11) with ESMTP id <2003071822084801300nl6vce>; Fri, 18 Jul 2003 22:08:49 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA15763; Fri, 18 Jul 2003 15:08:42 -0700 (PDT) Date: Fri, 18 Jul 2003 15:08:40 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: <20030718214516.GA35221@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 22:08:50 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > On Fri, Jul 18, 2003 at 02:04:08PM -0700, Julian Elischer wrote: > > > > > > On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > > > > > On Fri, Jul 18, 2003 at 12:52:00PM -0700, Julian Elischer wrote: > > > > for TLS we need to ensure that the first few (actually, 1 but a couple > > > > more can't hurt) entry in the KSE mailbox is available as a pointer to > > > > the TLS. (on 386 at least). Marcel probablyt has more to say on the > > > > topic. > > > > > > Good point. I forgot about TLS. I'll bump it up on my todo list. > > > > I don't have teh TLS spec with me here.. > > I don't know if other architectures would make other requirements.. > > I'll see if I can write something up this weekend. I found a copy :-) the ia64 requires that the thread pointer points to aome location that is 16 bytes long, the first 8 bytes of which is a pointer to the TLS Dynamic thread vector, and the 2nd 8 bytes is application specific, but in practice, must be a pointer to the Thread's or KSE's mailbox (I guess KSE to be similar to the others.) ia32 requires just that the thread control info pointed to by %gs SOMEWHERE contains a pointer to the dtv (where SOMEWHERE is a known offset). (In our case the offset would be 0) This means that for the UTS to find the active thread under ia64 takes an extra level of indirection. (node neither of these affect upcalls as teh UTS upcall target function has the mailbox as an argument and can access it independently of %gs or the tp. Am I right that "variant 2" (as seen in the ia32 case) applies to allarchitectures other than ia64? julian > > -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net > From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 15:16:10 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1E5F37B404; Fri, 18 Jul 2003 15:16:10 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CF7443FE3; Fri, 18 Jul 2003 15:16:10 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <2003071822160901500bk96re>; Fri, 18 Jul 2003 22:16:09 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA15849; Fri, 18 Jul 2003 15:16:00 -0700 (PDT) Date: Fri, 18 Jul 2003 15:15:58 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 22:16:11 -0000 umm let me clean that up.... On Fri, 18 Jul 2003, Julian Elischer wrote: [...] > > The ia64 requires that the thread pointer points to > some location that is 16 bytes long, the first 8 bytes > of which is a pointer to the TLS Dynamic thread vector, and the 2nd 8 > bytes is application specific, but in practice, must be a pointer to > the Thread's or KSE's mailbox (I guess KSE to be similar to the others.) Static TLS data follows immediatly following the 16th byte. > > Ia32 requires just that the thread control info pointed to by %gs > SOMEWHERE contains a pointer to the dtv (where SOMEWHERE is a known > offset). (In our case the offset would be 0). Static TLS space preceeds the location pointed to by the tp (the %gs segment on x86). > > This means that for the UTS to find the active thread under ia64 > takes an extra level of indirection. (Note that neither of these > affect upcalls as the UTS upcall target function has the mailbox as an > argument and can access it independently of %gs or the tp). > > Am I right that "variant 2" (as seen in the ia32 case) > applies to allarchitectures other than ia64? > > julian From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 15:31:54 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1536737B401; Fri, 18 Jul 2003 15:31:54 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2832D43FAF; Fri, 18 Jul 2003 15:31:53 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6IMVJv1070718; Fri, 18 Jul 2003 15:31:19 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6IMVJNd035415; Fri, 18 Jul 2003 15:31:19 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6IMVJIo035414; Fri, 18 Jul 2003 15:31:19 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 15:31:19 -0700 From: Marcel Moolenaar To: Julian Elischer Message-ID: <20030718223119.GB35221@dhcp01.pn.xcllnt.net> References: <20030718214516.GA35221@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 22:31:54 -0000 On Fri, Jul 18, 2003 at 03:08:40PM -0700, Julian Elischer wrote: > > the ia64 requires that the thread pointer points to > aome location that is 16 bytes long, the first 8 bytes > of which is a pointer to the TLS Dynamic thread vector, and the 2nd 8 > bytes is application specific, but in practice, must be a pointer to > the Thread's or KSE's mailbox (I guess KSE to be similar to the others.) > > ia32 requires just that the thread control info pointed to by %gs > SOMEWHERE contains a pointer to the dtv (where SOMEWHERE is a known > offset). (In our case the offset would be 0) > > This means that for the UTS to find the active thread under ia64 > takes an extra level of indirection. (node neither of these > affect upcalls as teh UTS upcall target function has the mailbox as an > argument and can access it independently of %gs or the tp. > > Am I right that "variant 2" (as seen in the ia32 case) > applies to allarchitectures other than ia64? That is what I need to find out. If the runtime specification has a register dedicated for TLS, like on ia64, it will likely behave more like ia64 than ia32. I think the amd64 runtime is new enough for it to be like ia64. Note that the extra level of indirection on ia64 can be avoided if we put the thread control structure at a negative offset from TP. The layout would be something like: -... 0 8 16 ...+ [thread structure][DTV pointer][free][static TLS] ^ TP -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 15:35:15 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4D0537B401; Fri, 18 Jul 2003 15:35:15 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id B682C43FB1; Fri, 18 Jul 2003 15:35:12 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6IMYev1070738; Fri, 18 Jul 2003 15:34:40 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6IMYeNd035438; Fri, 18 Jul 2003 15:34:40 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6IMYeI6035437; Fri, 18 Jul 2003 15:34:40 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 15:34:40 -0700 From: Marcel Moolenaar To: Julian Elischer Message-ID: <20030718223440.GC35221@dhcp01.pn.xcllnt.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 22:35:16 -0000 On Fri, Jul 18, 2003 at 03:15:58PM -0700, Julian Elischer wrote: > > > > Ia32 requires just that the thread control info pointed to by %gs > > SOMEWHERE contains a pointer to the dtv (where SOMEWHERE is a known > > offset). (In our case the offset would be 0). > > Static TLS space preceeds the location pointed to by the tp (the %gs > segment on x86). I have to see this in action before I understand what it means :-) -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 15:40:17 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8714637B401 for ; Fri, 18 Jul 2003 15:40:17 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB4B043FA3 for ; Fri, 18 Jul 2003 15:40:16 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6IMe7AI018909; Fri, 18 Jul 2003 18:40:08 -0400 (EDT) Date: Fri, 18 Jul 2003 18:40:07 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030718223119.GB35221@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org cc: Julian Elischer Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 22:40:17 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > On Fri, Jul 18, 2003 at 03:08:40PM -0700, Julian Elischer wrote: > > > > the ia64 requires that the thread pointer points to > > aome location that is 16 bytes long, the first 8 bytes > > of which is a pointer to the TLS Dynamic thread vector, and the 2nd 8 > > bytes is application specific, but in practice, must be a pointer to > > the Thread's or KSE's mailbox (I guess KSE to be similar to the others.) > > > > ia32 requires just that the thread control info pointed to by %gs > > SOMEWHERE contains a pointer to the dtv (where SOMEWHERE is a known > > offset). (In our case the offset would be 0) > > > > This means that for the UTS to find the active thread under ia64 > > takes an extra level of indirection. (node neither of these > > affect upcalls as teh UTS upcall target function has the mailbox as an > > argument and can access it independently of %gs or the tp. > > > > Am I right that "variant 2" (as seen in the ia32 case) > > applies to allarchitectures other than ia64? > > That is what I need to find out. If the runtime specification has > a register dedicated for TLS, like on ia64, it will likely behave > more like ia64 than ia32. I think the amd64 runtime is new enough > for it to be like ia64. The amd64 also has a %gs which is used for this. Only the kernel can set it, though, so I think it needs to be per-KSE. > Note that the extra level of indirection on ia64 can be avoided if > we put the thread control structure at a negative offset from TP. > The layout would be something like: > > -... 0 8 16 ...+ > [thread structure][DTV pointer][free][static TLS] > ^ > TP Can we make this work so that we are not limited to 8192 (or whatever max user LDTs are) threads on i386? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 16:23:09 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17FA837B401; Fri, 18 Jul 2003 16:23:09 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 014B443F3F; Fri, 18 Jul 2003 16:23:08 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6INMVv1070925; Fri, 18 Jul 2003 16:22:31 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6INMVNd035643; Fri, 18 Jul 2003 16:22:31 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6INMULf035642; Fri, 18 Jul 2003 16:22:30 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 16:22:30 -0700 From: Marcel Moolenaar To: deischen@freebsd.org Message-ID: <20030718232230.GA35603@dhcp01.pn.xcllnt.net> References: <20030718223119.GB35221@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org cc: Julian Elischer Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 23:23:09 -0000 On Fri, Jul 18, 2003 at 06:40:07PM -0400, Daniel Eischen wrote: > > Note that the extra level of indirection on ia64 can be avoided if > > we put the thread control structure at a negative offset from TP. > > The layout would be something like: > > > > -... 0 8 16 ...+ > > [thread structure][DTV pointer][free][static TLS] > > ^ > > TP > > Can we make this work so that we are not limited to > 8192 (or whatever max user LDTs are) threads on i386? The layout may be specific to ia64. I don't think we should try to unify too much across platforms. As for the LDT limit: We could keep %gs constant and change the LDT entry on a thread switch. That way we only use 1 LDT entry... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 16:42:04 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30F3437B401; Fri, 18 Jul 2003 16:42:04 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id A123643F3F; Fri, 18 Jul 2003 16:42:03 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc12) with ESMTP id <20030718234203014002gssoe>; Fri, 18 Jul 2003 23:42:03 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA16372; Fri, 18 Jul 2003 16:41:39 -0700 (PDT) Date: Fri, 18 Jul 2003 16:41:38 -0700 (PDT) From: Julian Elischer To: Alexander Kabaev In-Reply-To: <20030718181848.414318dd.ak03@gte.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: threads@freebsd.org cc: Marcel Moolenaar Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 23:42:04 -0000 On Fri, 18 Jul 2003, Alexander Kabaev wrote: > On Fri, 18 Jul 2003 15:15:58 -0700 (PDT) > Julian Elischer wrote: > > > > Static TLS space preceeds the location pointed to by the tp (the %gs > > segment on x86). > > I wonder how this can work for multiple threads per KSE scenario. My mistake.. the 'tp' (thread pointer) on ia32 is defined as %gs:0 not %gs In other words, the thread pointer in ia32 has an extra level of indirection. The segment referred to by %gs contains the KSE mailbox and the first entry of that is the tp (thread pointer). to quote the spec: "Since the IA-32 is low on registers the thread register is encoded indirectly through the %gs segment register.. The only requirement about this register is that the actual thread pointer (tp) can be loaded from the absolute address 0 via the %gs register. The following code would load the thread poiinter in(to) the %eax register" " movl %gs:0 %eax " since in libthr %gs points to an entry in an array of pointers to thread structures, and in libkse %gs points to a kse mailbox, the first entry of which can be a pointer to the thread structure, both libraries are OK, and the static TLS storage would be allocated immediatly preceding that structure (in both cases). We could even 'fix' libc_r to set the %gs pointing to a single location and make that location always point at the current thread.. so Even that could be made to work. > > -- > Alexander Kabaev > From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 16:45:55 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3CB5837B401; Fri, 18 Jul 2003 16:45:55 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id B098643F3F; Fri, 18 Jul 2003 16:45:54 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc12) with ESMTP id <2003071823455401400s5vf1e>; Fri, 18 Jul 2003 23:45:54 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA16415; Fri, 18 Jul 2003 16:45:53 -0700 (PDT) Date: Fri, 18 Jul 2003 16:45:51 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: <20030718223119.GB35221@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 23:45:55 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > On Fri, Jul 18, 2003 at 03:08:40PM -0700, Julian Elischer wrote: > > > > the ia64 requires that the thread pointer points to > > aome location that is 16 bytes long, the first 8 bytes > > of which is a pointer to the TLS Dynamic thread vector, and the 2nd 8 > > bytes is application specific, but in practice, must be a pointer to > > the Thread's or KSE's mailbox (I guess KSE to be similar to the others.) > > > > ia32 requires just that the thread control info pointed to by %gs > > SOMEWHERE contains a pointer to the dtv (where SOMEWHERE is a known > > offset). (In our case the offset would be 0) > > > > This means that for the UTS to find the active thread under ia64 > > takes an extra level of indirection. (node neither of these > > affect upcalls as teh UTS upcall target function has the mailbox as an > > argument and can access it independently of %gs or the tp. > > > > Am I right that "variant 2" (as seen in the ia32 case) > > applies to allarchitectures other than ia64? > > That is what I need to find out. If the runtime specification has > a register dedicated for TLS, like on ia64, it will likely behave > more like ia64 than ia32. I think the amd64 runtime is new enough > for it to be like ia64. > > Note that the extra level of indirection on ia64 can be avoided if > we put the thread control structure at a negative offset from TP. > The layout would be something like: > > -... 0 8 16 ...+ > [thread structure][DTV pointer][free][static TLS] > ^ > TP Looks that way (assuming no 'gotcha's' that make the size of the thread structure unpredicatable.) > > -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net > From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 16:47:31 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6566E37B401; Fri, 18 Jul 2003 16:47:31 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id E272C43FA3; Fri, 18 Jul 2003 16:47:30 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc11) with ESMTP id <2003071823473001300mf83se>; Fri, 18 Jul 2003 23:47:30 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA16427; Fri, 18 Jul 2003 16:47:23 -0700 (PDT) Date: Fri, 18 Jul 2003 16:47:22 -0700 (PDT) From: Julian Elischer To: deischen@freebsd.org In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org cc: Marcel Moolenaar Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 23:47:31 -0000 On Fri, 18 Jul 2003, Daniel Eischen wrote: > On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > > > On Fri, Jul 18, 2003 at 03:08:40PM -0700, Julian Elischer wrote: > > > > > > the ia64 requires that the thread pointer points to > > > aome location that is 16 bytes long, the first 8 bytes > > > of which is a pointer to the TLS Dynamic thread vector, and the 2nd 8 > > > bytes is application specific, but in practice, must be a pointer to > > > the Thread's or KSE's mailbox (I guess KSE to be similar to the others.) > > > > > > ia32 requires just that the thread control info pointed to by %gs > > > SOMEWHERE contains a pointer to the dtv (where SOMEWHERE is a known > > > offset). (In our case the offset would be 0) > > > > > > This means that for the UTS to find the active thread under ia64 > > > takes an extra level of indirection. (node neither of these > > > affect upcalls as teh UTS upcall target function has the mailbox as an > > > argument and can access it independently of %gs or the tp. > > > > > > Am I right that "variant 2" (as seen in the ia32 case) > > > applies to allarchitectures other than ia64? > > > > That is what I need to find out. If the runtime specification has > > a register dedicated for TLS, like on ia64, it will likely behave > > more like ia64 than ia32. I think the amd64 runtime is new enough > > for it to be like ia64. > > The amd64 also has a %gs which is used for this. Only the > kernel can set it, though, so I think it needs to be per-KSE. > > > Note that the extra level of indirection on ia64 can be avoided if > > we put the thread control structure at a negative offset from TP. > > The layout would be something like: > > > > -... 0 8 16 ...+ > > [thread structure][DTV pointer][free][static TLS] > > ^ > > TP > > Can we make this work so that we are not limited to > 8192 (or whatever max user LDTs are) threads on i386? he's talking ia64.. > > -- > Dan Eischen > > From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 16:52:55 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 534D937B401; Fri, 18 Jul 2003 16:52:55 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE4AC43FA3; Fri, 18 Jul 2003 16:52:54 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <2003071823525401500blss1e>; Fri, 18 Jul 2003 23:52:54 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA16465; Fri, 18 Jul 2003 16:52:53 -0700 (PDT) Date: Fri, 18 Jul 2003 16:52:52 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: <20030718232230.GA35603@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 23:52:55 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > On Fri, Jul 18, 2003 at 06:40:07PM -0400, Daniel Eischen wrote: > > > Note that the extra level of indirection on ia64 can be avoided if > > > we put the thread control structure at a negative offset from TP. > > > The layout would be something like: > > > > > > -... 0 8 16 ...+ > > > [thread structure][DTV pointer][free][static TLS] > > > ^ > > > TP > > > > Can we make this work so that we are not limited to > > 8192 (or whatever max user LDTs are) threads on i386? > > The layout may be specific to ia64. I don't think we should try to > unify too much across platforms. > > As for the LDT limit: We could keep %gs constant and change the LDT > entry on a thread switch. That way we only use 1 LDT entry... That's kind of what we do.. each KSE has an LDT When we switch the thead running on that KSE we switch the pointer at the head of the KSE mailbox. Since this is NOT the pointer used by other things it doesn't have to eb done atomically. We could even put the TLS at +VE offsett from that location as it is the TLS pointer and we have no requirement (in kse) that it also be the pointer to teh Thread mailbox or thread control block. (in fact it will NOT be the pointer to the thread mailbox as THAT has to be set atomically with the context load). We'd probably keep it -ve to be compatible with libthr and libc_r for which it would be -ve. > > -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net > From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 16:54:55 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FE4D37B401; Fri, 18 Jul 2003 16:54:55 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00CD443F93; Fri, 18 Jul 2003 16:54:55 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from tiger (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with SMTP id h6INsqUp019767; Fri, 18 Jul 2003 16:54:53 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <005201c34d88$6d531bc0$0701a8c0@tiger> From: "David Xu" To: , "Marcel Moolenaar" References: Date: Sat, 19 Jul 2003 07:58:01 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 cc: threads@freebsd.org cc: Julian Elischer Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 23:54:55 -0000 ----- Original Message -----=20 From: "Daniel Eischen" To: "Marcel Moolenaar" Cc: ; "Julian Elischer" Sent: Saturday, July 19, 2003 6:40 AM Subject: Re: Rearranging kse mailbox > On Fri, 18 Jul 2003, Marcel Moolenaar wrote: >=20 > > On Fri, Jul 18, 2003 at 03:08:40PM -0700, Julian Elischer wrote: > > >=20 > > > the ia64 requires that the thread pointer points to=20 > > > aome location that is 16 bytes long, the first 8 bytes > > > of which is a pointer to the TLS Dynamic thread vector, and the = 2nd 8 > > > bytes is application specific, but in practice, must be a pointer = to > > > the Thread's or KSE's mailbox (I guess KSE to be similar to the = others.) > > >=20 > > > ia32 requires just that the thread control info pointed to by %gs > > > SOMEWHERE contains a pointer to the dtv (where SOMEWHERE is a = known > > > offset). (In our case the offset would be 0) > > >=20 > > > This means that for the UTS to find the active thread under ia64 > > > takes an extra level of indirection. (node neither of these > > > affect upcalls as teh UTS upcall target function has the mailbox = as an > > > argument and can access it independently of %gs or the tp. > > >=20 > > > Am I right that "variant 2" (as seen in the ia32 case) > > > applies to allarchitectures other than ia64? > >=20 > > That is what I need to find out. If the runtime specification has > > a register dedicated for TLS, like on ia64, it will likely behave > > more like ia64 than ia32. I think the amd64 runtime is new enough > > for it to be like ia64. >=20 > The amd64 also has a %gs which is used for this. Only the > kernel can set it, though, so I think it needs to be per-KSE. >=20 > > Note that the extra level of indirection on ia64 can be avoided if > > we put the thread control structure at a negative offset from TP. > > The layout would be something like: > >=20 > > -... 0 8 16 ...+ > > [thread structure][DTV pointer][free][static TLS] > > ^ > > TP >=20 > Can we make this work so that we are not limited to > 8192 (or whatever max user LDTs are) threads on i386? >=20 I think giving 8192 system scope thread limit on i386 might be OK. system might freeze before you reach this limit, better to use M:N thread. :-) > --=20 > Dan Eischen >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to = "freebsd-threads-unsubscribe@freebsd.org" From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 17:46:49 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82CD037B401; Fri, 18 Jul 2003 17:46:49 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBE6E43FA3; Fri, 18 Jul 2003 17:46:48 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6J0kiAI010219; Fri, 18 Jul 2003 20:46:44 -0400 (EDT) Date: Fri, 18 Jul 2003 20:46:44 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Xu In-Reply-To: <005201c34d88$6d531bc0$0701a8c0@tiger> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org cc: Julian Elischer cc: Marcel Moolenaar Subject: Re: Rearranging kse mailbox X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 00:46:49 -0000 On Sat, 19 Jul 2003, David Xu wrote: > From: "Daniel Eischen" > > > > Can we make this work so that we are not limited to > > 8192 (or whatever max user LDTs are) threads on i386? > > > > I think giving 8192 system scope thread limit on i386 > might be OK. system might freeze before you reach this > limit, better to use M:N thread. :-) No, I was worred that we would have to use the same approach for every arch (tp -> thread). That would limit us to 8192 threads in i386 regardless of scope. Julian implied this doesn't have to be the case, though. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 18:56:21 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A612A37B490 for ; Fri, 18 Jul 2003 18:56:20 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99D4143FBD for ; Fri, 18 Jul 2003 18:56:19 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J1uJv1071699 for ; Fri, 18 Jul 2003 18:56:19 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J1uENd045106 for ; Fri, 18 Jul 2003 18:56:14 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6J1uE9w045105 for threads@FreeBSD.org; Fri, 18 Jul 2003 18:56:14 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 18:56:14 -0700 From: Marcel Moolenaar To: threads@FreeBSD.org Message-ID: <20030719015614.GA45034@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Subject: TLS reference page X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 01:56:21 -0000 Ok, I have the beginnings of a TLS page here: http://people.freebsd.org/~marcel/tls.html If anyone has good suggestions of what can be added, let me know. The following is in the pipeline: o Pointer to Ulrich's TLS document. An HTML-ized version would be better. o TLS access sequences for the various platforms. o Implementation questions and answers. FYI, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 21:56:26 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FAA437B401 for ; Fri, 18 Jul 2003 21:56:26 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8FC843F93 for ; Fri, 18 Jul 2003 21:56:25 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J4uPv1072476 for ; Fri, 18 Jul 2003 21:56:25 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J4uPNd045808 for ; Fri, 18 Jul 2003 21:56:25 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6J4uPQ9045807 for threads@FreeBSD.org; Fri, 18 Jul 2003 21:56:25 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 21:56:25 -0700 From: Marcel Moolenaar To: threads@FreeBSD.org Message-ID: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Subject: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 04:56:26 -0000 Gang, A quick test with our in-tree bits revealed: o There's no compiler support for TLS on sparc64. o There's no assembler support for TLS on i386 and amd64. This means that only the toolchain on alpha and ia64 support TLS completely. FYI, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 22:02:28 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5722637B401 for ; Fri, 18 Jul 2003 22:02:28 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A11C643F3F for ; Fri, 18 Jul 2003 22:02:27 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6J52QAI023585; Sat, 19 Jul 2003 01:02:27 -0400 (EDT) Date: Sat, 19 Jul 2003 01:02:26 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 05:02:28 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > Gang, > > A quick test with our in-tree bits revealed: > > o There's no compiler support for TLS on sparc64. > o There's no assembler support for TLS on i386 and amd64. > > This means that only the toolchain on alpha and ia64 support TLS > completely. How does Linux support TLS? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 22:11:04 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7DFD37B404 for ; Fri, 18 Jul 2003 22:11:04 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9090343F93 for ; Fri, 18 Jul 2003 22:11:03 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J5B3v1072560; Fri, 18 Jul 2003 22:11:03 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J5B3Nd045866; Fri, 18 Jul 2003 22:11:03 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6J5B3EW045865; Fri, 18 Jul 2003 22:11:03 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 22:11:03 -0700 From: Marcel Moolenaar To: Daniel Eischen Message-ID: <20030719051103.GC45759@dhcp01.pn.xcllnt.net> References: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 05:11:05 -0000 On Sat, Jul 19, 2003 at 01:02:26AM -0400, Daniel Eischen wrote: > > > > A quick test with our in-tree bits revealed: > > > > o There's no compiler support for TLS on sparc64. > > o There's no assembler support for TLS on i386 and amd64. > > > > This means that only the toolchain on alpha and ia64 support TLS > > completely. > > How does Linux support TLS? What do you mean exactly? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 22:16:17 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6A7637B401 for ; Fri, 18 Jul 2003 22:16:17 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1BE643FA3 for ; Fri, 18 Jul 2003 22:16:16 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6J5GFAI025334; Sat, 19 Jul 2003 01:16:16 -0400 (EDT) Date: Sat, 19 Jul 2003 01:16:15 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030719051103.GC45759@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 05:16:18 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > On Sat, Jul 19, 2003 at 01:02:26AM -0400, Daniel Eischen wrote: > > > > > > A quick test with our in-tree bits revealed: > > > > > > o There's no compiler support for TLS on sparc64. > > > o There's no assembler support for TLS on i386 and amd64. > > > > > > This means that only the toolchain on alpha and ia64 support TLS > > > completely. > > > > How does Linux support TLS? > > What do you mean exactly? Sorry, I assumed that Linux somehow supports it from the way the NVidia guys were talking and from Ulrich's paper. Maybe they don't yet... I just wondered what toolchain they use. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 23:05:23 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B42D37B401 for ; Fri, 18 Jul 2003 23:05:23 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04D8F43FA3 for ; Fri, 18 Jul 2003 23:05:23 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <2003071906052201500bj814e>; Sat, 19 Jul 2003 06:05:22 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id XAA18932; Fri, 18 Jul 2003 23:05:18 -0700 (PDT) Date: Fri, 18 Jul 2003 23:05:16 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@FreeBSD.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 06:05:23 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > Gang, > > A quick test with our in-tree bits revealed: > > o There's no compiler support for TLS on sparc64. That's not a problem yet.. > o There's no assembler support for TLS on i386 and amd64. > that's a bummer.. Who is the 'gas' person? I don't think our assembler has been updated for ages.. > This means that only the toolchain on alpha and ia64 support TLS > completely. > > FYI, > > -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 23:35:56 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9312137B401 for ; Fri, 18 Jul 2003 23:35:56 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35FF343F3F for ; Fri, 18 Jul 2003 23:35:56 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc11) with ESMTP id <2003071906355501300evmkie>; Sat, 19 Jul 2003 06:35:55 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id XAA19135; Fri, 18 Jul 2003 23:35:55 -0700 (PDT) Date: Fri, 18 Jul 2003 23:35:53 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@FreeBSD.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 06:35:56 -0000 On Fri, 18 Jul 2003, Julian Elischer wrote: > > > I don't think our assembler has been updated for ages.. oops.. looking again, I think it HAS been updates recently... drat.. From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 23:42:42 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0847B37B401 for ; Fri, 18 Jul 2003 23:42:42 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34EC143F93 for ; Fri, 18 Jul 2003 23:42:41 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J6g5v1073002; Fri, 18 Jul 2003 23:42:05 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J6g5Nd046201; Fri, 18 Jul 2003 23:42:05 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6J6g5cb046200; Fri, 18 Jul 2003 23:42:05 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 23:42:05 -0700 From: Marcel Moolenaar To: Julian Elischer Message-ID: <20030719064205.GA46175@dhcp01.pn.xcllnt.net> References: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@FreeBSD.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 06:42:42 -0000 On Fri, Jul 18, 2003 at 11:05:16PM -0700, Julian Elischer wrote: > > > On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > > > Gang, > > > > A quick test with our in-tree bits revealed: > > > > o There's no compiler support for TLS on sparc64. > That's not a problem yet.. I just noticed that alpha also doesn't have TLS support. The compiler does not complain when it encounters the __thread keyword, but the access sequences for both static and dynamic TLS are no different from access sequences for (regular) global data. > > o There's no assembler support for TLS on i386 and amd64. > > > > that's a bummer.. Who is the 'gas' person? obrien@ > I don't think our assembler has been updated for ages.. It's probably a good idea to upgrade binutils for other reasons as well. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 23:53:39 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4151137B401; Fri, 18 Jul 2003 23:53:39 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 604FB43FDD; Fri, 18 Jul 2003 23:53:38 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J6rbv1073054; Fri, 18 Jul 2003 23:53:38 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6J6rbNd046252; Fri, 18 Jul 2003 23:53:37 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6J6rbTk046251; Fri, 18 Jul 2003 23:53:37 -0700 (PDT) (envelope-from marcel) Date: Fri, 18 Jul 2003 23:53:37 -0700 From: Marcel Moolenaar To: deischen@freebsd.org Message-ID: <20030719065337.GB46175@dhcp01.pn.xcllnt.net> References: <20030719051103.GC45759@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 06:53:39 -0000 On Sat, Jul 19, 2003 at 01:16:15AM -0400, Daniel Eischen wrote: > On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > > > On Sat, Jul 19, 2003 at 01:02:26AM -0400, Daniel Eischen wrote: > > > > > > > > A quick test with our in-tree bits revealed: > > > > > > > > o There's no compiler support for TLS on sparc64. > > > > o There's no assembler support for TLS on i386 and amd64. > > > > > > > > This means that only the toolchain on alpha and ia64 support TLS > > > > completely. > > > > > > How does Linux support TLS? > > > > What do you mean exactly? > > Sorry, I assumed that Linux somehow supports it from the > way the NVidia guys were talking and from Ulrich's paper. > Maybe they don't yet... I just wondered what toolchain > they use. RedHat 8.0 has gcc 3.2 and binutils 2.13.90.0.2. TLS works. Our gcc emits slightly different assembly that's not understood by our assembler. The assembler shipped with RH 8 also doesn't understand the assembly emitted by our compiler: static.s: Assembler messages: static.s:2: Warning: rest of line ignored; first ignored character is `%' static.s:5: Error: unrecognized symbol type "li" static.s:5: Warning: rest of line ignored; first ignored character is `,' static.s:6: Error: expected comma after name `' in .size directive static.s:6: Warning: rest of line ignored; first ignored character is `%' static.s:7: Warning: rest of line ignored; first ignored character is `%' static.s:17: Error: bad register name `%li@NTPOFF(%eax)' -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Sat Jul 19 05:12:45 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE56637B401 for ; Sat, 19 Jul 2003 05:12:45 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48C5643F85 for ; Sat, 19 Jul 2003 05:12:44 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from PETEX31 (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with SMTP id h6JCCgsL045393 for ; Sat, 19 Jul 2003 15:12:42 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <001c01c34def$0e410310$812a40c1@PETEX31> From: "Petri Helenius" To: Date: Sat, 19 Jul 2003 15:12:41 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: setschedparam X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 12:12:46 -0000 Just to make sure, since the documentation fails to mention it, larger numbers mean higher priority? Pete From owner-freebsd-threads@FreeBSD.ORG Sat Jul 19 06:54:11 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DDDC437B401 for ; Sat, 19 Jul 2003 06:54:11 -0700 (PDT) Received: from mx8.mail.ru (mx8.mail.ru [194.67.23.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05EB343F85 for ; Sat, 19 Jul 2003 06:54:11 -0700 (PDT) (envelope-from kabaev@mail.ru) Received: from [141.154.214.7] (port=50287 helo=kan.dnsalias.net) by mx8.mail.ru with esmtp id 19dsA5-000KJN-00; Sat, 19 Jul 2003 17:54:09 +0400 Received: from kan.dnsalias.net (ak03@localhost [127.0.0.1]) by kan.dnsalias.net (8.12.9/8.12.9) with ESMTP id h6JDs7Tw003347; Sat, 19 Jul 2003 09:54:07 -0400 (EDT) (envelope-from kan@kan.dnsalias.net) Received: (from kan@localhost) by kan.dnsalias.net (8.12.9/8.12.9/Submit) id h6JDs6Tk003346; Sat, 19 Jul 2003 09:54:06 -0400 (EDT) Date: Sat, 19 Jul 2003 09:54:06 -0400 From: Alexander Kabaev To: Marcel Moolenaar Message-Id: <20030719095406.02c51beb.kabaev@mail.ru> In-Reply-To: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> References: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> X-Mailer: Sylpheed version 0.9.0claws50 (GTK+ 1.2.10; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: Not detected cc: threads@freebsd.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 13:54:12 -0000 On Fri, 18 Jul 2003 21:56:25 -0700 Marcel Moolenaar wrote: > Gang, > > A quick test with our in-tree bits revealed: > > o There's no compiler support for TLS on sparc64. This might be, need to test. > o There's no assembler support for TLS on i386 and amd64. amd64 is new and TLS is probably not activated enabled in binutils yet. i386 assebmly thing: what do you mean? % cat test.c .section ".tdata","awT",@progbits foo: .long 25 .text movl %gs:0, %eax leal foo@TLSGD(,%ebx,1), %eax leal foo@TLSLDM(%ebx), %eax leal foo@DTPOFF(%eax), %edx movl foo@GOTTPOFF(%ebx), %eax subl foo@GOTTPOFF(%ebx), %eax addl foo@GOTNTPOFF(%ebx), %eax movl foo@INDNTPOFF, %eax movl $foo@TPOFF, %eax subl $foo@TPOFF, %eax leal foo@NTPOFF(%ecx), %eax % as test.s % > This means that only the toolchain on alpha and ia64 support TLS > completely. > > FYI, > > -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to > "freebsd-threads-unsubscribe@freebsd.org" From owner-freebsd-threads@FreeBSD.ORG Sat Jul 19 08:38:17 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C901137B401 for ; Sat, 19 Jul 2003 08:38:17 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B84D43F75 for ; Sat, 19 Jul 2003 08:38:17 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6JFcFAI018949; Sat, 19 Jul 2003 11:38:15 -0400 (EDT) Date: Sat, 19 Jul 2003 11:38:15 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Petri Helenius In-Reply-To: <001c01c34def$0e410310$812a40c1@PETEX31> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: setschedparam X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 15:38:18 -0000 On Sat, 19 Jul 2003, Petri Helenius wrote: > Just to make sure, since the documentation fails to mention it, larger numbers > mean higher priority? Yes. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat Jul 19 09:24:08 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B909937B404 for ; Sat, 19 Jul 2003 09:24:08 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7032B43FA3 for ; Sat, 19 Jul 2003 09:24:07 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6JGO7v1078414; Sat, 19 Jul 2003 09:24:07 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6JGO6L1016809; Sat, 19 Jul 2003 09:24:06 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6JGO6vV016808; Sat, 19 Jul 2003 09:24:06 -0700 (PDT) (envelope-from marcel) Date: Sat, 19 Jul 2003 09:24:06 -0700 From: Marcel Moolenaar To: Alexander Kabaev Message-ID: <20030719162406.GA16766@dhcp01.pn.xcllnt.net> References: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> <20030719095406.02c51beb.kabaev@mail.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030719095406.02c51beb.kabaev@mail.ru> User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 16:24:09 -0000 On Sat, Jul 19, 2003 at 09:54:06AM -0400, Alexander Kabaev wrote: > > > o There's no assembler support for TLS on i386 and amd64. > > amd64 is new and TLS is probably not activated enabled in binutils yet. > > i386 assebmly thing: what do you mean? > > % cat test.c > .section ".tdata","awT",@progbits > foo: .long 25 > .text > movl %gs:0, %eax > leal foo@TLSGD(,%ebx,1), %eax > leal foo@TLSLDM(%ebx), %eax > leal foo@DTPOFF(%eax), %edx > movl foo@GOTTPOFF(%ebx), %eax > subl foo@GOTTPOFF(%ebx), %eax > addl foo@GOTNTPOFF(%ebx), %eax > movl foo@INDNTPOFF, %eax > movl $foo@TPOFF, %eax > subl $foo@TPOFF, %eax > leal foo@NTPOFF(%ecx), %eax Our in-tree compiler emits assembly that our assembler doesn't like. Given the following C program: \begin{c} int __thread i = 3; int x() { return i; } \end{c} Our compiler emits: \begin{as} .file "t.c" .globl %li .section .tdata,"awT",@progbits .p2align 2 .type %li, @object .size %li, 4 %li: .long 3 .text .p2align 2,,3 .globl x .type x, @function x: pushl %ebp movl %esp, %ebp movl %gs:0, %eax movl %li@NTPOFF(%eax), %eax leave ret .size x, .-x .ident "GCC: (GNU) 3.3.1 [FreeBSD] 20030711 (prerelease)" \end{as} And the assembler does not like that: /var/tmp//ccVMU4H6.s: Assembler messages: /var/tmp//ccVMU4H6.s:2: Warning: rest of line ignored; first ignored character is `%' /var/tmp//ccVMU4H6.s:5: Error: unrecognized symbol type "li" /var/tmp//ccVMU4H6.s:5: Warning: rest of line ignored; first ignored character is `,' /var/tmp//ccVMU4H6.s:6: Error: expected comma after name `' in .size directive /var/tmp//ccVMU4H6.s:6: Warning: rest of line ignored; first ignored character is `%' /var/tmp//ccVMU4H6.s:7: Warning: rest of line ignored; first ignored character is `%' /var/tmp//ccVMU4H6.s:17: Error: bad register name `%li@NTPOFF(%eax)' It's probably just the %l and %G prefix, but it makes the use of the __thread keyword rather pointless at this time. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Sat Jul 19 12:20:03 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87C5A37B404 for ; Sat, 19 Jul 2003 12:20:03 -0700 (PDT) Received: from mx7.mail.ru (mx7.mail.ru [194.67.23.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87D2E43F75 for ; Sat, 19 Jul 2003 12:20:02 -0700 (PDT) (envelope-from kabaev@mail.ru) Received: from [141.154.214.7] (port=51479 helo=kan.dnsalias.net) by mx7.mail.ru with esmtp id 19dxFR-0001Fr-00; Sat, 19 Jul 2003 23:20:01 +0400 Received: from kan.dnsalias.net (ak03@localhost [127.0.0.1]) by kan.dnsalias.net (8.12.9/8.12.9) with ESMTP id h6JJJxTw016000; Sat, 19 Jul 2003 15:19:59 -0400 (EDT) (envelope-from kan@kan.dnsalias.net) Received: (from kan@localhost) by kan.dnsalias.net (8.12.9/8.12.9/Submit) id h6JJJwUd015999; Sat, 19 Jul 2003 15:19:58 -0400 (EDT) Date: Sat, 19 Jul 2003 15:19:58 -0400 From: Alexander Kabaev To: Marcel Moolenaar Message-Id: <20030719151958.6cdeb7eb.kabaev@mail.ru> In-Reply-To: <20030719162406.GA16766@dhcp01.pn.xcllnt.net> References: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> <20030719095406.02c51beb.kabaev@mail.ru> <20030719162406.GA16766@dhcp01.pn.xcllnt.net> X-Mailer: Sylpheed version 0.9.0claws50 (GTK+ 1.2.10; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: Not detected cc: threads@freebsd.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 19:20:03 -0000 Um, the July 7h snapshot of GCC 3.3.1 from ports does not generate these %{Gl} prefixes. This might be something I missed during import or it is possible that they did indeed modify compiler in the very recent future. I'll tell you what it is later. Stick with the ports compiler until then. I talked to David and he agreed to import new binutils for us in about two weeks from now. -- Alexander Kabaev From owner-freebsd-threads@FreeBSD.ORG Sat Jul 19 12:33:26 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E1A537B401 for ; Sat, 19 Jul 2003 12:33:26 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6855043FBD for ; Sat, 19 Jul 2003 12:33:25 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6JJXPv1079237; Sat, 19 Jul 2003 12:33:25 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6JJXOL1017498; Sat, 19 Jul 2003 12:33:24 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6JJXOsZ017497; Sat, 19 Jul 2003 12:33:24 -0700 (PDT) (envelope-from marcel) Date: Sat, 19 Jul 2003 12:33:24 -0700 From: Marcel Moolenaar To: Alexander Kabaev Message-ID: <20030719193324.GA17449@dhcp01.pn.xcllnt.net> References: <20030719045625.GB45759@dhcp01.pn.xcllnt.net> <20030719095406.02c51beb.kabaev@mail.ru> <20030719162406.GA16766@dhcp01.pn.xcllnt.net> <20030719151958.6cdeb7eb.kabaev@mail.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030719151958.6cdeb7eb.kabaev@mail.ru> User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: Some more on TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2003 19:33:26 -0000 On Sat, Jul 19, 2003 at 03:19:58PM -0400, Alexander Kabaev wrote: > Um, the July 7h snapshot of GCC 3.3.1 from ports does not generate > these %{Gl} prefixes. This might be something I missed during import or > it is possible that they did indeed modify compiler in the very recent > future. I'll tell you what it is later. Ok. Don't rule out a compiler bug. I cannot find any justification for the prefixes myself. > Stick with the ports compiler until then. No need. I have ia64 :-) > I talked to David and he agreed to import new binutils for us in about > two weeks from now. Top! -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net