From owner-freebsd-threads@FreeBSD.ORG Tue Jul 6 21:22: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 805C016A4CE for ; Tue, 6 Jul 2004 21:22:24 +0000 (GMT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9CFF643D48 for ; Tue, 6 Jul 2004 21:22:23 +0000 (GMT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <2004070621222201100i7lkae>; Tue, 6 Jul 2004 21:22:22 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA67182; Tue, 6 Jul 2004 14:22:16 -0700 (PDT) Date: Tue, 6 Jul 2004 14:22:15 -0700 (PDT) From: Julian Elischer To: Daniel Eischen In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Andrew Gallatin cc: freebsd-threads@freebsd.org Subject: Re: pthread switch (was Odd KSE panic) 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, 06 Jul 2004 21:22:24 -0000 On Tue, 6 Jul 2004, Daniel Eischen wrote: > On Tue, 6 Jul 2004, Andrew Gallatin wrote: > > > > > Daniel Eischen writes: > > > Note that he is holding the mutex while calling pthread_cond_signal(). > > > If we enable preemption in pthread_cond_signal(), then I suspect it > > > would be even worse than without preemption. > > > > > > I think the only place where it is sane to enable preemption is > > > on pthread_mutex_unlock(). > > > > That certainly makes sense to me. But I don't want to see you > > optimize the threads lib just for my app. I can always put in an > > #ifdef FreeBSD > > pthread_yield() > > #endif > > > > But what I'm still wondering is where the ~3x slowdown (20usec linux > > -> ~60usec, libthr) is coming from. Is this a factor of the context > > switch time and ithreads? > > I suspect our kernel is butt-slow compared with Linux in general. > Mysql under native linux is similarly faster. It'd be interesting to see a kernel compiled with config -p and the result of the profiling.. (when nothing else is running.) I presume all teh debugging is turned off. > > > I need to move the driver to a fast interrupt and I need to test > > SCHED_BSD as well. I should probably cvs update to get jhb's > > scheduling changes. > > -- > Dan Eischen > >