From owner-freebsd-threads@FreeBSD.ORG Tue Feb 20 22:29: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 1F0E716CAFA for ; Tue, 20 Feb 2007 22:29:20 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id D294013C494 for ; Tue, 20 Feb 2007 22:29:19 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.14.0/8.14.0/NETPLEX) with ESMTP id l1KMTHKK020421; Tue, 20 Feb 2007 17:29:17 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-3.0 (mail.ntplx.net [204.213.176.10]); Tue, 20 Feb 2007 17:29:17 -0500 (EST) Date: Tue, 20 Feb 2007 17:29:17 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Martin Blapp In-Reply-To: <20070220225303.V4139@godot.imp.ch> Message-ID: References: <20070220153632.E4139@godot.imp.ch> <20070220174221.B4139@godot.imp.ch> <20070220190347.C4139@godot.imp.ch> <20070220225303.V4139@godot.imp.ch> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: rob@debank.tv, freebsd-threads@freebsd.org Subject: Re: 6.2-Release and Clamd 0.90 with libpthread.so X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Feb 2007 22:29:20 -0000 On Tue, 20 Feb 2007, Martin Blapp wrote: > Hi, > >> Also try setting kern.threads.virtual_cpu=1 if you have >> more than 1 cpu (this will limit it to 1 KSE). > > Our boxes have 2 CPUs and HTT is activated. > > Interesting. With kern.threads.virtual_cpu=1 it works also > in the libpthread case, but while there are still some fork() calls > it works better. With kern.threads.virtual_cpu=2 it's slower. And > With kern.threads.virtual_cpu=4 its really slow. > > If I run clamd in foreground mode everything works as it should. > More interesting, the CPU load drops significantly (500-1000%) ! > > Something is seriosly broken here. Running in foreground with or without kern.threads.virtual_cpu adjusted? If running in foreground works regardless of kern.threads.virtual_cpu (there will still be some inefficiencies here because of the scheduler and KSE overhead/contention), then it is probably due to the application doing a fork() from a threaded application without doing an exec(). This is prohibited by POSIX and libpthread makes no attempt to allow it. -- DE