From owner-freebsd-threads@FreeBSD.ORG Sun Feb 8 09:56:33 2004 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 5D3AB16A4CE for ; Sun, 8 Feb 2004 09:56:33 -0800 (PST) Received: from blake.polstra.com (blake.polstra.com [64.81.189.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E74543D1D for ; Sun, 8 Feb 2004 09:56:33 -0800 (PST) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (dsl081-189-067.sea1.dsl.speakeasy.net [64.81.189.67]) by blake.polstra.com (8.12.9p2/8.12.9) with ESMTP id i18HuW08051195; Sun, 8 Feb 2004 09:56:32 -0800 (PST) (envelope-from jdp@polstra.com) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Sun, 08 Feb 2004 09:56:32 -0800 (PST) From: John Polstra To: Daniel Eischen X-Bogosity: No, tests=bogofilter, spamicity=0.310402, version=0.14.5 cc: freebsd-threads@freebsd.org Subject: Re: bin/31661: pthread_kill signal handler doesn't get sigcontext or ucontext 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, 08 Feb 2004 17:56:33 -0000 On 06-Feb-2004 Daniel Eischen wrote: > Well, we are implementing POSIX API's so if there is an existing > standard for pthread_get_suspended_thread_context(), we'll add it. Thanks -- that's perfectly reasonable. I don't think there's anything standard, though -- this is all outside of what POSIX has standardized. > Or if there is some de-facto standard that other vendors seem to be > implementing we can do that. I've even made the offer to the -java > folks to add whatever they need to get the JDK to work, and so far > all they really needed was suspend/resume and a way to get thread > attributes (stack). That's more than generous. I've thought about what Modula-3 would need. It's essentially just like getcontext() but targeted at a different thread. The target thread would always be suspended, and that could be a requirement. If I get around to porting the M3 threads to using native FreeBSD threads before M3 becomes totally irrelevant, I'll be happy to do the kernel portion of this work. I just hope we're not supporting another half-dozen architectures by that time. :-} John From owner-freebsd-threads@FreeBSD.ORG Mon Feb 9 11:01:40 2004 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 B4BFD16A4D0 for ; Mon, 9 Feb 2004 11:01:40 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B6E943D1D for ; Mon, 9 Feb 2004 11:01:40 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) i19J1ebv083188 for ; Mon, 9 Feb 2004 11:01:40 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i19J1dou083182 for freebsd-threads@freebsd.org; Mon, 9 Feb 2004 11:01:39 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 9 Feb 2004 11:01:39 -0800 (PST) Message-Id: <200402091901.i19J1dou083182@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-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, 09 Feb 2004 19:01:40 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything o [2002/01/16] kern/33951 threads pthread_cancel is ignored 2 problems total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/07/18] kern/20016 threads pthreads: Cannot set scheduling timer/Can o [2000/08/26] misc/20861 threads libc_r does not honor socket timeouts o [2001/01/19] bin/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] bin/24632 threads libc_r delicate deviation from libc in ha o [2001/01/25] misc/24641 threads pthread_rwlock_rdlock can deadlock o [2001/04/02] bin/26307 threads libc_r aborts when using the KDE media pl o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/02/01] i386/34536 threads accept() blocks other threads o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/06/27] bin/39922 threads [PATCH?] Threaded applications executed w o [2002/08/04] misc/41331 threads Pthread library open sets O_NONBLOCK flag o [2003/03/02] bin/48856 threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] bin/49087 threads Signals lost in programs linked with libc a [2003/04/08] bin/50733 threads buildworld won't build, because of linkin o [2003/05/07] bin/51949 threads thread in accept cannot be cancelled 15 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/05/25] misc/18824 threads gethostbyname is not thread safe o [2000/10/21] misc/22190 threads A threaded read(2) from a socketpair(2) f o [2001/09/09] bin/30464 threads pthread mutex attributes -- pshared o [2002/05/02] bin/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwri o [2002/07/16] misc/40671 threads pthread_cancel doesn't remove thread from 5 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Feb 9 13:43:27 2004 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 E9A3316A4CE for ; Mon, 9 Feb 2004 13:43:27 -0800 (PST) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4BCF43D1F for ; Mon, 9 Feb 2004 13:43:27 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 23683 invoked from network); 9 Feb 2004 21:43:27 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 9 Feb 2004 21:43:27 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i19LhNM0082412 for ; Mon, 9 Feb 2004 16:43:24 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: threads@FreeBSD.org Date: Mon, 9 Feb 2004 16:41:37 -0500 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402091641.37061.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) Subject: TDF_INTERRUPT 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, 09 Feb 2004 21:43:28 -0000 Is there a specific reason that this flag isn't cleared after being checked in msleep(), cv_wait_sig(), and cv_timedwait_sig() or is it just a bug? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-threads@FreeBSD.ORG Mon Feb 9 14:09:53 2004 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 3EFDE16A4CE; Mon, 9 Feb 2004 14:09:53 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9BA743D1D; Mon, 9 Feb 2004 14:09:52 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc12) with ESMTP id <200402092209510120089hh9e>; Mon, 9 Feb 2004 22:09:52 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA71228; Mon, 9 Feb 2004 14:09:50 -0800 (PST) Date: Mon, 9 Feb 2004 14:09:49 -0800 (PST) From: Julian Elischer To: John Baldwin In-Reply-To: <200402091641.37061.jhb@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@FreeBSD.org Subject: Re: TDF_INTERRUPT 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, 09 Feb 2004 22:09:53 -0000 This is david's code but I would assume that the flag is not cleared until the signal is actually deliverred which would probably occur more towards the user/kernel boundary.. (This is not a definative answer). julian (looking at the code now). From owner-freebsd-threads@FreeBSD.ORG Mon Feb 9 14:24:43 2004 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 327D016A4CE; Mon, 9 Feb 2004 14:24:43 -0800 (PST) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB67543D1D; Mon, 9 Feb 2004 14:24:42 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc13) with ESMTP id <2004020922244101600fdiube>; Mon, 9 Feb 2004 22:24: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 OAA71337; Mon, 9 Feb 2004 14:24:40 -0800 (PST) Date: Mon, 9 Feb 2004 14:24:39 -0800 (PST) From: Julian Elischer To: John Baldwin In-Reply-To: <200402091641.37061.jhb@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@FreeBSD.org Subject: Re: TDF_INTERRUPT 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, 09 Feb 2004 22:24:43 -0000 looking at: http://snapshots.jp.freebsd.org/tour/current/kernel/R/47434.html I see: 184 kern/subr_trap.c TDF_NEEDRESCHED | TDF_OWEUPC | TDF_INTERRUPT); and 445 kern/kern_thread.c td2->td_flags &= ~TDF_INTERRUPT; I think this is right.. the flag is not removed until the signal is deliverred.. On Mon, 9 Feb 2004, John Baldwin wrote: > Is there a specific reason that this flag isn't cleared after being checked in > msleep(), cv_wait_sig(), and cv_timedwait_sig() or is it just a bug? > > -- > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve" = http://www.FreeBSD.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 Mon Feb 9 14:43:31 2004 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 8145316A4CE; Mon, 9 Feb 2004 14:43:31 -0800 (PST) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36F6D43D2F; Mon, 9 Feb 2004 14:43:31 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <2004020922433001100t64e7e>; Mon, 9 Feb 2004 22:43: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 OAA71495; Mon, 9 Feb 2004 14:43:27 -0800 (PST) Date: Mon, 9 Feb 2004 14:43:26 -0800 (PST) From: Julian Elischer To: John Baldwin In-Reply-To: <200402091641.37061.jhb@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@FreeBSD.org Subject: Re: TDF_INTERRUPT 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, 09 Feb 2004 22:43:31 -0000 BTW does anyone know what happenned to TDI_EXITING? it's used by TD_SET_EXITING() which I take it, must be no-longer used :-/ On Mon, 9 Feb 2004, John Baldwin wrote: > Is there a specific reason that this flag isn't cleared after being checked in > msleep(), cv_wait_sig(), and cv_timedwait_sig() or is it just a bug? > > -- > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve" = http://www.FreeBSD.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 Mon Feb 9 15:39:20 2004 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 9B88816A4CE; Mon, 9 Feb 2004 15:39:20 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93E0743D1F; Mon, 9 Feb 2004 15:39:20 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Received: from viatech.com.cn (davidxu@localhost [127.0.0.1]) i19NdIbv028495; Mon, 9 Feb 2004 15:39:19 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Message-ID: <40281AC5.1040608@viatech.com.cn> Date: Tue, 10 Feb 2004 07:41:57 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031206 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Julian Elischer References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: threads@FreeBSD.org cc: John Baldwin Subject: Re: TDF_INTERRUPT 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, 09 Feb 2004 23:39:20 -0000 Julian Elischer wrote: >This is david's code but I would assume that the flag is not cleared >until the signal is actually deliverred >which would probably occur more towards the user/kernel >boundary.. > >(This is not a definative answer). > >julian (looking at the code now). > > > You are right, it acts as a signal, signal is only removed at user boundary. > >_______________________________________________ >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 Feb 9 21:31:36 2004 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9ACFA16A4CE; Mon, 9 Feb 2004 21:31:36 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F58743D1F; Mon, 9 Feb 2004 21:31:36 -0800 (PST) (envelope-from deischen@FreeBSD.org) Received: from freefall.freebsd.org (deischen@localhost [127.0.0.1]) i1A5Vabv078885; Mon, 9 Feb 2004 21:31:36 -0800 (PST) (envelope-from deischen@freefall.freebsd.org) Received: (from deischen@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1A5VZHp078881; Mon, 9 Feb 2004 21:31:36 -0800 (PST) (envelope-from deischen) Date: Mon, 9 Feb 2004 21:31:36 -0800 (PST) From: Daniel Eischen Message-Id: <200402100531.i1A5VZHp078881@freefall.freebsd.org> To: tege@swox.se, deischen@FreeBSD.org, freebsd-threads@FreeBSD.org Subject: Re: kern/33951: pthread_cancel is ignored 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, 10 Feb 2004 05:31:36 -0000 Synopsis: pthread_cancel is ignored State-Changed-From-To: open->closed State-Changed-By: deischen State-Changed-When: Mon Feb 9 21:30:56 PST 2004 State-Changed-Why: This works under -current with libpthread and supposedly under -stable with -lc_r. http://www.freebsd.org/cgi/query-pr.cgi?pr=33951 From owner-freebsd-threads@FreeBSD.ORG Mon Feb 9 22:29:26 2004 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 2B4C016A4CE; Mon, 9 Feb 2004 22:29:26 -0800 (PST) Received: from exchhz01.viatech.com.cn (ip-40-162-97-218.anlai.com [218.97.162.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF53D43D1F; Mon, 9 Feb 2004 22:29:14 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (DAVIDWNT [10.4.1.99]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id DDRC30QF; Tue, 10 Feb 2004 14:06:05 +0800 Message-ID: <40287A33.9050008@freebsd.org> Date: Tue, 10 Feb 2004 14:29:07 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: <200402100531.i1A5VZHp078881@freefall.freebsd.org> In-Reply-To: <200402100531.i1A5VZHp078881@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: tege@swox.se cc: freebsd-threads@FreeBSD.org Subject: Re: kern/33951: pthread_cancel is ignored 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, 10 Feb 2004 06:29:26 -0000 Daniel Eischen wrote: >Synopsis: pthread_cancel is ignored > >State-Changed-From-To: open->closed >State-Changed-By: deischen >State-Changed-When: Mon Feb 9 21:30:56 PST 2004 >State-Changed-Why: >This works under -current with libpthread and supposedly >under -stable with -lc_r. > >http://www.freebsd.org/cgi/query-pr.cgi?pr=33951 >_______________________________________________ >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" > > > > I had enabled asynchornous cancelling for M:N thread in libkse but not 1:1 thread, simplest way to support asynchronous cancelling for 1:1 is to use signal, but it will occupy a signal like Linux's SIGUSR1, another way is to use upcall, but it is slight complicated. David Xu From owner-freebsd-threads@FreeBSD.ORG Mon Feb 9 23:33:21 2004 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 B551216A4CE; Mon, 9 Feb 2004 23:33:21 -0800 (PST) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BD8043D1F; Mon, 9 Feb 2004 23:33:21 -0800 (PST) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by rms04.rommon.net (8.12.9p1/8.12.9) with ESMTP id i1A7XIcM063255; Tue, 10 Feb 2004 09:33:18 +0200 (EET) (envelope-from pete@he.iki.fi) Message-ID: <40288901.7030306@he.iki.fi> Date: Tue, 10 Feb 2004 09:32:17 +0200 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <200402100531.i1A5VZHp078881@freefall.freebsd.org> <40287A33.9050008@freebsd.org> In-Reply-To: <40287A33.9050008@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Daniel Eischen cc: tege@swox.se cc: freebsd-threads@freebsd.org Subject: Re: kern/33951: pthread_cancel is ignored 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, 10 Feb 2004 07:33:21 -0000 David Xu wrote: >> > I had enabled asynchornous cancelling for M:N thread in libkse but not > 1:1 thread, > simplest way to support asynchronous cancelling for 1:1 is to use > signal, but it will > occupy a signal like Linux's SIGUSR1, another way is to use upcall, > but it is > slight complicated. > One of the features I dislike with linuxthreads is that it eats one of the two USR signals. It complicates things like debugging because then you have to read files instead of just using one signal to set debug=0 and the other to debug++. Pete From owner-freebsd-threads@FreeBSD.ORG Mon Feb 9 23:39:46 2004 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 B4ABC16A4CE for ; Mon, 9 Feb 2004 23:39:46 -0800 (PST) Received: from digitalme.com (pop.digitalme.com [193.97.97.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8A9B43D1F for ; Mon, 9 Feb 2004 23:39:46 -0800 (PST) (envelope-from dkt@digitalme.com) Received: from dkt [210.0.207.157] by digitalme.com with NIMS ModWeb Module; Tue, 10 Feb 2004 15:39:41 +0800 From: Dung Patrick To: freebsd-threads@freebsd.org, Date: Tue, 10 Feb 2004 15:39:41 +0800 X-Mailer: NIMS ModWeb Module X-Sender: dkt MIME-Version: 1.0 Message-ID: <1076398781.b793f9a0dkt@digitalme.com> Content-Type: text/plain; charset="BIG5" Content-Transfer-Encoding: quoted-printable Subject: Question about threads [beaver challenge] 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, 10 Feb 2004 07:39:46 -0000 Hi, we are using FreeBSD 5.2p2, with a Dual P4 Xeon. There are some questions: 1a) Is it stable to use KSE with mySQL? 1b) It is true that LinuxThreads with mySQL is faster than libc_r? 2) Should HTT be used or just plain SMP? 3) Should ULE be used over 4BSD? 4) What are these options, and their effect: kern.threads.max_threads_per_proc kern.threads.max_groups_per_proc kern.threads.max_threads_hits Regards Patrick From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 00:23:23 2004 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 46A9016A4CE for ; Tue, 10 Feb 2004 00:23:23 -0800 (PST) Received: from lakemtao05.cox.net (lakemtao05.cox.net [68.1.17.116]) by mx1.FreeBSD.org (Postfix) with ESMTP id C581843D1D for ; Tue, 10 Feb 2004 00:23:22 -0800 (PST) (envelope-from mezz7@cox.net) Received: from mezz.mezzweb.com ([68.103.32.11]) by lakemtao05.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040210082321.RWLI29834.lakemtao05.cox.net@mezz.mezzweb.com>; Tue, 10 Feb 2004 03:23:21 -0500 Date: Tue, 10 Feb 2004 02:22:17 -0600 To: Dung Patrick References: <1076398781.b793f9a0dkt@digitalme.com> From: Jeremy Messenger Content-Type: text/plain; format=flowed; charset=iso-8859-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <1076398781.b793f9a0dkt@digitalme.com> User-Agent: Opera7.23/Linux M2 build 518 cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 08:23:23 -0000 On Tue, 10 Feb 2004 15:39:41 +0800, Dung Patrick wrote: > Hi, we are using FreeBSD 5.2p2, with a Dual P4 Xeon. I personal think you should go for 5.2-CURRENT; not 5.2(.1)-RELEASE branch. -CURRENT is faster in my benchmark test, of course with the disable debug and malloc.conf->aj. There are few performance optimizations that committed in -CURRENT after 5.2 released. Cheers, Mezz > There are some questions: > > 1a) Is it stable to use KSE with mySQL? > 1b) It is true that LinuxThreads with mySQL is faster than libc_r? > 2) Should HTT be used or just plain SMP? > 3) Should ULE be used over 4BSD? > 4) What are these options, and their effect: > kern.threads.max_threads_per_proc > kern.threads.max_groups_per_proc > kern.threads.max_threads_hits > > Regards > Patrick -- bsdforums.org 's moderator, mezz. From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 06:53:44 2004 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 6421F16A4CE; Tue, 10 Feb 2004 06:53:44 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 224E143D1F; Tue, 10 Feb 2004 06:53:44 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1AErgfo017272; Tue, 10 Feb 2004 09:53:43 -0500 (EST) Date: Tue, 10 Feb 2004 09:53:42 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Xu In-Reply-To: <40287A33.9050008@freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: tege@swox.se cc: freebsd-threads@freebsd.org Subject: Re: kern/33951: pthread_cancel is ignored 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, 10 Feb 2004 14:53:44 -0000 On Tue, 10 Feb 2004, David Xu wrote: > Daniel Eischen wrote: > > >Synopsis: pthread_cancel is ignored > > > >State-Changed-From-To: open->closed > >State-Changed-By: deischen > >State-Changed-When: Mon Feb 9 21:30:56 PST 2004 > >State-Changed-Why: > >This works under -current with libpthread and supposedly > >under -stable with -lc_r. > > > >http://www.freebsd.org/cgi/query-pr.cgi?pr=33951 > >_______________________________________________ > >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" > > > > > > > > > I had enabled asynchornous cancelling for M:N thread in libkse but not > 1:1 thread, > simplest way to support asynchronous cancelling for 1:1 is to use > signal, but it will > occupy a signal like Linux's SIGUSR1, another way is to use upcall, > but it is > slight complicated. An upcall would be nice since it wouldn' use a signal. It could be treated like a signal where you push it on the thread's stack but use the upcall function instead of a signal handling function. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 08:54:21 2004 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 9C18816A4CE for ; Tue, 10 Feb 2004 08:54:21 -0800 (PST) Received: from mail.asn.net (mail.asn.net [66.235.231.4]) by mx1.FreeBSD.org (Postfix) with SMTP id 87D1443D1D for ; Tue, 10 Feb 2004 08:54:21 -0800 (PST) (envelope-from kris-fbsd@asn.net) Received: (qmail 88045 invoked by uid 80); 10 Feb 2004 16:54:21 -0000 Received: from 68.3.131.72 (SquirrelMail authenticated user kgale) by mail.asn.net with HTTP; Tue, 10 Feb 2004 09:54:21 -0700 (MST) Message-ID: <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> In-Reply-To: <1076398781.b793f9a0dkt@digitalme.com> References: <1076398781.b793f9a0dkt@digitalme.com> Date: Tue, 10 Feb 2004 09:54:21 -0700 (MST) From: "Kris Gale" To: freebsd-threads@freebsd.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 16:54:21 -0000 > 1a) Is it stable to use KSE with mySQL? Not in my experience. http://lists.freebsd.org/pipermail/freebsd-threads/2004-February/001568.html Kris Gale From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 11:32:34 2004 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 717BB16A4CF for ; Tue, 10 Feb 2004 11:32:34 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 692A043D31 for ; Tue, 10 Feb 2004 11:32:34 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (rwcrmhc13) with ESMTP id <2004021019323201500jq4s3e>; Tue, 10 Feb 2004 19:32:33 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i1AJWfhd047406; Tue, 10 Feb 2004 14:32:41 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i1AJWe2V047405; Tue, 10 Feb 2004 14:32:40 -0500 (EST) (envelope-from rodrigc) Date: Tue, 10 Feb 2004 14:32:40 -0500 From: Craig Rodrigues To: Kris Gale Message-ID: <20040210193240.GA47392@crodrigues.org> References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> User-Agent: Mutt/1.4.1i cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 19:32:34 -0000 On Tue, Feb 10, 2004 at 09:54:21AM -0700, Kris Gale wrote: > > 1a) Is it stable to use KSE with mySQL? > > Not in my experience. > http://lists.freebsd.org/pipermail/freebsd-threads/2004-February/001568.html How did you compile and configure MySQL with KSE? Did you build it from ports? If so, what version? What configuration did you use? How big were the tables that you used? How many queries did you hit the database with? -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 12:02:48 2004 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 51D0216A4CE for ; Tue, 10 Feb 2004 12:02:48 -0800 (PST) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA60243D1D for ; Tue, 10 Feb 2004 12:02:47 -0800 (PST) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by rms04.rommon.net (8.12.9p1/8.12.9) with ESMTP id i1AK2OcM065327; Tue, 10 Feb 2004 22:02:28 +0200 (EET) (envelope-from pete@he.iki.fi) Message-ID: <40293892.9070607@he.iki.fi> Date: Tue, 10 Feb 2004 22:01:22 +0200 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Craig Rodrigues References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> <20040210193240.GA47392@crodrigues.org> In-Reply-To: <20040210193240.GA47392@crodrigues.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 20:02:48 -0000 Craig Rodrigues wrote: >How did you compile and configure MySQL with KSE? > > > I just did build it out of ports, using libmap.conf to map it to libkse. No extra options given. >Did you build it from ports? If so, what version? >What configuration did you use? > >How big were the tables that you used? >How many queries did you hit the database with? > > > The tables I have are multiple gigabytes but the query load is not too bad on the test system, but it takes a few moments after starting when the mysqld stops answering to SIGTERM for proper shutdown and only way to get it to die is SIGKILL which is not exactly what you want to use to stop a database daemon. Pete From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 12:16:43 2004 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 768AF16A4CE for ; Tue, 10 Feb 2004 12:16:43 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30AA443D2F for ; Tue, 10 Feb 2004 12:16:43 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1AKGefo013792; Tue, 10 Feb 2004 15:16:40 -0500 (EST) Date: Tue, 10 Feb 2004 15:16:40 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Petri Helenius In-Reply-To: <40293892.9070607@he.iki.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 20:16:43 -0000 On Tue, 10 Feb 2004, Petri Helenius wrote: > Craig Rodrigues wrote: > > >How did you compile and configure MySQL with KSE? > > > > > > > I just did build it out of ports, using libmap.conf to map it to libkse. > No extra options given. "map it" equates to what? Mapping all libc_r to libkse or just mysql? Can you also do a 'top -H' and see if mysql is running with multiple system scope threads? > >Did you build it from ports? If so, what version? > >What configuration did you use? > > > >How big were the tables that you used? > >How many queries did you hit the database with? > > > > > > > The tables I have are multiple gigabytes but the query load is not too > bad on the test system, but it takes a few moments after starting when > the mysqld stops answering to SIGTERM for proper shutdown and only way > to get it to die is SIGKILL which is not exactly what you want to use to > stop a database daemon. Libc_r use to have the same exactl problem with MySql if I recall. We need to get someone familiar with mysql to help figure out what is going on. -- Dan From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 13:18:49 2004 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 841BE16A4CE for ; Tue, 10 Feb 2004 13:18:49 -0800 (PST) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CE1943D31 for ; Tue, 10 Feb 2004 13:18:49 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (rwcrmhc12) with ESMTP id <2004021021184501400hm4fbe>; Tue, 10 Feb 2004 21:18:45 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i1ALIrhd047840; Tue, 10 Feb 2004 16:18:53 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i1ALIq8F047839; Tue, 10 Feb 2004 16:18:52 -0500 (EST) (envelope-from rodrigc) Date: Tue, 10 Feb 2004 16:18:52 -0500 From: Craig Rodrigues To: Petri Helenius Message-ID: <20040210211852.GA47826@crodrigues.org> References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> <20040210193240.GA47392@crodrigues.org> <40293892.9070607@he.iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40293892.9070607@he.iki.fi> User-Agent: Mutt/1.4.1i cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 21:18:49 -0000 On Tue, Feb 10, 2004 at 10:01:22PM +0200, Petri Helenius wrote: > Craig Rodrigues wrote: > > >How did you compile and configure MySQL with KSE? > > > > > > > I just did build it out of ports, using libmap.conf to map it to libkse. What version? There are four different versions of mysql in ports. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 13:49:26 2004 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 4890916A4CE for ; Tue, 10 Feb 2004 13:49:26 -0800 (PST) Received: from mail.asn.net (mail.asn.net [66.235.231.4]) by mx1.FreeBSD.org (Postfix) with SMTP id 1619243D2F for ; Tue, 10 Feb 2004 13:49:26 -0800 (PST) (envelope-from kris-fbsd@asn.net) Received: (qmail 98313 invoked by uid 80); 10 Feb 2004 21:49:25 -0000 Received: from 68.3.131.72 (SquirrelMail authenticated user kgale) by mail.asn.net with HTTP; Tue, 10 Feb 2004 14:49:25 -0700 (MST) Message-ID: <53224.68.3.131.72.1076449765.squirrel@mail.asn.net> In-Reply-To: <20040210193240.GA47392@crodrigues.org> References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> <20040210193240.GA47392@crodrigues.org> Date: Tue, 10 Feb 2004 14:49:25 -0700 (MST) From: "Kris Gale" To: "Craig Rodrigues" User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 21:49:26 -0000 > On Tue, Feb 10, 2004 at 09:54:21AM -0700, Kris Gale wrote: >> > 1a) Is it stable to use KSE with mySQL? >> >> Not in my experience. >> http://lists.freebsd.org/pipermail/freebsd-threads/2004-February/001568.html > > How did you compile and configure MySQL with KSE? > > Did you build it from ports? If so, what version? > What configuration did you use? MySQL 4.0.17 from ports. KSE entries in libmap.conf. I tried it with and without BUILD_OPTIMIZED. I did not BUILD_STATIC, as I normally do. The DB_DIR was reconfigured. > How big were the tables that you used? The database powers a complicated web application. There are about 150 tables. Some have a few rows, some have hundreds of thousands of rows. > How many queries did you hit the database with? ---[ From previous thread]--- The first time I tried it, we were maintaining a load of about 600 threads and 300 queries/second and lasted about three hours before the thread count went through the roof and MySQL became unresponsive. The second time, we were sustaining a load of 1300 threads and 600 queries/second. This only lasted about 30 minutes. ------ I wasn't able to see the total number of queries because the database became unresponsive, but a quick estimate using the query rates and uptimes above would be several million. 300 qps * 60 seconds * 60 minutes * 3 hours = 3.24 million 600 qps * 60 seconds * 30 minutes = 1.08 million Kris From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 14:11:18 2004 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 13BA616A4D5 for ; Tue, 10 Feb 2004 14:11:18 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A5F943D1D for ; Tue, 10 Feb 2004 14:11:18 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (rwcrmhc13) with ESMTP id <2004021022111601500k5h4ge>; Tue, 10 Feb 2004 22:11:17 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i1AMBPhd048329; Tue, 10 Feb 2004 17:11:25 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i1AMBO7T048328; Tue, 10 Feb 2004 17:11:24 -0500 (EST) (envelope-from rodrigc) Date: Tue, 10 Feb 2004 17:11:24 -0500 From: Craig Rodrigues To: Kris Gale Message-ID: <20040210221124.GA48300@crodrigues.org> References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> <20040210193240.GA47392@crodrigues.org> <53224.68.3.131.72.1076449765.squirrel@mail.asn.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53224.68.3.131.72.1076449765.squirrel@mail.asn.net> User-Agent: Mutt/1.4.1i cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 22:11:18 -0000 On Tue, Feb 10, 2004 at 02:49:25PM -0700, Kris Gale wrote: > MySQL 4.0.17 from ports. KSE entries in libmap.conf. > > I tried it with and without BUILD_OPTIMIZED. I did not BUILD_STATIC, > as I normally do. The DB_DIR was reconfigured. > > > How big were the tables that you used? > > The database powers a complicated web application. There are about > 150 tables. Some have a few rows, some have hundreds of thousands > of rows. > > > How many queries did you hit the database with? > > ---[ From previous thread]--- > The first time I tried it, we were maintaining a load of about 600 > threads and 300 queries/second and lasted about three hours > before the thread count went through the roof and MySQL became > unresponsive. > > The second time, we were sustaining a load of 1300 threads and > 600 queries/second. This only lasted about 30 minutes. > ------ OK, this is good information to start off with. Is there a representative test application which comes with MySQL that could be used to hammer on the FreeBSD KSE implementation? I see many MySQL mailing lists at: http://lists.mysql.com.....is there a mailing list there which is appropriate to ask about threading issues, such as MySQL Internals? I think certain applications like MySQL and Apache should be of high priority to get working nicely with FreeBSD KSE before 5.3. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 14:39:38 2004 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 A265616A4CF for ; Tue, 10 Feb 2004 14:39:38 -0800 (PST) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1509343D1F for ; Tue, 10 Feb 2004 14:39:38 -0800 (PST) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by rms04.rommon.net (8.12.9p1/8.12.9) with ESMTP id i1ALdWcM065551; Tue, 10 Feb 2004 23:39:32 +0200 (EET) (envelope-from pete@he.iki.fi) Message-ID: <40294F56.6020706@he.iki.fi> Date: Tue, 10 Feb 2004 23:38:30 +0200 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 22:39:38 -0000 Daniel Eischen wrote: >On Tue, 10 Feb 2004, Petri Helenius wrote: > > > >>Craig Rodrigues wrote: >> >> >> >>>How did you compile and configure MySQL with KSE? >>> >>> >>> >>> >>> >>I just did build it out of ports, using libmap.conf to map it to libkse. >>No extra options given. >> >> > >"map it" equates to what? Mapping all libc_r to libkse or just >mysql? > > > All. (any other executables you´re interested in?) > ldd /usr/local/libexec/mysqld /usr/local/libexec/mysqld: libwrap.so.3 => /usr/lib/libwrap.so.3 (0x28377000) libz.so.2 => /lib/libz.so.2 (0x2837f000) libcrypt.so.2 => /lib/libcrypt.so.2 (0x2838d000) libc_r.so.5 => /usr/lib/libkse.so.1 (0x283a6000) libstdc++.so.4 => /usr/lib/libstdc++.so.4 (0x283ca000) libm.so.2 => /lib/libm.so.2 (0x28486000) libc.so.5 => /lib/libc.so.5 (0x2849f000) > >Can you also do a 'top -H' and see if mysql is running >with multiple system scope threads? > > > PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU CPU COMMAND 642 mysql 96 0 284M 250M select 0 67:13 1.37% 1.37% mysqld 642 mysql 20 0 284M 250M kserel 1 67:13 1.37% 1.37% mysqld 642 mysql -8 0 284M 250M biowr 1 67:13 1.37% 1.37% mysqld 642 mysql 20 0 284M 250M kserel 1 67:13 1.27% 1.27% mysqld 642 mysql 4 0 284M 250M sbwait 1 67:13 0.93% 0.93% mysqld 642 mysql 20 0 284M 250M kserel 1 67:13 0.00% 0.00% mysqld 642 mysql 20 0 284M 250M ksesig 1 67:13 0.00% 0.00% mysqld 642 mysql 20 0 284M 250M sigwai 1 67:13 0.00% 0.00% mysqld 642 mysql 4 0 284M 250M sbwait 1 67:13 0.00% 0.00% mysqld 642 mysql 4 0 284M 250M sbwait 0 67:13 0.00% 0.00% mysqld >Libc_r use to have the same exactl problem with MySql if I recall. > > > Cannot recall that happening to me, though I´ve been mostly using linuxthreads due to the performance increase they give. >We need to get someone familiar with mysql to help figure out >what is going on. > > > Pete From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 14:55:36 2004 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 1AB9316A4CE for ; Tue, 10 Feb 2004 14:55:36 -0800 (PST) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D52643D1D for ; Tue, 10 Feb 2004 14:55:35 -0800 (PST) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by rms04.rommon.net (8.12.9p1/8.12.9) with ESMTP id i1AMt1cM065726; Wed, 11 Feb 2004 00:55:01 +0200 (EET) (envelope-from pete@he.iki.fi) Message-ID: <40296107.4020605@he.iki.fi> Date: Wed, 11 Feb 2004 00:53:59 +0200 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Craig Rodrigues References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> <20040210193240.GA47392@crodrigues.org> <40293892.9070607@he.iki.fi> <20040210211852.GA47826@crodrigues.org> In-Reply-To: <20040210211852.GA47826@crodrigues.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 22:55:36 -0000 Craig Rodrigues wrote: >On Tue, Feb 10, 2004 at 10:01:22PM +0200, Petri Helenius wrote: > > >>> >>> >>I just did build it out of ports, using libmap.conf to map it to libkse. >> >> > >What version? There are four different versions of mysql in ports. > > > > My apologies. 4.0.17. Pete From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 14:57:41 2004 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 9A02516A4CE for ; Tue, 10 Feb 2004 14:57:41 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9333443D1F; Tue, 10 Feb 2004 14:57:41 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Received: from viatech.com.cn (davidxu@localhost [127.0.0.1]) i1AMvbbv055214; Tue, 10 Feb 2004 14:57:40 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Message-ID: <4029627F.4090602@viatech.com.cn> Date: Wed, 11 Feb 2004 07:00:15 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031206 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Gale References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> <20040210193240.GA47392@crodrigues.org> <53224.68.3.131.72.1076449765.squirrel@mail.asn.net> In-Reply-To: <53224.68.3.131.72.1076449765.squirrel@mail.asn.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 22:57:41 -0000 Kris Gale wrote: >>On Tue, Feb 10, 2004 at 09:54:21AM -0700, Kris Gale wrote: >> >> >>>>1a) Is it stable to use KSE with mySQL? >>>> >>>> >>>Not in my experience. >>>http://lists.freebsd.org/pipermail/freebsd-threads/2004-February/001568.html >>> >>> >>How did you compile and configure MySQL with KSE? >> >>Did you build it from ports? If so, what version? >>What configuration did you use? >> >> > >MySQL 4.0.17 from ports. KSE entries in libmap.conf. > >I tried it with and without BUILD_OPTIMIZED. I did not BUILD_STATIC, >as I normally do. The DB_DIR was reconfigured. > > > >>How big were the tables that you used? >> >> > >The database powers a complicated web application. There are about >150 tables. Some have a few rows, some have hundreds of thousands >of rows. > > > >>How many queries did you hit the database with? >> >> > >---[ From previous thread]--- >The first time I tried it, we were maintaining a load of about 600 >threads and 300 queries/second and lasted about three hours >before the thread count went through the roof and MySQL became >unresponsive. > >The second time, we were sustaining a load of 1300 threads and >600 queries/second. This only lasted about 30 minutes. >------ > >I wasn't able to see the total number of queries because the >database became unresponsive, but a quick estimate using the >query rates and uptimes above would be several million. > >300 qps * 60 seconds * 60 minutes * 3 hours = 3.24 million >600 qps * 60 seconds * 30 minutes = 1.08 million > >Kris > > > What's the value of your sysctl kern.threads.max_threads_per_proc and kern.threads.max_groups_per_proc ? Mysql heavily uses system scope thread. David Xu From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 15:08:59 2004 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 95F7516A4CE for ; Tue, 10 Feb 2004 15:08:59 -0800 (PST) Received: from mail.asn.net (mail.asn.net [66.235.231.4]) by mx1.FreeBSD.org (Postfix) with SMTP id 6529843D1F for ; Tue, 10 Feb 2004 15:08:59 -0800 (PST) (envelope-from kris-fbsd@asn.net) Received: (qmail 766 invoked by uid 80); 10 Feb 2004 23:08:58 -0000 Received: from 68.3.131.72 (SquirrelMail authenticated user kgale) by mail.asn.net with HTTP; Tue, 10 Feb 2004 16:08:58 -0700 (MST) Message-ID: <53632.68.3.131.72.1076454538.squirrel@mail.asn.net> In-Reply-To: <4029627F.4090602@viatech.com.cn> References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> <20040210193240.GA47392@crodrigues.org> <53224.68.3.131.72.1076449765.squirrel@mail.asn.net> <4029627F.4090602@viatech.com.cn> Date: Tue, 10 Feb 2004 16:08:58 -0700 (MST) From: "Kris Gale" To: "David Xu" User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 23:08:59 -0000 > What's the value of your sysctl kern.threads.max_threads_per_proc and > kern.threads.max_groups_per_proc ? Mysql heavily uses system scope > thread. I set them both to 2500. Just to reiterate my problem... I wasn't having any problems with MySQL starting up new threads. The problem was that MySQL would slow to a crawl, and then become completely unresponsive. I capture the number of threads periodically so I can graph it, and what I would see when MySQL started to slow was that the number of threads would be about twice what it should have been, given the load on the web application. It appeared that threads were being created, but would hang around forever, or that all of the queries were backing up. Attempting to stop and start the MySQL daemon while the client application (comprised of several hundred httpd processes) was trying to reconnect would end up crashing the entire OS, causing the machine to reboot. This never happened when I was near the console, and none of the logs contained any crash messages. Kris From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 15:22:33 2004 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 6E6E216A4CE for ; Tue, 10 Feb 2004 15:22:33 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13E9B43D1D for ; Tue, 10 Feb 2004 15:22:33 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1ANMSfo005553; Tue, 10 Feb 2004 18:22:28 -0500 (EST) Date: Tue, 10 Feb 2004 18:22:28 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Xu In-Reply-To: <4029627F.4090602@viatech.com.cn> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 23:22:33 -0000 On Wed, 11 Feb 2004, David Xu wrote: > What's the value of your sysctl kern.threads.max_threads_per_proc and > kern.threads.max_groups_per_proc ? Mysql heavily uses system scope > thread. That's why I wanted to know what top -H showed. We saw the same problem with python -- it was using system scope threads by default. The port has since been changed to use process scope threads. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 15:49:44 2004 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 4125616A4CE for ; Tue, 10 Feb 2004 15:49:44 -0800 (PST) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9755843D1D for ; Tue, 10 Feb 2004 15:49:43 -0800 (PST) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by rms04.rommon.net (8.12.9p1/8.12.9) with ESMTP id i1ANnYcM065848; Wed, 11 Feb 2004 01:49:40 +0200 (EET) (envelope-from pete@he.iki.fi) Message-ID: <40296DD0.2000809@he.iki.fi> Date: Wed, 11 Feb 2004 01:48:32 +0200 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <1076398781.b793f9a0dkt@digitalme.com> <51993.68.3.131.72.1076432061.squirrel@mail.asn.net> <20040210193240.GA47392@crodrigues.org> <53224.68.3.131.72.1076449765.squirrel@mail.asn.net> <4029627F.4090602@viatech.com.cn> In-Reply-To: <4029627F.4090602@viatech.com.cn> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 10 Feb 2004 23:49:44 -0000 David Xu wrote: >> > What's the value of your sysctl kern.threads.max_threads_per_proc and > kern.threads.max_groups_per_proc ? Mysql heavily uses system scope > thread. > kern.threads.debug: 0 kern.threads.max_threads_per_proc: 150 kern.threads.max_groups_per_proc: 50 kern.threads.max_threads_hits: 0 kern.threads.virtual_cpu: 2 It seems to use 9 threads at this time. Pete From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 16:49:16 2004 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 6C95516A4CE for ; Tue, 10 Feb 2004 16:49:16 -0800 (PST) Received: from bento.FreeBSD.org (bento.freebsd.org [216.136.204.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 682A843D1F; Tue, 10 Feb 2004 16:49:16 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (localhost [127.0.0.1]) by bento.FreeBSD.org (8.12.10/8.12.10) with ESMTP id i1B0nEQt005878; Tue, 10 Feb 2004 16:49:15 -0800 (PST) (envelope-from davidxu@freebsd.org) Message-ID: <40297C15.2030407@freebsd.org> Date: Wed, 11 Feb 2004 08:49:25 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: tege@swox.se cc: freebsd-threads@freebsd.org Subject: Re: kern/33951: pthread_cancel is ignored 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, 11 Feb 2004 00:49:16 -0000 Daniel Eischen wrote: >>I had enabled asynchornous cancelling for M:N thread in libkse but not >>1:1 thread, >>simplest way to support asynchronous cancelling for 1:1 is to use >>signal, but it will >>occupy a signal like Linux's SIGUSR1, another way is to use upcall, >>but it is >>slight complicated. >> >> > >An upcall would be nice since it wouldn' use a signal. It could >be treated like a signal where you push it on the thread's stack >but use the upcall function instead of a signal handling function. > > > I am working on it, hope I can work out a patch in next days. From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 16:57:57 2004 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 5BBAA16A4CE for ; Tue, 10 Feb 2004 16:57:57 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 566DF43D1F for ; Tue, 10 Feb 2004 16:57:57 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (rwcrmhc11) with ESMTP id <2004021100575001300fmo0se>; Wed, 11 Feb 2004 00:57:51 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i1B0vxhd093580; Tue, 10 Feb 2004 19:57:59 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i1B0vrhv093453; Tue, 10 Feb 2004 19:57:53 -0500 (EST) (envelope-from rodrigc) Date: Tue, 10 Feb 2004 19:57:52 -0500 From: Craig Rodrigues To: Daniel Eischen Message-ID: <20040211005752.GA90415@crodrigues.org> References: <4029627F.4090602@viatech.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 11 Feb 2004 00:57:57 -0000 On Tue, Feb 10, 2004 at 06:22:28PM -0500, Daniel Eischen wrote: > That's why I wanted to know what top -H showed. We saw the > same problem with python -- it was using system scope threads > by default. The port has since been changed to use process > scope threads. Is this a Linux-ism that we will need to be aware of for other ports that use pthreads? -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 17:08:14 2004 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 E466016A4CE for ; Tue, 10 Feb 2004 17:08:14 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id DECA843D1D for ; Tue, 10 Feb 2004 17:08:14 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <2004021101081201500cbkqee>; Wed, 11 Feb 2004 01:08:13 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id RAA86948; Tue, 10 Feb 2004 17:08:12 -0800 (PST) Date: Tue, 10 Feb 2004 17:08:10 -0800 (PST) From: Julian Elischer To: Craig Rodrigues In-Reply-To: <20040211005752.GA90415@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 11 Feb 2004 01:08:15 -0000 On Tue, 10 Feb 2004, Craig Rodrigues wrote: > On Tue, Feb 10, 2004 at 06:22:28PM -0500, Daniel Eischen wrote: > > That's why I wanted to know what top -H showed. We saw the > > same problem with python -- it was using system scope threads > > by default. The port has since been changed to use process > > scope threads. > > Is this a Linux-ism that we will need to be aware of > for other ports that use pthreads? process scope threads a re perfectly reasonable.. they however use more resources and are more heavily limitted. On the other hand process scope threads can lead to nasty surprises with the limits as they can "suddenly" hit th ekernel limit after running usccessfully for a time when they all (by some fluke) all decide to enter the kernel at the same time. We probably should increase the limits from 150 and 50 to 600 and 300 or something. > > -- > Craig Rodrigues > 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 Feb 10 17:13:13 2004 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 4296A16A4CE for ; Tue, 10 Feb 2004 17:13:13 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0220043D3F for ; Tue, 10 Feb 2004 17:13:13 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1B1D1fo005892; Tue, 10 Feb 2004 20:13:01 -0500 (EST) Date: Tue, 10 Feb 2004 20:13:01 -0500 (EST) 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: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 11 Feb 2004 01:13:13 -0000 On Tue, 10 Feb 2004, Julian Elischer wrote: > > > On Tue, 10 Feb 2004, Craig Rodrigues wrote: > > > On Tue, Feb 10, 2004 at 06:22:28PM -0500, Daniel Eischen wrote: > > > That's why I wanted to know what top -H showed. We saw the > > > same problem with python -- it was using system scope threads > > > by default. The port has since been changed to use process > > > scope threads. > > > > Is this a Linux-ism that we will need to be aware of > > for other ports that use pthreads? Probably, yes. > > process scope threads a re perfectly reasonable.. they however > use more resources and are more heavily limitted. > > > On the other hand process scope threads can lead to nasty surprises with > the limits as they can "suddenly" hit th ekernel limit after running > usccessfully for a time when they all (by some fluke) all decide to > enter the kernel at the same time. Well, since the kernel limit for scope system threads is much smaller than that for "threads blocked in kernel", you'd hit the limit much sooner if the port/application used scope system threads instead of scope process threads. > We probably should increase the limits from 150 and 50 to > 600 and 300 or something. That's fine by me. It's all a guessing game for me 'cause I don't really know what you'd expect to see with some of these applications. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 17:16:54 2004 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 4F9AC16A4CE for ; Tue, 10 Feb 2004 17:16:54 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 497E043D2F for ; Tue, 10 Feb 2004 17:16:54 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc11) with ESMTP id <2004021101165301300fk80ve>; Wed, 11 Feb 2004 01:16:53 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id RAA87062; Tue, 10 Feb 2004 17:16:52 -0800 (PST) Date: Tue, 10 Feb 2004 17:16:50 -0800 (PST) From: Julian Elischer To: Daniel Eischen In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 11 Feb 2004 01:16:54 -0000 On Tue, 10 Feb 2004, Daniel Eischen wrote: > On Tue, 10 Feb 2004, Julian Elischer wrote: > > > > > > > On Tue, 10 Feb 2004, Craig Rodrigues wrote: > > > > > On Tue, Feb 10, 2004 at 06:22:28PM -0500, Daniel Eischen wrote: > > > > That's why I wanted to know what top -H showed. We saw the > > > > same problem with python -- it was using system scope threads > > > > by default. The port has since been changed to use process > > > > scope threads. > > > > > > Is this a Linux-ism that we will need to be aware of > > > for other ports that use pthreads? > > Probably, yes. > > > > > process scope threads a re perfectly reasonable.. they however > > use more resources and are more heavily limitted. > > > > > > On the other hand process scope threads can lead to nasty surprises with > > the limits as they can "suddenly" hit th ekernel limit after running > > successfully for a time when they all (by some fluke) all decide to > > enter the kernel at the same time. > > Well, since the kernel limit for scope system threads is much smaller > than that for "threads blocked in kernel", you'd hit the limit much > sooner if the port/application used scope system threads instead > of scope process threads. but at least it wouldn't be a surprise :-) > > > We probably should increase the limits from 150 and 50 to > > 600 and 300 or something. > > That's fine by me. It's all a guessing game for me 'cause I > don't really know what you'd expect to see with some of these > applications. > > -- > Dan Eischen > > From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 17:30:20 2004 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 EB8F516A4CE for ; Tue, 10 Feb 2004 17:30:20 -0800 (PST) Received: from bento.FreeBSD.org (bento.freebsd.org [216.136.204.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id E636243D31; Tue, 10 Feb 2004 17:30:20 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (localhost [127.0.0.1]) by bento.FreeBSD.org (8.12.10/8.12.10) with ESMTP id i1B1UIQt013558; Tue, 10 Feb 2004 17:30:19 -0800 (PST) (envelope-from davidxu@freebsd.org) Message-ID: <402985B5.8080703@freebsd.org> Date: Wed, 11 Feb 2004 09:30:29 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Julian Elischer References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 11 Feb 2004 01:30:21 -0000 Julian Elischer wrote: >>>process scope threads a re perfectly reasonable.. they however >>>use more resources and are more heavily limitted. >>> >>> >>>On the other hand process scope threads can lead to nasty surprises with >>>the limits as they can "suddenly" hit th ekernel limit after running >>>successfully for a time when they all (by some fluke) all decide to >>>enter the kernel at the same time. >>> >>> >>Well, since the kernel limit for scope system threads is much smaller >>than that for "threads blocked in kernel", you'd hit the limit much >>sooner if the port/application used scope system threads instead >>of scope process threads. >> >> > >but at least it wouldn't be a surprise :-) > You can print a warning message like LDT allocating code. David Xu From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 17:32:14 2004 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 3581216A4CE for ; Tue, 10 Feb 2004 17:32:14 -0800 (PST) Received: from digitalme.com (imap.digitalme.com [193.97.97.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BE0643D2F for ; Tue, 10 Feb 2004 17:32:14 -0800 (PST) (envelope-from dkt@digitalme.com) Received: from dkt [210.0.207.157] by digitalme.com with NIMS ModWeb Module; Wed, 11 Feb 2004 09:31:44 +0800 From: Dung Patrick To: davidxu@viatech.com.cn, Date: Wed, 11 Feb 2004 09:31:44 +0800 X-Mailer: NIMS ModWeb Module X-Sender: dkt MIME-Version: 1.0 Message-ID: <1076463104.c8c39f40dkt@digitalme.com> Content-Type: text/plain; charset="BIG5" Content-Transfer-Encoding: quoted-printable cc: freebsd-threads@freebsd.org Subject: Re: Re: Question about threads [beaver challenge] 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, 11 Feb 2004 01:32:14 -0000 Would you please explain this parameter: kern.threads.max_groups_per_proc Patrick -----Original Message----- From: David Xu To: Kris Gale Date: Wed, 11 Feb 2004 07:00:15 +0800 Subject: Re: Question about threads [beaver challenge] Kris Gale wrote: >>On Tue, Feb 10, 2004 at 09:54:21AM -0700, Kris Gale wrote: >> =20 >> >>>>1a) Is it stable to use KSE with mySQL? >>>> =20 >>>> >>>Not in my experience. >>>http://lists.freebsd.org/pipermail/freebsd-threads/2004-February/001568.= html >>> =20 >>> >>How did you compile and configure MySQL with KSE? >> >>Did you build it from ports? If so, what version? >>What configuration did you use? >> =20 >> > >MySQL 4.0.17 from ports. KSE entries in libmap.conf. > >I tried it with and without BUILD_OPTIMIZED. I did not BUILD_STATIC, >as I normally do. The DB_DIR was reconfigured. > > =20 > >>How big were the tables that you used? >> =20 >> > >The database powers a complicated web application. There are about >150 tables. Some have a few rows, some have hundreds of thousands >of rows. > > =20 > >>How many queries did you hit the database with? >> =20 >> > >---[ From previous thread]--- >The first time I tried it, we were maintaining a load of about 600 >threads and 300 queries/second and lasted about three hours >before the thread count went through the roof and MySQL became >unresponsive. > >The second time, we were sustaining a load of 1300 threads and >600 queries/second. This only lasted about 30 minutes. >------ > >I wasn't able to see the total number of queries because the >database became unresponsive, but a quick estimate using the >query rates and uptimes above would be several million. > >300 qps * 60 seconds * 60 minutes * 3 hours =3D 3.24 million >600 qps * 60 seconds * 30 minutes =3D 1.08 million > >Kris > > =20 > What's the value of your sysctl kern.threads.max_threads_per_proc and kern.threads.max_groups_per_proc ? Mysql heavily uses system scope thread. David Xu _______________________________________________ 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 Feb 10 17:53:17 2004 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 06EB416A4CE for ; Tue, 10 Feb 2004 17:53:17 -0800 (PST) Received: from bento.FreeBSD.org (bento.freebsd.org [216.136.204.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0131743D31; Tue, 10 Feb 2004 17:53:17 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Received: from viatech.com.cn (localhost [127.0.0.1]) by bento.FreeBSD.org (8.12.10/8.12.10) with ESMTP id i1B1rEQt017260; Tue, 10 Feb 2004 17:53:15 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Message-ID: <40298B15.1050409@viatech.com.cn> Date: Wed, 11 Feb 2004 09:53:25 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dung Patrick References: <1076463104.c8c39f40dkt@digitalme.com> In-Reply-To: <1076463104.c8c39f40dkt@digitalme.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 11 Feb 2004 01:53:17 -0000 Dung Patrick wrote: >Would you please explain this parameter: > >kern.threads.max_groups_per_proc > It is used by system scope thread in libpthread, whenever you create a system scope thread, kernel creates a dedicated thread for the user thread, it also eats a kernel thread group, for programs heavily use system scope thread, the sysctl value should be increased. current kern.threads.max_threads_per_proc not only accounts process scope thread which are being blocked in kernel, but also accounts system scope thread, so you should increase the sysctl value at same time, otherwise too much system scope threads can block process scope thread because the thread limit is hit and no upcall will be scheduled, so UTS does not have chance to run, if UTS can not run, then process scope thread can not be scheduled in userland, result is process is suddenly stopped. The default values are too low for some applications. we might increase it before 5.3 release. David Xu From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 22:46:29 2004 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 A8C2B16A4CE for ; Tue, 10 Feb 2004 22:46:29 -0800 (PST) Received: from digitalme.com (pop.digitalme.com [193.97.97.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9965D43D1D for ; Tue, 10 Feb 2004 22:46:29 -0800 (PST) (envelope-from dkt@digitalme.com) Received: from dkt [210.0.207.157] by digitalme.com with NIMS ModWeb Module; Wed, 11 Feb 2004 14:46:29 +0800 From: Dung Patrick To: freebsd-threads@freebsd.org, Date: Wed, 11 Feb 2004 14:46:29 +0800 X-Mailer: NIMS ModWeb Module X-Sender: dkt MIME-Version: 1.0 Message-ID: <1076481989.c8c39b60dkt@digitalme.com> Content-Type: text/plain; charset="BIG5" Content-Transfer-Encoding: quoted-printable Subject: KSE + SMP + Java 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: Wed, 11 Feb 2004 06:46:29 -0000 Hi We are using FreeBSD 5.2p2. It is a Dual P4 Xeon. We use ULE. Java is complied, with libmap which map libc_r to libkse. We found out that the Java is using only one CPU, not both. Is there anythi= ng that need to be do? Any suggestions? Thank you. Patrick From owner-freebsd-threads@FreeBSD.ORG Wed Feb 11 01:10:33 2004 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 DD1ED16A4CF for ; Wed, 11 Feb 2004 01:10:33 -0800 (PST) Received: from exchhz01.viatech.com.cn (ip-40-162-97-218.anlai.com [218.97.162.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id C23D143D1D for ; Wed, 11 Feb 2004 01:10:29 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (DAVIDWNT [10.4.1.99]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id 1WN48GPF; Wed, 11 Feb 2004 17:10:27 +0800 Message-ID: <4029F18F.8030700@freebsd.org> Date: Wed, 11 Feb 2004 17:10:39 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dung Patrick References: <1076481989.c8c39b60dkt@digitalme.com> In-Reply-To: <1076481989.c8c39b60dkt@digitalme.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: KSE + SMP + Java 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: Wed, 11 Feb 2004 09:10:34 -0000 Dung Patrick wrote: >Hi > >We are using FreeBSD 5.2p2. It is a Dual P4 Xeon. We use ULE. > >Java is complied, with libmap which map libc_r to libkse. > >We found out that the Java is using only one CPU, not both. Is there anything that need to be do? Any suggestions? Thank you. > How to you find that java is only using one CPU ? :-) >Patrick > > > David Xu From owner-freebsd-threads@FreeBSD.ORG Wed Feb 11 06:00:38 2004 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 DB90516A4CE for ; Wed, 11 Feb 2004 06:00:38 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82DAE43D31 for ; Wed, 11 Feb 2004 06:00:38 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1BE0Xfo011805; Wed, 11 Feb 2004 09:00:33 -0500 (EST) Date: Wed, 11 Feb 2004 09:00:33 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Dung Patrick In-Reply-To: <1076481989.c8c39b60dkt@digitalme.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: KSE + SMP + Java 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: Wed, 11 Feb 2004 14:00:39 -0000 On Wed, 11 Feb 2004, Dung Patrick wrote: > Hi > > We are using FreeBSD 5.2p2. It is a Dual P4 Xeon. We use ULE. > > Java is complied, with libmap which map libc_r to libkse. > > We found out that the Java is using only one CPU, not both. Is there > anything that need to be do? Any suggestions? Thank you. It should be using two KSEs. What does top -H show? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Wed Feb 11 20:05:24 2004 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 3FDB516A4CE for ; Wed, 11 Feb 2004 20:05:24 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A98543D1D for ; Wed, 11 Feb 2004 20:05:24 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (sccrmhc12) with ESMTP id <2004021204052301200ste8ae>; Thu, 12 Feb 2004 04:05:23 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i1C45Yhd061846 for ; Wed, 11 Feb 2004 23:05:34 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i1C45Xax061845 for freebsd-threads@freebsd.org; Wed, 11 Feb 2004 23:05:33 -0500 (EST) (envelope-from rodrigc) Date: Wed, 11 Feb 2004 23:05:33 -0500 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20040212040533.GA61839@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: Should ps -p list threads? 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, 12 Feb 2004 04:05:24 -0000 Hi, top -H can be used to list the different threads for a process. Can something similar be done with ps? If I just type ps, it lists multiple entries for each thread: # ps PID TT STAT TIME COMMAND 61213 p6 SL+ 0:00.03 ./a.out 61213 p6 SL+ 0:00.03 ./a.out 61213 p6 SL+ 0:00.03 ./a.out But if I specify the process ID, only one entry is displayed: # ps -p 61213 PID TT STAT TIME COMMAND 61213 p6 S+ 0:00.03 ./a.out Should there be a way for ps to be able to display threads for a specific pid? -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Wed Feb 11 20:17:44 2004 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 5E48B16A4CE for ; Wed, 11 Feb 2004 20:17:44 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0490B43D1D for ; Wed, 11 Feb 2004 20:17:44 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1C4Hcfo004689; Wed, 11 Feb 2004 23:17:38 -0500 (EST) Date: Wed, 11 Feb 2004 23:17:38 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Rodrigues In-Reply-To: <20040212040533.GA61839@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 04:17:44 -0000 On Wed, 11 Feb 2004, Craig Rodrigues wrote: > Hi, > > top -H can be used to list the different threads > for a process. > > Can something similar be done with ps? > > If I just type ps, it lists multiple entries > for each thread: > # ps > PID TT STAT TIME COMMAND > 61213 p6 SL+ 0:00.03 ./a.out > 61213 p6 SL+ 0:00.03 ./a.out > 61213 p6 SL+ 0:00.03 ./a.out > But if I specify the process ID, only one entry is displayed: > > # ps -p 61213 > PID TT STAT TIME COMMAND > 61213 p6 S+ 0:00.03 ./a.out > > > Should there be a way for ps to be able to display > threads for a specific pid? Yes, I think so, but ps with no options should not list threads by default. It should take an option to _enable_ listing threads (KSE's really). -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Wed Feb 11 20:40:18 2004 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 AEB7216A4CE for ; Wed, 11 Feb 2004 20:40:18 -0800 (PST) Received: from exchhz01.viatech.com.cn (ip-40-162-97-218.anlai.com [218.97.162.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9362C43D1F for ; Wed, 11 Feb 2004 20:40:13 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (DAVIDWNT [10.4.1.99]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id 1WN48JT6; Thu, 12 Feb 2004 12:40:11 +0800 Message-ID: <402B03B7.1000104@freebsd.org> Date: Thu, 12 Feb 2004 12:40:23 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 04:40:18 -0000 Daniel Eischen wrote: >On Wed, 11 Feb 2004, Craig Rodrigues wrote: > > > >>Hi, >> >>top -H can be used to list the different threads >>for a process. >> >>Can something similar be done with ps? >> >>If I just type ps, it lists multiple entries >>for each thread: >># ps >> PID TT STAT TIME COMMAND >>61213 p6 SL+ 0:00.03 ./a.out >>61213 p6 SL+ 0:00.03 ./a.out >>61213 p6 SL+ 0:00.03 ./a.out >>But if I specify the process ID, only one entry is displayed: >> >># ps -p 61213 >> PID TT STAT TIME COMMAND >>61213 p6 S+ 0:00.03 ./a.out >> >> >>Should there be a way for ps to be able to display >>threads for a specific pid? >> >> > >Yes, I think so, but ps with no options should not list threads >by default. It should take an option to _enable_ listing >threads (KSE's really). > > I think it is already there, type: ps -H From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 08:16:59 2004 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 14A8F16A4CE; Thu, 12 Feb 2004 08:16:59 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id B065843D1D; Thu, 12 Feb 2004 08:16:58 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1CGGvfo015858; Thu, 12 Feb 2004 11:16:57 -0500 (EST) Date: Thu, 12 Feb 2004 11:16:57 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Xu In-Reply-To: <402B03B7.1000104@freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 16:16:59 -0000 On Thu, 12 Feb 2004, David Xu wrote: > Daniel Eischen wrote: > > >On Wed, 11 Feb 2004, Craig Rodrigues wrote: > >> > >>Should there be a way for ps to be able to display > >>threads for a specific pid? > >> > >> > > > >Yes, I think so, but ps with no options should not list threads > >by default. It should take an option to _enable_ listing > >threads (KSE's really). > > > > > I think it is already there, type: > ps -H But 'ps' without -H seems to display KSEs where it shouldn't. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 09:10:51 2004 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 7C6DA16A4CE; Thu, 12 Feb 2004 09:10:51 -0800 (PST) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 731E243D1D; Thu, 12 Feb 2004 09:10:51 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (rwcrmhc12) with ESMTP id <20040212171050014002v0moe>; Thu, 12 Feb 2004 17:10:50 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i1CHB2hd072846; Thu, 12 Feb 2004 12:11:02 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i1CHB2US072845; Thu, 12 Feb 2004 12:11:02 -0500 (EST) (envelope-from rodrigc) Date: Thu, 12 Feb 2004 12:11:01 -0500 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20040212171101.GA72641@crodrigues.org> References: <402B03B7.1000104@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: deischen@freebsd.org cc: scottl@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 17:10:51 -0000 On Thu, Feb 12, 2004 at 11:16:57AM -0500, Daniel Eischen wrote: > But 'ps' without -H seems to display KSEs where it shouldn't. I looked in the source code of ps, specifically in src/bin/ps/ps.c If you type just 'ps', this code gets executed in ps.c: 351 if (nuids == 1) { 352 what = KERN_PROC_UID; 353 flag = *uids; 354 } 371 if ((kp = kvm_getprocs(kd, what, flag, &nentries)) == 0 || nentr ies < 0) 372 errx(1, "%s", kvm_geterr(kd)); If you type 'ps -H', this code gets executed in ps.c: 194 case 'H': 195 showthreads = 1; 196 break; 351 if (nuids == 1) { 352 what = KERN_PROC_UID; 353 flag = *uids; 371 if ((kp = kvm_getprocs(kd, what, flag, &nentries)) == 0 || nentries < 0) 372 errx(1, "%s", kvm_geterr(kd)); So, I am not sure if this is a bug in kvm_getprocs() or in ps.c, but the result is that if you type ps or ps -H, they both display KSEs. Probably just typing ps should not display them. Any idea what the problem is? -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 11:04:19 2004 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 D230016A4CE; Thu, 12 Feb 2004 11:04:19 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8C4D43D1F; Thu, 12 Feb 2004 11:04:19 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <2004021219041901500cdo38e>; Thu, 12 Feb 2004 19:04:19 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA10688; Thu, 12 Feb 2004 11:04:18 -0800 (PST) Date: Thu, 12 Feb 2004 11:04:17 -0800 (PST) From: Julian Elischer To: Craig Rodrigues In-Reply-To: <20040212171101.GA72641@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: scottl@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 19:04:19 -0000 On Thu, 12 Feb 2004, Craig Rodrigues wrote: > On Thu, Feb 12, 2004 at 11:16:57AM -0500, Daniel Eischen wrote: > > But 'ps' without -H seems to display KSEs where it shouldn't. > > I looked in the source code of ps, > specifically in src/bin/ps/ps.c > > If you type just 'ps', this code gets executed in ps.c: > > 351 if (nuids == 1) { > 352 what = KERN_PROC_UID; > 353 flag = *uids; > 354 } > > 371 if ((kp = kvm_getprocs(kd, what, flag, &nentries)) == 0 || nentr > ies < 0) > 372 errx(1, "%s", kvm_geterr(kd)); > > > > If you type 'ps -H', this code gets executed in ps.c: > > 194 case 'H': > 195 showthreads = 1; > 196 break; > > 351 if (nuids == 1) { > 352 what = KERN_PROC_UID; > 353 flag = *uids; > > 371 if ((kp = kvm_getprocs(kd, what, flag, &nentries)) == 0 || nentries < 0) > 372 errx(1, "%s", kvm_geterr(kd)); > > The origianlpatch had _H show threads and normal ps did not.. I don't know why this is as it is... > > > So, I am not sure if this is a bug in kvm_getprocs() or in ps.c, > but the result is that if you type ps or ps -H, they > both display KSEs. Probably just typing ps should not display > them. > > Any idea what the problem is? > -- > Craig Rodrigues > 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 Thu Feb 12 11:16:45 2004 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 4F68316A51F; Thu, 12 Feb 2004 11:16:45 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C86743D39; Thu, 12 Feb 2004 11:16:45 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1CJGafo007758; Thu, 12 Feb 2004 14:16:36 -0500 (EST) Date: Thu, 12 Feb 2004 14:16:36 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Rodrigues In-Reply-To: <20040212171101.GA72641@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: scottl@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 19:16:45 -0000 On Thu, 12 Feb 2004, Craig Rodrigues wrote: > On Thu, Feb 12, 2004 at 11:16:57AM -0500, Daniel Eischen wrote: > > But 'ps' without -H seems to display KSEs where it shouldn't. > > I looked in the source code of ps, > specifically in src/bin/ps/ps.c [ ... ] > > So, I am not sure if this is a bug in kvm_getprocs() or in ps.c, > but the result is that if you type ps or ps -H, they > both display KSEs. Probably just typing ps should not display > them. > > Any idea what the problem is? We currently lack a sysctl interface to get finer-grained process info. I think KERN_PROC_THREADS (or whatever) should be added as a flag to the sysctl, so that you can 'or' it in to 'op' of kvm_getprocs(). You would need some kernel changes to support it too. I can look at it when I get a chance. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 11:29:41 2004 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 1BD0816A4CE; Thu, 12 Feb 2004 11:29:41 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id B849143D1D; Thu, 12 Feb 2004 11:29:40 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1CJTNfo011717; Thu, 12 Feb 2004 14:29:23 -0500 (EST) Date: Thu, 12 Feb 2004 14:29:23 -0500 (EST) 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: scottl@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 19:29:41 -0000 On Thu, 12 Feb 2004, Julian Elischer wrote: > > The origianlpatch had _H show threads and normal ps did not.. > I don't know why this is as it is... Because it didn't take into account other 'ps' options. Enabling or disabling thread info should be an option for all KERN_PROC_foo, not a separate option. If I were to change it, I would add #define KERN_PROC_THREADS 0x10000 to . Then allow: mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_UID | KERN_PROC_THREADS; mib[3] = pid; ... -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 11:33:31 2004 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 0B93816A4CF for ; Thu, 12 Feb 2004 11:33:31 -0800 (PST) Received: from smtp.mho.com (smtp.mho.net [64.58.4.5]) by mx1.FreeBSD.org (Postfix) with SMTP id 7A7BB43D1D for ; Thu, 12 Feb 2004 11:33:30 -0800 (PST) (envelope-from scottl@freebsd.org) Received: (qmail 17899 invoked by uid 1002); 12 Feb 2004 19:32:59 -0000 Received: from unknown (HELO ?10.4.1.17?) (64.58.1.252) by smtp.mho.net with SMTP; 12 Feb 2004 19:32:59 -0000 Date: Thu, 12 Feb 2004 12:33:20 -0700 (MST) From: Scott Long X-X-Sender: scottl@pooker.samsco.home To: Daniel Eischen In-Reply-To: Message-ID: <20040212123150.Y21291@pooker.samsco.home> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 19:33:31 -0000 On Thu, 12 Feb 2004, Daniel Eischen wrote: > On Thu, 12 Feb 2004, Craig Rodrigues wrote: > > > On Thu, Feb 12, 2004 at 11:16:57AM -0500, Daniel Eischen wrote: > > > But 'ps' without -H seems to display KSEs where it shouldn't. > > > > I looked in the source code of ps, > > specifically in src/bin/ps/ps.c > > [ ... ] > > > > So, I am not sure if this is a bug in kvm_getprocs() or in ps.c, > > but the result is that if you type ps or ps -H, they > > both display KSEs. Probably just typing ps should not display > > them. > > > > Any idea what the problem is? > > We currently lack a sysctl interface to get finer-grained > process info. I think KERN_PROC_THREADS (or whatever) should > be added as a flag to the sysctl, so that you can 'or' it > in to 'op' of kvm_getprocs(). You would need some kernel > changes to support it too. I can look at it when I get > a chance. > Give me a chance to look at this first. The whole idea of KERN_PROC_ALL vs KERN_PROC_PROC was to express this. If it's broken, then give me a day or two to find out why. Scott From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 11:46:02 2004 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 E305B16A4CE for ; Thu, 12 Feb 2004 11:46:02 -0800 (PST) Received: from smtp.mho.com (smtp.mho.net [64.58.4.5]) by mx1.FreeBSD.org (Postfix) with SMTP id AD30843D2F for ; Thu, 12 Feb 2004 11:46:02 -0800 (PST) (envelope-from scottl@freebsd.org) Received: (qmail 20000 invoked by uid 1002); 12 Feb 2004 19:46:02 -0000 Received: from unknown (HELO ?10.4.1.17?) (64.58.1.252) by smtp.mho.net with SMTP; 12 Feb 2004 19:46:02 -0000 Date: Thu, 12 Feb 2004 12:46:26 -0700 (MST) From: Scott Long X-X-Sender: scottl@pooker.samsco.home To: Daniel Eischen In-Reply-To: Message-ID: <20040212124357.B21291@pooker.samsco.home> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Julian Elischer cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 19:46:03 -0000 On Thu, 12 Feb 2004, Daniel Eischen wrote: > On Thu, 12 Feb 2004, Julian Elischer wrote: > > > > The origianlpatch had _H show threads and normal ps did not.. > > I don't know why this is as it is... > > Because it didn't take into account other 'ps' options. Enabling > or disabling thread info should be an option for all KERN_PROC_foo, > not a separate option. If I were to change it, I would add > > #define KERN_PROC_THREADS 0x10000 > > to . Then allow: > > mib[0] = CTL_KERN; > mib[1] = KERN_PROC; > mib[2] = KERN_PROC_UID | KERN_PROC_THREADS; > mib[3] = pid; > > ... > Yeah, it's probably cleaner that way. Still, you'll have to deal with KERN_PROC_PROC vs. KERN_PROC_ALL. Maybe just remove both and have KERN_PROC_THREAD be a modifier for KERN_PROC_PID. Are you willing to do the kernel work for this too? Scott From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 12:26:26 2004 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 D24E216A4CE; Thu, 12 Feb 2004 12:26:26 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8FED243D1D; Thu, 12 Feb 2004 12:26:26 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1CKQHfo027625; Thu, 12 Feb 2004 15:26:17 -0500 (EST) Date: Thu, 12 Feb 2004 15:26:17 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Scott Long In-Reply-To: <20040212124357.B21291@pooker.samsco.home> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Julian Elischer cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 20:26:26 -0000 On Thu, 12 Feb 2004, Scott Long wrote: > On Thu, 12 Feb 2004, Daniel Eischen wrote: > > On Thu, 12 Feb 2004, Julian Elischer wrote: > > > > > > The origianlpatch had _H show threads and normal ps did not.. > > > I don't know why this is as it is... > > > > Because it didn't take into account other 'ps' options. Enabling > > or disabling thread info should be an option for all KERN_PROC_foo, > > not a separate option. If I were to change it, I would add > > > > #define KERN_PROC_THREADS 0x10000 > > > > to . Then allow: > > > > mib[0] = CTL_KERN; > > mib[1] = KERN_PROC; > > mib[2] = KERN_PROC_UID | KERN_PROC_THREADS; > > mib[3] = pid; > > > > ... > > > > Yeah, it's probably cleaner that way. Still, you'll have to deal with > KERN_PROC_PROC vs. KERN_PROC_ALL. Maybe just remove both and have > KERN_PROC_THREAD be a modifier for KERN_PROC_PID. I was just going to allow them for backward compatibility. Using KERN_PROC_ALL would imply KERN_PROC_THREADS. > Are you > willing to do the kernel work for this too? Preliminary (untested) patch just to show you where I was headed: http://people.freebsd.org/~deischen/kse/sys.diffs.021204 I'll test and debug it, make associated changes in libkvm and ps if you think the idea is OK. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 13:58:10 2004 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 0BCEE16A4CE; Thu, 12 Feb 2004 13:58:10 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A68B743D1D; Thu, 12 Feb 2004 13:58:09 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1CLvwfo024238; Thu, 12 Feb 2004 16:57:58 -0500 (EST) Date: Thu, 12 Feb 2004 16:57:58 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Scott Long In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Julian Elischer cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 12 Feb 2004 21:58:10 -0000 On Thu, 12 Feb 2004, Daniel Eischen wrote: > On Thu, 12 Feb 2004, Scott Long wrote: > > > > Yeah, it's probably cleaner that way. Still, you'll have to deal with > > KERN_PROC_PROC vs. KERN_PROC_ALL. Maybe just remove both and have > > KERN_PROC_THREAD be a modifier for KERN_PROC_PID. > > I was just going to allow them for backward compatibility. Using > KERN_PROC_ALL would imply KERN_PROC_THREADS. > > > Are you > > willing to do the kernel work for this too? > > Preliminary (untested) patch just to show you where I was headed: > > http://people.freebsd.org/~deischen/kse/sys.diffs.021204 > > I'll test and debug it, make associated changes in libkvm and > ps if you think the idea is OK. Bahh. You can't seem to pass flags so that sysctl() doesn't look at them (from kern_proc.c): SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD, 0, "Process table"); SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT, 0, 0, sysctl_kern_proc, "S,proc", "Return entire process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_PGRP, pgrp, CTLFLAG_RD, sysctl_kern_proc, "Process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_TTY, tty, CTLFLAG_RD, sysctl_kern_proc, "Process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_UID, uid, CTLFLAG_RD, sysctl_kern_proc, "Process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_RUID, ruid, CTLFLAG_RD, sysctl_kern_proc, "Process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_PID, pid, CTLFLAG_RD, sysctl_kern_proc, "Process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_PROC, proc, CTLFLAG_RD, sysctl_kern_proc, "Return process table, no threads"); SYSCTL_NODE(_kern_proc, KERN_PROC_ARGS, args, CTLFLAG_RW | CTLFLAG_ANYBODY, sysctl_kern_proc_args, "Process argument list"); SYSCTL_NODE(_kern_proc, KERN_PROC_SV_NAME, sv_name, CTLFLAG_RD, sysctl_kern_proc_sv_name, "Process syscall vector name (ABI type)"); Anything other than the KERN_PROC_foo shown above is treated as invalid. A quick and ugly way is to add additional sysctl nodes for "| KERN_PROC_THREADS": SYSCTL_NODE(_kern_proc, KERN_PROC_PGRP, pgrp, CTLFLAG_RD, sysctl_kern_proc, "Process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_THREADS | KERN_PROC_PGRP, pgrp, CTLFLAG_RD, sysctl_kern_proc, "Process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_TTY, tty, CTLFLAG_RD, sysctl_kern_proc, "Process table"); SYSCTL_NODE(_kern_proc, KERN_PROC_THREADS | KERN_PROC_TTY, tty, CTLFLAG_RD, sysctl_kern_proc, "Process table"); ... The other way is to add a parameter to the mib just for flags but I'm not sure that it's possible to have more than one parameter to a sysctl node. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Feb 13 03:46:22 2004 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 B045216A4CE for ; Fri, 13 Feb 2004 03:46:22 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81CCB43D1D for ; Fri, 13 Feb 2004 03:46:22 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 4774E5309; Fri, 13 Feb 2004 12:46:21 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 2E8585308 for ; Fri, 13 Feb 2004 12:46:15 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id B4E1833C6F; Fri, 13 Feb 2004 12:46:14 +0100 (CET) To: threads@freebsd.org From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 13 Feb 2004 12:46:14 +0100 Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.63 Subject: checking lock ownership 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, 13 Feb 2004 11:46:22 -0000 Is there any way, either in POSIX or in FreeBSD, to check if a given pthread_mutex_t is owned by the current thread? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-threads@FreeBSD.ORG Fri Feb 13 07:07:16 2004 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 7CA8C16A4CE for ; Fri, 13 Feb 2004 07:07:16 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A21043D1F for ; Fri, 13 Feb 2004 07:07:16 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (sccrmhc12) with ESMTP id <20040213150715012000dhdje>; Fri, 13 Feb 2004 15:07:15 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i1DF7Shd079167; Fri, 13 Feb 2004 10:07:28 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i1DF7RVe079166; Fri, 13 Feb 2004 10:07:27 -0500 (EST) (envelope-from rodrigc) Date: Fri, 13 Feb 2004 10:07:27 -0500 From: Craig Rodrigues To: Dag-Erling Sm?rgrav Message-ID: <20040213150727.GA79077@crodrigues.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: threads@freebsd.org Subject: Re: checking lock ownership 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, 13 Feb 2004 15:07:16 -0000 On Fri, Feb 13, 2004 at 12:46:14PM +0100, Dag-Erling Sm?rgrav wrote: > Is there any way, either in POSIX or in FreeBSD, to check if a given > pthread_mutex_t is owned by the current thread? One way is to try unlock it with pthread_mutex_unlock(). If that fails, and errno == EPERM, then the current thread doesn't own the mutex. For a less portable way, look at the source code for _pthread_mutex_unlock() in /usr/src/lib/libpthread/thread/thr_mutex.c -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Fri Feb 13 07:51:00 2004 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 882B616A4CE for ; Fri, 13 Feb 2004 07:51:00 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58E4F43D1F for ; Fri, 13 Feb 2004 07:51:00 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 481A95309; Fri, 13 Feb 2004 16:50:59 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id E2CF85308; Fri, 13 Feb 2004 16:50:52 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id CD41833C6F; Fri, 13 Feb 2004 16:50:52 +0100 (CET) To: Craig Rodrigues References: <20040213150727.GA79077@crodrigues.org> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 13 Feb 2004 16:50:52 +0100 In-Reply-To: <20040213150727.GA79077@crodrigues.org> (Craig Rodrigues's message of "Fri, 13 Feb 2004 10:07:27 -0500") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.63 cc: threads@freebsd.org Subject: Re: checking lock ownership 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, 13 Feb 2004 15:51:00 -0000 Craig Rodrigues writes: > On Fri, Feb 13, 2004 at 12:46:14PM +0100, Dag-Erling Sm?rgrav wrote: > > Is there any way, either in POSIX or in FreeBSD, to check if a given > > pthread_mutex_t is owned by the current thread? > One way is to try unlock it with pthread_mutex_unlock(). > If that fails, and errno =3D=3D EPERM, then the current thread > doesn't own the mutex. I can't believe you even consider that as an option... DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-threads@FreeBSD.ORG Fri Feb 13 10:24:32 2004 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 CD90016A4CF; Fri, 13 Feb 2004 10:24:32 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B98043D2F; Fri, 13 Feb 2004 10:24:32 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1DINJfo021701; Fri, 13 Feb 2004 13:23:19 -0500 (EST) Date: Fri, 13 Feb 2004 13:23:19 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Scott Long In-Reply-To: <20040212124357.B21291@pooker.samsco.home> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Julian Elischer cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? 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, 13 Feb 2004 18:24:32 -0000 On Thu, 12 Feb 2004, Scott Long wrote: > On Thu, 12 Feb 2004, Daniel Eischen wrote: > > On Thu, 12 Feb 2004, Julian Elischer wrote: > > > > > > The origianlpatch had _H show threads and normal ps did not.. > > > I don't know why this is as it is... > > > > Because it didn't take into account other 'ps' options. Enabling > > or disabling thread info should be an option for all KERN_PROC_foo, > > not a separate option. If I were to change it, I would add > > > > #define KERN_PROC_THREADS 0x10000 > > > > to . Then allow: > > > > mib[0] = CTL_KERN; > > mib[1] = KERN_PROC; > > mib[2] = KERN_PROC_UID | KERN_PROC_THREADS; > > mib[3] = pid; > > > > ... > > > > Yeah, it's probably cleaner that way. Still, you'll have to deal with > KERN_PROC_PROC vs. KERN_PROC_ALL. Maybe just remove both and have > KERN_PROC_THREAD be a modifier for KERN_PROC_PID. Are you > willing to do the kernel work for this too? Tested and working patch at: http://people.freebsd.org/~deischen/kse/sysctl.diffs.021304 The sysctl interface doesn't work as I expected. It didn't seem to like "holey" slots, so I couldn't do: #define KERN_PROC_ALL 0 /* everything */ ... #define KERN_PROC_SV_NAME 9 /* get syscall vector name */ #define KERN_PROC_THREADS 0x10 /* include threads */ Instead I had to add separate defines for each one: #define KERN_PROC_PID_TD 10 /* by process id */ #define KERN_PROC_PGRP_TD 11 /* by process group id */ #define KERN_PROC_SESSION_TD 12 /* by session of pid */ #define KERN_PROC_TTY_TD 13 /* by controlling tty */ #define KERN_PROC_UID_TD 14 /* by effective uid */ #define KERN_PROC_RUID_TD 15 /* by real uid */ #define KERN_PROC_PROC_TD 16 /* only return procs */ -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Feb 13 23:11:36 2004 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 9182D16A4CE for ; Fri, 13 Feb 2004 23:11:36 -0800 (PST) Received: from kurush.osdn.org.ua (external.osdn.org.ua [212.40.34.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id 050BD43D1F for ; Fri, 13 Feb 2004 23:11:35 -0800 (PST) (envelope-from never@kurush.osdn.org.ua) Received: from kurush.osdn.org.ua (never@localhost [127.0.0.1]) by kurush.osdn.org.ua (8.12.6p3/8.12.6) with ESMTP id i1E7BMq3080122; Sat, 14 Feb 2004 09:11:22 +0200 (EET) (envelope-from never@kurush.osdn.org.ua) Received: (from never@localhost) by kurush.osdn.org.ua (8.12.6p3/8.12.6/Submit) id i1E7BFu9080117; Sat, 14 Feb 2004 09:11:15 +0200 (EET) (envelope-from never) Date: Sat, 14 Feb 2004 09:11:15 +0200 From: Alexandr Kovalenko To: davidxu@viatech.com.cn Message-ID: <20040214071115.GA77411@nevermind.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.4i cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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, 14 Feb 2004 07:11:36 -0000 Dung Patrick wrote: > >Would you please explain this parameter: > > > >kern.threads.max_groups_per_proc > > > It is used by system scope thread in libpthread, whenever you > create a system scope thread, kernel creates a dedicated thread > for the user thread, it also eats a kernel thread group, for programs > heavily use system scope thread, the sysctl value should be increased. > current kern.threads.max_threads_per_proc not only accounts process > scope thread which are being blocked in kernel, but also accounts > system scope thread, so you should increase the sysctl value at same > time, otherwise too much system scope threads can block process scope > thread because the thread limit is hit and no upcall will be scheduled, > so UTS does not have chance to run, if UTS can not run, then process > scope thread can not be scheduled in userland, result is process > is suddenly stopped. The default values are too low for some > applications. > we might increase it before 5.3 release. What ratio between groups and threads should be? P.S. I'm not subsctibed to -threads, so, please Cc: me. -- NEVE-RIPE, will build world for food Ukrainian FreeBSD User Group http://uafug.org.ua/