From owner-freebsd-current@FreeBSD.ORG Sun May 2 07:53:53 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2D2816A4CE for ; Sun, 2 May 2004 07:53:52 -0700 (PDT) Received: from out010.verizon.net (out010pub.verizon.net [206.46.170.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 507B043D60 for ; Sun, 2 May 2004 07:53:52 -0700 (PDT) (envelope-from Alex.Kovalenko@verizon.net) Received: from RabbitsDen ([141.153.222.228]) by out010.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20040502145351.USDO1910.out010.verizon.net@RabbitsDen> for ; Sun, 2 May 2004 09:53:51 -0500 Date: Sun, 2 May 2004 10:53:10 -0400 From: Alexandre "Sunny" Kovalenko To: freebsd-current@freebsd.org Message-Id: <20040502105310.365f91e3.Alex.Kovalenko@verizon.net> In-Reply-To: <40947B21.6030603@vigrid.com> References: <20040501122558.6139dec1.Alex.Kovalenko@verizon.net> <20040501204157.704fbc0d.Alex.Kovalenko@verizon.net> <40947B21.6030603@vigrid.com> Organization: Home X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out010.verizon.net from [141.153.222.228] at Sun, 2 May 2004 09:53:51 -0500 Subject: Re: Is it possible to make -lpthread program to use 100% CPU? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2004 14:53:53 -0000 On Sun, 02 May 2004 00:37:53 -0400 "Daniel M. Eischen" wrote: > Alexandre Sunny Kovalenko wrote: > > On Sat, 1 May 2004 14:49:47 -0400 (EDT) > > Daniel Eischen wrote: > > > > > >>On Sat, 1 May 2004, Alexandre Sunny Kovalenko wrote: > >> > >> > >>>On Thu, 29 Apr 2004 17:16:21 +0200 > >>>Ivan Voras wrote: > >>> > >>> > >>>>Alexandre Sunny Kovalenko wrote: > >>>> > >>>> > >>>>>Alternatively, if there is a need to test a patch or time a program > >>>>>in this environment, it could easily be accomplished -- it is a non- > >>>>>production box. > >>>> > >>>>Could you turn off Hyperthreading and report any changes? > >>>> > >>> > >>>I have updated my system to the latest CTM mailing on Friday (4/30) morning (EST). > >>>This includes version 1.176 of kern_thread.c. > >>> > >>>I have turned off hyperthreading and got result, which muddles me rather -- try > >>>as I might, with -lpthread I could not get past 50% CPU utilization (as reported > >>>by 'top') and number of computations per second matching that (number is very > >>>close to that for running single-threaded). Top report with thread view enabled > >>>shows that both KSE are bound to CPU 0 (if I am interpreting C column properly). > >> > >>Are you using system or process scope threads? > >> > >>-- > >>Dan Eischen > > > > Sorry, should have mentioned that too. For -lthr PTHREAD_SCOPE_PROCESS is only > > available option. For -lpthread I have tried both, and results do not differ > > much, which is what I expect on the machine that runs nothing else (unless > > I do not understand PTHREAD_SCOPE_ option). > > You need to use PTHREAD_SCOPE_SYSTEM in order to get another > scheduling quantum (kse group) for each thread under libpthread. > There's no way yet to tell the kernel which CPU should get > each thread, so they may be scheduled on the same CPU. > > What scheduler are you using? > > -- > Dan Eischen > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" I did mention this one ;) With older sources (kern_thread.c 1.175) I have tried both with the similar results. With the last update (last CTM from EST morning on Friday 4/30) I only tried _ULE. If you need me to try _4BSD, let me know. Just out of curiosity, if I have 64 threads and 4 CPUs would not result be the same with PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS, since I could not get more KSEGs then I have CPUs, and default is 8 threads per KSEG? Or am I totally off the mark? -- Alexandre "Sunny" Kovalenko.