From owner-freebsd-threads@FreeBSD.ORG Mon Jun 11 00:20:02 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A460C16A400 for ; Mon, 11 Jun 2007 00:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD3413C484 for ; Mon, 11 Jun 2007 00:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5B0K291063561 for ; Mon, 11 Jun 2007 00:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5B0K2ir063560; Mon, 11 Jun 2007 00:20:02 GMT (envelope-from gnats) Resent-Date: Mon, 11 Jun 2007 00:20:02 GMT Resent-Message-Id: <200706110020.l5B0K2ir063560@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, bivqtukx Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 456B816A469 for ; Mon, 11 Jun 2007 00:11:51 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 1E94613C44C for ; Mon, 11 Jun 2007 00:11:51 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l5B0Boh7016413 for ; Mon, 11 Jun 2007 00:11:50 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l5B0AZfA016129; Mon, 11 Jun 2007 00:10:35 GMT (envelope-from nobody) Message-Id: <200706110010.l5B0AZfA016129@www.freebsd.org> Date: Mon, 11 Jun 2007 00:10:35 GMT From: bivqtukx To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: threads/113546: bivqtukx X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2007 00:20:02 -0000 >Number: 113546 >Category: threads >Synopsis: bivqtukx >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jun 11 00:20:01 GMT 2007 >Closed-Date: >Last-Modified: >Originator: bivqtukx >Release: bivqtukx >Organization: bivqtukx >Environment: bivqtukx >Description: mpchxjwo http://bestgfop.com nkqhgysw csxakher dtndjevf [URL=http://nlwbbsvs.com]stqijmlb[/URL] >How-To-Repeat: bivqtukx >Fix: bivqtukx >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Mon Jun 11 02:41:29 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 899B816A469; Mon, 11 Jun 2007 02:41:29 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 5C04D13C448; Mon, 11 Jun 2007 02:41:29 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5B2fTWF075131; Mon, 11 Jun 2007 02:41:29 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5B2fTJK075127; Mon, 11 Jun 2007 02:41:29 GMT (envelope-from linimon) Date: Mon, 11 Jun 2007 02:41:29 GMT From: Mark Linimon Message-Id: <200706110241.l5B2fTJK075127@freefall.freebsd.org> To: idroioeg@fzyuwojj.com, linimon@FreeBSD.org, freebsd-threads@FreeBSD.org Cc: Subject: Re: junk/113546: bivqtukx X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2007 02:41:29 -0000 Synopsis: bivqtukx State-Changed-From-To: open->closed State-Changed-By: linimon State-Changed-When: Mon Jun 11 02:41:15 UTC 2007 State-Changed-Why: Looks like Mr. Troll is back. http://www.freebsd.org/cgi/query-pr.cgi?pr=113546 From owner-freebsd-threads@FreeBSD.ORG Mon Jun 11 11:09:01 2007 Return-Path: X-Original-To: freebsd-threads@FreeBSD.org Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F035216A481 for ; Mon, 11 Jun 2007 11:09:01 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id D45D713C45B for ; Mon, 11 Jun 2007 11:09:01 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5BB91RA026789 for ; Mon, 11 Jun 2007 11:09:01 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5BB90HQ026782 for freebsd-threads@FreeBSD.org; Mon, 11 Jun 2007 11:09:00 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 11 Jun 2007 11:09:00 GMT Message-Id: <200706111109.l5BB90HQ026782@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2007 11:09:02 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/76690 threads fork hang in child for -lc_r 1 problem total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/20016 threads pthreads: Cannot set scheduling timer/Cannot set virtu s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s bin/32295 threads pthread dont dequeue signals s threa/34536 threads accept() blocks other threads o kern/38549 threads the procces compiled whith pthread stopped in pthread_ s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/49087 threads Signals lost in programs linked with libc_r s kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/unset O_NONBLOC o threa/70975 threads unexpected and unreliable behaviour when using SYSV se o threa/72429 threads threads blocked in stdio (fgets, etc) are not cancella o threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST o threa/75273 threads FBSD 5.3 libpthread (KSE) bug o threa/75374 threads pthread_kill() ignores SA_SIGINFO flag s threa/76694 threads fork cause hang in dup()/close() function in child (-l o threa/79683 threads svctcp_create() fails if multiple threads call at the o threa/80435 threads panic on high loads o threa/83914 threads [libc] popen() doesn't work in static threaded program s threa/84483 threads problems with devel/nspr and -lc_r on 4.x o threa/85160 threads [libthr] [patch] libobjc + libpthread/libthr crash pro f threa/90278 threads libthr, ULE and -current produces >100% WCPU with apac o kern/91266 threads [threads] Trying sleep, but thread marked as sleeping s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r o threa/101323 threads fork(2) in threaded programs broken. o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/110636 threads gdb(1): using gdb with multi thread application with l 28 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s kern/19247 threads uthread_sigaction.c does not do anything wrt SA_NOCLDW s kern/22190 threads A threaded read(2) from a socketpair(2) fd can sometim s threa/30464 threads pthread mutex attributes -- pshared s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/69020 threads pthreads library leaks _gc_mutex o threa/79887 threads [patch] freopen() isn't thread-safe o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/81534 threads [libc_r] [patch] libc_r close() will fail on any fd ty o threa/110306 threads apache 2.0 segmentation violation when calling gethost 10 problems total. From owner-freebsd-threads@FreeBSD.ORG Tue Jun 12 07:23:37 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B79D16A469; Tue, 12 Jun 2007 07:23:37 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id F2B1C13C483; Tue, 12 Jun 2007 07:23:36 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5C7Na8L032715; Tue, 12 Jun 2007 07:23:36 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5C7NaS9032711; Tue, 12 Jun 2007 07:23:36 GMT (envelope-from linimon) Date: Tue, 12 Jun 2007 07:23:36 GMT From: Mark Linimon Message-Id: <200706120723.l5C7NaS9032711@freefall.freebsd.org> To: leafy@leafy.idv.tw, linimon@FreeBSD.org, freebsd-threads@FreeBSD.org Cc: Subject: Re: threads/90278: libthr, ULE and -current produces >100% WCPU with apache20/22 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2007 07:23:37 -0000 Synopsis: libthr, ULE and -current produces >100% WCPU with apache20/22 State-Changed-From-To: feedback->closed State-Changed-By: linimon State-Changed-When: Tue Jun 12 07:23:22 UTC 2007 State-Changed-Why: Feedback timeout (> 1 month). http://www.freebsd.org/cgi/query-pr.cgi?pr=90278 From owner-freebsd-threads@FreeBSD.ORG Wed Jun 13 20:20:03 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F07C516A46D for ; Wed, 13 Jun 2007 20:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id CCE6813C4B8 for ; Wed, 13 Jun 2007 20:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5DKK3dm004466 for ; Wed, 13 Jun 2007 20:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5DKK3h7004465; Wed, 13 Jun 2007 20:20:03 GMT (envelope-from gnats) Resent-Date: Wed, 13 Jun 2007 20:20:03 GMT Resent-Message-Id: <200706132020.l5DKK3h7004465@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, clemens fischer Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBDCE16A41F for ; Wed, 13 Jun 2007 20:10:33 +0000 (UTC) (envelope-from root@spotteswoode.dnsalias.org) Received: from mail-out02.broadnet-mediascape.de (mail-out02.broadnet-mediascape.de [62.206.1.19]) by mx1.freebsd.org (Postfix) with SMTP id 6FBC613C45A for ; Wed, 13 Jun 2007 20:10:33 +0000 (UTC) (envelope-from root@spotteswoode.dnsalias.org) Received: (qmail 27347 invoked by uid 113); 13 Jun 2007 20:10:31 -0000 Received: from 212.99.205.111 by mail-out02 (envelope-from , uid 106) with qmail-scanner-1.25 ( Clear:RC:1(212.99.205.111):. Processed in 0.256488 secs); 13 Jun 2007 20:10:31 -0000 Received: from d463cd6f.datahighways.de (HELO spotteswoode.dnsalias.org) (212.99.205.111) by mail-out02.broadnet-mediascape.de with SMTP; 13 Jun 2007 20:10:30 -0000 Received: by spotteswoode.dnsalias.org (Postfix, from userid 0) id A904A279FA; Wed, 13 Jun 2007 22:08:48 +0200 (CEST) Message-Id: <20070613200848.A904A279FA@spotteswoode.dnsalias.org> Date: Wed, 13 Jun 2007 22:08:48 +0200 (CEST) From: clemens fischer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: clemens fischer Subject: threads/113666: misc/shared-mime-info doesn't install, can't find threading-fun X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2007 20:20:04 -0000 >Number: 113666 >Category: threads >Synopsis: misc/shared-mime-info doesn't install, can't find threading-fun >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 13 20:20:03 GMT 2007 >Closed-Date: >Last-Modified: >Originator: clemens fischer >Release: FreeBSD 6.2-STABLE i386 >Organization: >Environment: System: FreeBSD spotteswoode.dnsalias.org 6.2-STABLE FreeBSD 6.2-STABLE #19: Sat May 26 19:53:56 CEST 2007 root@spotteswoode.dnsalias.org:/usr/obj/usr/src/sys/spott i386 >Description: without much enthusiasm, i tried to install news/pan, but all the ncurses newsreaders suck one way or the other, i thought, might as well try a GUI-one for a change. saw the long list of GNOME dependencies and my heart sunk, but i kept up the spirit. [time passed] an hour or so later me thinks all is fine as load-level decreases, but: no pan. portupgrade(8) couldn't install misc/shared-mime-info due to a "link error". to shorten this sad story: the precise error massage was: /usr/local/lib/libxml2.so: undefined reference to `pthread_equal' wow. >How-To-Repeat: i think it suffices to try to install misc/shared-mime-info and watch it fail. >Fix: i don't have a fix. to get it to install, i fixed up the "inner" Makefile: /usr/ports/misc/shared-mime-info/work/shared-mime-info-0.21/Makefile -ALL_LIBS = -L/usr/local/lib -lxml2 -lglib-2.0 -liconv +ALL_LIBS = -L/usr/local/lib -lxml2 -lglib-2.0 -liconv -lc_r after that the port installed. wow, again. regards, clemens >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Wed Jun 13 21:20:49 2007 Return-Path: X-Original-To: freebsd-threads@FreeBSD.org Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5F2316A400 for ; Wed, 13 Jun 2007 21:20:48 +0000 (UTC) (envelope-from boilerpdx@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.233]) by mx1.freebsd.org (Postfix) with ESMTP id A7F8713C44B for ; Wed, 13 Jun 2007 21:20:48 +0000 (UTC) (envelope-from boilerpdx@gmail.com) Received: by nz-out-0506.google.com with SMTP id 14so305758nzn for ; Wed, 13 Jun 2007 14:20:48 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=eqtOsXEZqbxmeNBvjyGn5GqJoVZefqfzCcs1SkYEiCTjCx+hSDAfJbRNIGLfCu1cIZ9iD/fh/RG0VnJqPo1aSVw+sBfFZLop5upOAR5usYcfGQllEPRCV5sRrdqx0QKh17UD85zEFACRPnPJUn5UFQvtLKCTFRlywr8ByBhhCOw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=gOfb61bI/zopLtJbczTbyxOnD//4juvnTb974UGqC1+Mfhqd1Fd2z9y7smc0/sTPRVtYmJKIFLAaZAAT5cFcmTzGWxClHggNTAk2dYJWDmwSEgVOvQWRDJv4sD14zLiqEpEY/lwD6DjNKtOLxnDLSxcXqvcv9hYRU9Wp4Ao/GRA= Received: by 10.114.133.1 with SMTP id g1mr1036095wad.1181768170942; Wed, 13 Jun 2007 13:56:10 -0700 (PDT) Received: by 10.114.94.4 with HTTP; Wed, 13 Jun 2007 13:56:10 -0700 (PDT) Message-ID: <1d26be380706131356t3fca2f7dk625f1f5c4234b56d@mail.gmail.com> Date: Wed, 13 Jun 2007 13:56:10 -0700 From: "Aaron Kunze" To: freebsd-threads@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: Performance issue (bug?) in libpthread X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2007 21:20:49 -0000 Hello! I am seeing a performance issue when I use libpthread to provide POSIX threads, and I think I've narrowed the problem down to a line of code in libpthread. I am interested to know if anyone else has seen this problem, or if anyone disagrees with my analysis. I am running on a dual Intel Xeon X5355 system, which gives me 8 cores total. I am running an amd64 build of FreeBSD 6.2 with the SMP and ULE options. The test program I am using just creates 8 threads that do nothing but computation. They do no synchronization or I/O. I have complete control of the system, and all other processes are idle. For the first minute of its run time, this test app uses less than 8 cores. In most of the test runs, it uses 7 cores, but I have seen other numbers. The remaining core(s) are idle. Here is a snippit from "top" that shows this: 55948 RUN 0 3:06 87.21% compute_threads_pt 55948 CPU5 5 3:06 87.21% compute_threads_pt 55948 CPU4 4 3:06 87.21% compute_threads_pt 55948 CPU2 2 3:06 87.21% compute_threads_pt 55948 CPU1 1 3:06 87.21% compute_threads_pt 55948 CPU6 6 3:06 87.21% compute_threads_pt 55948 CPU3 3 3:06 87.21% compute_threads_pt 55948 kserel 0 3:06 0.00% compute_threads_pt The first KSE is on the runqueue because "top" is running on core 0 at the instant it samples the system state. That's not the problem. It's the last KSE that shows the problem. It is in the kserelease state and stays there for exactly one minute. After a minute passes, the problem resolves itself, and the system becomes fully utilized. Here's the output of "top" after a minute: 55948 CPU5 5 7:40 92.48% compute_threads_pt 55948 CPU4 4 7:40 92.48% compute_threads_pt 55948 CPU1 1 7:40 92.48% compute_threads_pt 55948 CPU6 6 7:40 92.48% compute_threads_pt 55948 CPU3 3 7:40 92.48% compute_threads_pt 55948 CPU2 2 7:40 92.48% compute_threads_pt 55948 RUN 0 7:40 87.94% compute_threads_pt 55948 CPU7 7 7:40 36.82% compute_threads_pt I went looking through the libpthread code to find something that looked like it could cause this, and I found something at lines 1801-1812 of thr_kern.c in the kse_wait function: if ((td_wait == NULL) || (td_wait->wakeup_time.tv_sec < 0)) { /* Limit sleep to no more than 1 minute. */ ts_sleep.tv_sec = 60; ts_sleep.tv_nsec = 0; } else { KSE_GET_TOD(kse, &ts); TIMESPEC_SUB(&ts_sleep, &td_wait->wakeup_time, &ts); if (ts_sleep.tv_sec > 60) { ts_sleep.tv_sec = 60; ts_sleep.tv_nsec = 0; } } I interpret this code to be putting KSEs to sleep for one minute when they find no user-level threads either ready to run or waiting for some timed event. If I change the tv_sec member of ts_sleep to 0 instead of 60 on line 1803, the problem goes away entirely. Here's what I believe is happening: - When I create the first worker thread, pthread_create calls _kse_setthreaded. - _kse_setthreaded calls _thr_setmaxconcurrency, which calls _thr_setconcurrency with "8" as the argument. - _thr_setconcurrency creates 7 KSEs (one already exists) - But at this point, the app has only created one user-level thread! - In parallel, the main thread continues to create threads while the new KSEs wake up and look in the run queue for threads to schedule. - One or more KSEs get to the run queue before all of the threads have been created and find no work to do. - Those KSEs call kse_wait and sleep for 1 minute. So, has anyone seen this before? Did I miss something? Aaron BTW, I looked at the HEAD in CVS, and the code in question has not changed. So if this is a bug, it hasn't been fixed in the meantime. From owner-freebsd-threads@FreeBSD.ORG Fri Jun 15 17:14:20 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5942716A46B for ; Fri, 15 Jun 2007 17:14:20 +0000 (UTC) (envelope-from frank@pinky.sax.de) Received: from pinky.frank-behrens.de (pinky.frank-behrens.de [82.139.199.24]) by mx1.freebsd.org (Postfix) with ESMTP id A0A2E13C458 for ; Fri, 15 Jun 2007 17:14:19 +0000 (UTC) (envelope-from frank@pinky.sax.de) Received: from [192.168.20.32] (sun.behrens [192.168.20.32]) by pinky.frank-behrens.de (8.14.1/8.14.1) with ESMTP-MSA id l5FH1KuJ047078 (version=TLSv1/SSLv3 cipher=DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 15 Jun 2007 19:01:20 +0200 (CEST) (envelope-from frank@pinky.sax.de) Message-Id: <200706151701.l5FH1KuJ047078@pinky.frank-behrens.de> From: "Frank Behrens" To: freebsd-threads@freebsd.org Date: Fri, 15 Jun 2007 19:01:19 +0200 MIME-Version: 1.0 Priority: normal X-mailer: Pegasus Mail for Windows (4.31, DE v4.31 R1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Hashcash: 1:24:070615:freebsd-threads@freebsd.org::PXNA/dIScGE17OPJ:0000001hSn0 Subject: Linking to pthread library: undefined reference X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2007 17:14:20 -0000 Hi, I could not find any information in the developers handbook, so I ask here for support. I try to link an milter (sendmail mail filter) test application and get an error I do not understand. I use FreeBSD 6.2-STABLE-200705211513 with an userland from May-03. In my Makefile I have: CFLAGS+= -I/usr/local/include -std=c99 -pthread -v LDADD+= -L/usr/local/lib -lmilter This gives linker command: cc -O2 -pipe -fno-strict-aliasing -march=pentium4 -I/usr/local/include -std=c99 -pthread -v -g - DDEBUG=1 -O1 -fno-omit-frame-pointer -Wsystem-headers -Wall -Wno-format-y2k -W - Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn- type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter - Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -o fmilter fmilter.o - L/usr/local/lib -lmilter Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.4.6 [FreeBSD] 20060305 /usr/bin/ld -V -dynamic-linker /libexec/ld-elf.so.1 -o fmilter /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib -L/usr/lib fmilter.o -lmilter -lgcc -lpthread -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o GNU ld version 2.15 [FreeBSD] 2004-05-23 Supported emulations: elf_i386_fbsd /usr/lib/libmilter.so: undefined reference to `pthread_detach' In my opinion the symbol should be found in /usr/lib/libpthread.so@ -> /lib/libpthread.so.2 When I look into the libraries I see > objdump -T /usr/lib/libmilter.so | fgrep detach 00000000 D *UND* 00000000 pthread_detach > objdump -T /usr/lib/libpthread.so | fgrep pthread_detach 000077d4 w DF .text 000003a4 LIBTHREAD_1_0 pthread_detach 000077d4 g DF .text 000003a4 LIBTHREAD_1_0 _pthread_detach Did I make something wrong? I guess yes, but what? Thanks for your help and best regards, Frank -- Frank Behrens, Osterwieck, Germany PGP-key 0x5B7C47ED on public servers available. From owner-freebsd-threads@FreeBSD.ORG Fri Jun 15 17:42:42 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B4BA16A41F for ; Fri, 15 Jun 2007 17:42:42 +0000 (UTC) (envelope-from gergely.czuczy@harmless.hu) Received: from marvin.harmless.hu (marvin.harmless.hu [195.56.55.204]) by mx1.freebsd.org (Postfix) with ESMTP id E1E3713C46A for ; Fri, 15 Jun 2007 17:42:41 +0000 (UTC) (envelope-from gergely.czuczy@harmless.hu) Received: from localhost (marvin-mail [192.168.0.2]) by marvin.harmless.hu (Postfix) with ESMTP id B7CB17C005A; Fri, 15 Jun 2007 19:19:13 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.4.2 (20060627) (Debian) at harmless.hu Received: from marvin.harmless.hu ([192.168.0.2]) by localhost (marvin.harmless.hu [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id YuPep0iNaRJK; Fri, 15 Jun 2007 19:19:13 +0200 (CEST) Received: from marvin.harmless.hu (localhost [127.0.0.1]) by marvin.harmless.hu (Postfix) with ESMTP id 3D0317BFF6D; Fri, 15 Jun 2007 19:18:57 +0200 (CEST) Date: Fri, 15 Jun 2007 19:18:57 +0200 From: Gergely CZUCZY To: Frank Behrens Message-ID: <20070615171857.GA89955@harmless.hu> References: <200706151701.l5FH1KuJ047078@pinky.frank-behrens.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=x-unknown; protocol="application/pgp-signature"; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <200706151701.l5FH1KuJ047078@pinky.frank-behrens.de> User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: freebsd-threads@freebsd.org Subject: Re: Linking to pthread library: undefined reference X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2007 17:42:42 -0000 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 15, 2007 at 07:01:19PM +0200, Frank Behrens wrote: > Hi, >=20 > I could not find any information in the developers handbook, so I ask her= e for support. >=20 > I try to link an milter (sendmail mail filter) test application and get a= n error I do not=20 > understand. I use FreeBSD 6.2-STABLE-200705211513 with an userland from M= ay-03. > In my Makefile I have: > CFLAGS+=3D -I/usr/local/include -std=3Dc99 -pthread -v > LDADD+=3D -L/usr/local/lib -lmilter >=20 > This gives linker command: > cc -O2 -pipe -fno-strict-aliasing -march=3Dpentium4 -I/usr/local/include = -std=3Dc99 -pthread -v -g - > DDEBUG=3D1 -O1 -fno-omit-frame-pointer -Wsystem-headers -Wall -Wno-format= -y2k -W - > Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-a= rith -Wreturn- > type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-= parameter - > Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -o fmilter = fmilter.o - > L/usr/local/lib -lmilter > Using built-in specs. > Configured with: FreeBSD/i386 system compiler > Thread model: posix > gcc version 3.4.6 [FreeBSD] 20060305 > /usr/bin/ld -V -dynamic-linker /libexec/ld-elf.so.1 -o fmilter /usr/lib/= crt1.o /usr/lib/crti.o=20 > /usr/lib/crtbegin.o -L/usr/local/lib -L/usr/lib fmilter.o -lmilter -lgcc = -lpthread -lc -lgcc=20 I don't think this is the problem here, but you should link against -pthrea= d, and not -lpthread. pthread is just an API here, while -pthread refers to the system-default threading library (with a pthread interface). > /usr/lib/crtend.o /usr/lib/crtn.o > GNU ld version 2.15 [FreeBSD] 2004-05-23 > Supported emulations: > elf_i386_fbsd > /usr/lib/libmilter.so: undefined reference to `pthread_detach' >=20 > In my opinion the symbol should be found in > /usr/lib/libpthread.so@ -> /lib/libpthread.so.2 >=20 > When I look into the libraries I see > > objdump -T /usr/lib/libmilter.so | fgrep detach > 00000000 D *UND* 00000000 pthread_detach >=20 > > objdump -T /usr/lib/libpthread.so | fgrep pthread_detach > 000077d4 w DF .text 000003a4 LIBTHREAD_1_0 pthread_detach > 000077d4 g DF .text 000003a4 LIBTHREAD_1_0 _pthread_detach >=20 >=20 > Did I make something wrong? I guess yes, but what? >=20 > Thanks for your help and best regards, > Frank > --=20 > Frank Behrens, Osterwieck, Germany > PGP-key 0x5B7C47ED on public servers available. >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" >=20 Bye, Gergely Czuczy mailto: gergely.czuczy@harmless.hu --=20 Weenies test. Geniuses solve problems that arise. --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) 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 =jAfS -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q-- From owner-freebsd-threads@FreeBSD.ORG Sat Jun 16 10:35:00 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 886E016A469 for ; Sat, 16 Jun 2007 10:35:00 +0000 (UTC) (envelope-from frank@pinky.sax.de) Received: from pinky.frank-behrens.de (pinky.frank-behrens.de [82.139.199.24]) by mx1.freebsd.org (Postfix) with ESMTP id CB30A13C4C1 for ; Sat, 16 Jun 2007 10:34:59 +0000 (UTC) (envelope-from frank@pinky.sax.de) Received: from [192.168.20.32] (sun.behrens [192.168.20.32]) by pinky.frank-behrens.de (8.14.1/8.14.1) with ESMTP-MSA id l5GAYhAm063235 (version=TLSv1/SSLv3 cipher=DES-CBC3-SHA bits=168 verify=NO); Sat, 16 Jun 2007 12:34:43 +0200 (CEST) (envelope-from frank@pinky.sax.de) Message-Id: <200706161034.l5GAYhAm063235@pinky.frank-behrens.de> From: "Frank Behrens" To: Gergely CZUCZY Date: Sat, 16 Jun 2007 12:34:42 +0200 MIME-Version: 1.0 Priority: normal In-reply-to: <20070615171857.GA89955@harmless.hu> References: <200706151701.l5FH1KuJ047078@pinky.frank-behrens.de> X-mailer: Pegasus Mail for Windows (4.31, DE v4.31 R1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Hashcash: 1:24:070616:freebsd-threads@freebsd.org::bgPZBsZ4RCqKSzsp:0000000pCT6 X-Hashcash: 1:24:070616:phoemix@harmless.hu::544gpygsiv1ldcXD:Nc3L Cc: freebsd-threads@freebsd.org Subject: Re: Linking to pthread library: undefined reference X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2007 10:35:00 -0000 Gergely CZUCZY wrote on 15 Jun 2007 19:18: > On Fri, Jun 15, 2007 at 07:01:19PM +0200, Frank Behrens wrote: > > I try to link an milter (sendmail mail filter) test application and get an error I do not > > understand. I use FreeBSD 6.2-STABLE-200705211513 with an userland from May-03. > > In my Makefile I have: > > CFLAGS+= -I/usr/local/include -std=c99 -pthread -v > > LDADD+= -L/usr/local/lib -lmilter > > > > This gives linker command: > > cc -O2 -pipe -fno-strict-aliasing -march=pentium4 -I/usr/local/include -std=c99 -pthread -v -g - > > DDEBUG=1 -O1 -fno-omit-frame-pointer -Wsystem-headers -Wall -Wno-format-y2k -W - > > Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn- > > type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter - > > Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -o fmilter fmilter.o - > > L/usr/local/lib -lmilter > > Using built-in specs. > > Configured with: FreeBSD/i386 system compiler > > Thread model: posix > > gcc version 3.4.6 [FreeBSD] 20060305 > > /usr/bin/ld -V -dynamic-linker /libexec/ld-elf.so.1 -o fmilter /usr/lib/crt1.o /usr/lib/crti.o > > /usr/lib/crtbegin.o -L/usr/local/lib -L/usr/lib fmilter.o -lmilter -lgcc -lpthread -lc -lgcc > I don't think this is the problem here, but you should link against -pthread, and > not -lpthread. pthread is just an API here, while -pthread refers to the > system-default threading library (with a pthread interface). The -lpthread was added automatically, I used in CFLAGS -pthread only. > > /usr/lib/crtend.o /usr/lib/crtn.o > > GNU ld version 2.15 [FreeBSD] 2004-05-23 > > Supported emulations: > > elf_i386_fbsd > > /usr/lib/libmilter.so: undefined reference to `pthread_detach' > > > > In my opinion the symbol should be found in > > /usr/lib/libpthread.so@ -> /lib/libpthread.so.2 > > > > When I look into the libraries I see > > > objdump -T /usr/lib/libmilter.so | fgrep detach > > 00000000 D *UND* 00000000 pthread_detach > > > > > objdump -T /usr/lib/libpthread.so | fgrep pthread_detach > > 000077d4 w DF .text 000003a4 LIBTHREAD_1_0 pthread_detach > > 000077d4 g DF .text 000003a4 LIBTHREAD_1_0 _pthread_detach What does LIBPTHREAD_1_0 mean? Regards, Frank -- Frank Behrens, Osterwieck, Germany PGP-key 0x5B7C47ED on public servers available.