From owner-freebsd-performance@FreeBSD.ORG Wed Oct 29 15:55:30 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DA81065680 for ; Wed, 29 Oct 2008 15:55:30 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id 3CFDC8FC16 for ; Wed, 29 Oct 2008 15:55:30 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id EA3B3C57B for ; Wed, 29 Oct 2008 17:28:42 +0200 (EET) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 78626-01 for ; Wed, 29 Oct 2008 17:28:40 +0200 (EET) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id E664FC256 for ; Wed, 29 Oct 2008 17:28:39 +0200 (EET) Message-ID: <49088124.9050809@bulinfo.net> Date: Wed, 29 Oct 2008 17:28:36 +0200 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.14 (X11/20080616) MIME-Version: 1.0 To: freebsd-performance@freebsd.org X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net X-Mailman-Approved-At: Wed, 29 Oct 2008 16:00:30 +0000 Subject: thread switching time? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2008 15:55:30 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello All, I am using FreeBSD 7 and would like to decrease the time of switching between threads. This time seems to be 1ms and it is impossible to make lower delays inside a thread, at least using nanosleep(). Is it possible to decrease this time to 1us? Best Regards -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFJCIEkxJBWvpalMpkRAmKUAKCehUxakt83IvQ/QhW2n0BicWaQbQCeJW9z twONH5Eb9fA4JoQaYVk69os= =6xti -----END PGP SIGNATURE----- From owner-freebsd-performance@FreeBSD.ORG Wed Oct 29 18:06:01 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B02E106568B for ; Wed, 29 Oct 2008 18:06:01 +0000 (UTC) (envelope-from freebsd-performance@dfmm.org) Received: from dfmm.org (treehorn.dfmm.org [66.180.195.213]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDE08FC1A for ; Wed, 29 Oct 2008 18:06:00 +0000 (UTC) (envelope-from freebsd-performance@dfmm.org) Received: (qmail 89680 invoked by uid 1000); 29 Oct 2008 17:39:18 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 29 Oct 2008 17:39:18 -0000 Date: Wed, 29 Oct 2008 10:39:17 -0700 (PDT) From: Jason Stone X-X-Sender: jason@treehorn.dfmm.org To: Krassimir Slavchev In-Reply-To: <49088124.9050809@bulinfo.net> Message-ID: References: <49088124.9050809@bulinfo.net> User-Agent: Alpine 1.00 (BSF 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-performance@freebsd.org Subject: Re: thread switching time? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2008 18:06:01 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > I am using FreeBSD 7 and would like to decrease the time of switching > between threads. This time seems to be 1ms and it is impossible to make > lower delays inside a thread, at least using nanosleep(). > > Is it possible to decrease this time to 1us? Increase HZ, with the usual caveats about trading off latency for overhead? -Jason -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) Comment: See https://private.idealab.com/public/jason/jason.gpg iD8DBQFJCJ/FswXMWWtptckRAsdSAKCu2TF1LaqyR0JTuZX3oZD8S3H+cQCg8xoa 78qzo/mZ9klKhotTn4kJTkw= =6fXj -----END PGP SIGNATURE----- From owner-freebsd-performance@FreeBSD.ORG Thu Oct 30 07:34:28 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCAD6106567A for ; Thu, 30 Oct 2008 07:34:28 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id 916D08FC08 for ; Thu, 30 Oct 2008 07:34:28 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id 988CCC988; Thu, 30 Oct 2008 09:34:26 +0200 (EET) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03321-09; Thu, 30 Oct 2008 09:34:23 +0200 (EET) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id DECD8C936; Thu, 30 Oct 2008 09:34:23 +0200 (EET) Message-ID: <4909637E.3030802@bulinfo.net> Date: Thu, 30 Oct 2008 09:34:22 +0200 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.14 (X11/20080616) MIME-Version: 1.0 To: Jason Stone References: <49088124.9050809@bulinfo.net> In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net X-Mailman-Approved-At: Thu, 30 Oct 2008 11:22:16 +0000 Cc: freebsd-performance@freebsd.org Subject: Re: thread switching time? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2008 07:34:28 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jason Stone wrote: > >> I am using FreeBSD 7 and would like to decrease the time of switching >> between threads. This time seems to be 1ms and it is impossible to >> make lower delays inside a thread, at least using nanosleep(). > >> Is it possible to decrease this time to 1us? > > Increase HZ, with the usual caveats about trading off latency for overhead? > > > -Jason > I have: kern.clockrate: { hz = 4000, tick = 250, profhz = 4000, stathz = 129 } but no difference. Yes, overheads are lower and my application's performance is better but thread switching time is same. AFAIR I have read somewhere on the Internet about such problem when playing multiple video files and the solution was to change some parameters somewhere in header files but I cannot find this again. Best Regards -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFJCWN+xJBWvpalMpkRAt+qAKCjoLVyUZdbf91nqrgSj0nOhiGOhQCfYaqv IijZrwPCRYJmBUGHb2WI9IA= =uv12 -----END PGP SIGNATURE----- From owner-freebsd-performance@FreeBSD.ORG Fri Oct 31 04:04:38 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 814331065674 for ; Fri, 31 Oct 2008 04:04:38 +0000 (UTC) (envelope-from xiazhongqi@huawei.com) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [119.145.14.67]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9298FC13 for ; Fri, 31 Oct 2008 04:04:38 +0000 (UTC) (envelope-from xiazhongqi@huawei.com) Received: from huawei.com (szxga04-in [172.24.2.12]) by szxga04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0K9L002KY46W96@szxga04-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 11:54:32 +0800 (CST) Received: from huawei.com ([172.24.1.18]) by szxga04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0K9L00ADW46WDC@szxga04-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 11:54:32 +0800 (CST) Received: from x49105 ([10.111.9.47]) by szxml03-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTPA id <0K9L00C3C46VMH@szxml03-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 11:54:32 +0800 (CST) Date: Fri, 31 Oct 2008 11:54:31 +0800 From: Sam Xia In-reply-to: <20081030120020.838891065756@hub.freebsd.org> To: freebsd-performance@freebsd.org Message-id: <000001c93b0c$6195e6b0$2f096f0a@china.huawei.com> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Mailer: Microsoft Office Outlook 11 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Thread-index: Ack6hx2y1kc6vLmCRpqWGwpYRVqZJAAhFx+Q Cc: krassi@bulinfo.net Subject: 1. thread switching time? (Krassimir Slavchev) X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 04:04:38 -0000 hi krassi, what kind of hardware are you using? Actually because of process/thread scheduling mechanism, timing granulariy is coarse in FreeBSD(more than 10 ms) S.X > -----Original Message----- > From: owner-freebsd-performance@freebsd.org > [mailto:owner-freebsd-performance@freebsd.org] On Behalf Of > freebsd-performance-request@freebsd.org > Sent: Thursday, October 30, 2008 8:00 PM > To: freebsd-performance@freebsd.org > Subject: freebsd-performance Digest, Vol 68, Issue 4 > > Message: 1 > Date: Wed, 29 Oct 2008 17:28:36 +0200 > From: Krassimir Slavchev > Subject: thread switching time? > To: freebsd-performance@freebsd.org > Message-ID: <49088124.9050809@bulinfo.net> > Content-Type: text/plain; charset=ISO-8859-1 > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello All, > > I am using FreeBSD 7 and would like to decrease the time of > switching between threads. This time seems to be 1ms and it > is impossible to make lower delays inside a thread, at least > using nanosleep(). > > Is it possible to decrease this time to 1us? > > > Best Regards > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (FreeBSD) > > iD8DBQFJCIEkxJBWvpalMpkRAmKUAKCehUxakt83IvQ/QhW2n0BicWaQbQCeJW9z > twONH5Eb9fA4JoQaYVk69os= > =6xti > -----END PGP SIGNATURE----- > > > ************************************************** > From owner-freebsd-performance@FreeBSD.ORG Fri Oct 31 04:08:06 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 276591065677 for ; Fri, 31 Oct 2008 04:08:06 +0000 (UTC) (envelope-from xiazhongqi@huawei.com) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [119.145.14.65]) by mx1.freebsd.org (Postfix) with ESMTP id D78328FC08 for ; Fri, 31 Oct 2008 04:07:55 +0000 (UTC) (envelope-from xiazhongqi@huawei.com) Received: from huawei.com (szxga02-in [172.24.2.6]) by szxga02-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0K9L00N1C4BT43@szxga02-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 11:57:29 +0800 (CST) Received: from huawei.com ([172.24.1.24]) by szxga02-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0K9L000RS4BT3Y@szxga02-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 11:57:29 +0800 (CST) Received: from x49105 ([10.111.9.47]) by szxml04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTPA id <0K9L007RE4BS98@szxml04-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 11:57:29 +0800 (CST) Date: Fri, 31 Oct 2008 11:57:28 +0800 From: Sam Xia In-reply-to: <20081030120020.838891065756@hub.freebsd.org> To: freebsd-performance@freebsd.org Message-id: <000101c93b0c$cb3a6d20$2f096f0a@china.huawei.com> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Mailer: Microsoft Office Outlook 11 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Thread-index: Ack6hx2y1kc6vLmCRpqWGwpYRVqZJAAhVE0w X-Mailman-Approved-At: Fri, 31 Oct 2008 04:53:47 +0000 Subject: RE: freebsd-performance Digest, Vol 68, Issue 4 X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 04:08:06 -0000 hi all, Someone had ever told me that select-based timing thread is more accurate than signal-based timer. But I don't know the real reason. Anyone could give me some tips? Best Regards, Sam Xia From owner-freebsd-performance@FreeBSD.ORG Fri Oct 31 07:32:13 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D931065670 for ; Fri, 31 Oct 2008 07:32:13 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id C48C38FC12 for ; Fri, 31 Oct 2008 07:32:12 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id D87E1CAAD; Fri, 31 Oct 2008 09:32:10 +0200 (EET) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 67204-06; Fri, 31 Oct 2008 09:32:10 +0200 (EET) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id 12B62CAAA; Fri, 31 Oct 2008 09:32:10 +0200 (EET) Message-ID: <490AB477.2080001@bulinfo.net> Date: Fri, 31 Oct 2008 09:32:07 +0200 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.14 (X11/20080616) MIME-Version: 1.0 To: Sam Xia References: <000001c93b0c$6195e6b0$2f096f0a@china.huawei.com> In-Reply-To: <000001c93b0c$6195e6b0$2f096f0a@china.huawei.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net Cc: freebsd-performance@freebsd.org Subject: Re: 1. thread switching time? (Krassimir Slavchev) X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 07:32:13 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Sam Xia wrote: > hi krassi, > > what kind of hardware are you using? Actually because of process/thread > scheduling mechanism, timing granulariy is coarse in FreeBSD(more than 10 > ms) dmesg: ... CPU: Intel(R) Core(TM)2 CPU E8400 @ 3.00GHz (3005.25-MHz 686-class CPU) ... Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 acpi_hpet0: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 900 ... The hardware is fast enough! Also, I am able to set HZ=100000 but the thread switching time is still ~1ms. Best Regards > > S.X >> -----Original Message----- >> From: owner-freebsd-performance@freebsd.org >> [mailto:owner-freebsd-performance@freebsd.org] On Behalf Of >> freebsd-performance-request@freebsd.org >> Sent: Thursday, October 30, 2008 8:00 PM >> To: freebsd-performance@freebsd.org >> Subject: freebsd-performance Digest, Vol 68, Issue 4 > >> Message: 1 >> Date: Wed, 29 Oct 2008 17:28:36 +0200 >> From: Krassimir Slavchev >> Subject: thread switching time? >> To: freebsd-performance@freebsd.org >> Message-ID: <49088124.9050809@bulinfo.net> >> Content-Type: text/plain; charset=ISO-8859-1 >> > Hello All, > > I am using FreeBSD 7 and would like to decrease the time of > switching between threads. This time seems to be 1ms and it > is impossible to make lower delays inside a thread, at least > using nanosleep(). > > Is it possible to decrease this time to 1us? > > > Best Regards >> >> ************************************************** >> > _______________________________________________ > freebsd-performance@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-performance > To unsubscribe, send any mail to "freebsd-performance-unsubscribe@freebsd.org" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFJCrR3xJBWvpalMpkRAq8aAJ9F/n9mX94h46Rb4kHOBo9kDMUjzQCgmcZQ Yuum1rMnhaKICE+FKC6n294= =y2hp -----END PGP SIGNATURE----- From owner-freebsd-performance@FreeBSD.ORG Fri Oct 31 08:12:59 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7AF61065674 for ; Fri, 31 Oct 2008 08:12:59 +0000 (UTC) (envelope-from prvs=julian=183d0fe36@elischer.org) Received: from smtp-outbound.ironport.com (smtp-outbound.ironport.com [63.251.108.112]) by mx1.freebsd.org (Postfix) with ESMTP id D70048FC18 for ; Fri, 31 Oct 2008 08:12:59 +0000 (UTC) (envelope-from prvs=julian=183d0fe36@elischer.org) Received: from unknown (HELO julian-mac.elischer.org) ([10.251.60.128]) by smtp-outbound.ironport.com with ESMTP; 31 Oct 2008 00:44:18 -0700 Message-ID: <490AB750.9040505@elischer.org> Date: Fri, 31 Oct 2008 00:44:16 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.17 (Macintosh/20080914) MIME-Version: 1.0 To: Krassimir Slavchev References: <000001c93b0c$6195e6b0$2f096f0a@china.huawei.com> <490AB477.2080001@bulinfo.net> In-Reply-To: <490AB477.2080001@bulinfo.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-performance@freebsd.org, Sam Xia Subject: Re: 1. thread switching time? (Krassimir Slavchev) X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 08:13:00 -0000 Krassimir Slavchev wrote: > > Also, I am able to set HZ=100000 but the thread switching time is still > ~1ms. You must be talking about the time that a thread can run before it is pushed out by other threads? I know I've seem many x 10,000 context switches in some cases, i.e. look at very high interrupt rates etc. so I guess I'm not sure what you are measuring.. at one time the scheduling quantum was independent of Hz. I am not sure how true that is now.. From owner-freebsd-performance@FreeBSD.ORG Fri Oct 31 09:04:09 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 805311065670 for ; Fri, 31 Oct 2008 09:04:09 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id 399118FC1B for ; Fri, 31 Oct 2008 09:04:09 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id 98B76CAAD; Fri, 31 Oct 2008 11:04:07 +0200 (EET) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 72124-10; Fri, 31 Oct 2008 11:04:06 +0200 (EET) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id C4FF1CA4C; Fri, 31 Oct 2008 11:04:06 +0200 (EET) Message-ID: <490ACA04.6060203@bulinfo.net> Date: Fri, 31 Oct 2008 11:04:04 +0200 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.14 (X11/20080616) MIME-Version: 1.0 To: Julian Elischer References: <000001c93b0c$6195e6b0$2f096f0a@china.huawei.com> <490AB477.2080001@bulinfo.net> <490AB750.9040505@elischer.org> In-Reply-To: <490AB750.9040505@elischer.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net Cc: freebsd-performance@freebsd.org, Sam Xia Subject: Re: 1. thread switching time? (Krassimir Slavchev) X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 09:04:09 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello Julian, Julian Elischer wrote: > Krassimir Slavchev wrote: > >> >> Also, I am able to set HZ=100000 but the thread switching time is still >> ~1ms. > > You must be talking about the time that a thread can run before it is > pushed out by other threads? I know I've seem many x 10,000 context > switches in some cases, i.e. look at very high interrupt rates > etc. so I guess I'm not sure what you are measuring.. Okay, I have a thread with: while(1) { clock_gettime(CLOCK_REALTIME, &tv); nanosleep(&delay, NULL); clock_gettime(CLOCK_REALTIME, &tv2); timespecsub(&tv2, &tv); } If the delay is configured to be 0 < delay < 1ms I always get ~1ms delay. Since nanosleep() is a cancellation point this means that the scheduler will switch to another thread. If the delay = 0 I get ~1600ns delay. Yes. You are right. This is "the time that a thread can run before it is pushed out by other threads". Is there a way to decrease this time? > > at one time the scheduling quantum was independent of Hz. > I am not sure how true that is now.. > It seems to be independent of HZ. Best Regards > > _______________________________________________ > freebsd-performance@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-performance > To unsubscribe, send any mail to > "freebsd-performance-unsubscribe@freebsd.org" > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFJCsoDxJBWvpalMpkRAteuAJ9Jd8ICvPSiWB/4eGquUunoclpeXgCgjqyE vBXA0vGoRgsQ9eHZ/YwR/lw= =AjjC -----END PGP SIGNATURE----- From owner-freebsd-performance@FreeBSD.ORG Fri Oct 31 10:03:42 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 779DC106568E for ; Fri, 31 Oct 2008 10:03:42 +0000 (UTC) (envelope-from xiazhongqi@huawei.com) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [119.145.14.67]) by mx1.freebsd.org (Postfix) with ESMTP id 279FB8FC1A for ; Fri, 31 Oct 2008 10:03:42 +0000 (UTC) (envelope-from xiazhongqi@huawei.com) Received: from huawei.com (szxga04-in [172.24.2.12]) by szxga04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0K9L00BOSL79F3@szxga04-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 18:01:57 +0800 (CST) Received: from huawei.com ([172.24.1.18]) by szxga04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0K9L004OCL7996@szxga04-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 18:01:57 +0800 (CST) Received: from x49105 ([10.111.9.47]) by szxml03-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTPA id <0K9L009OXL78MQ@szxml03-in.huawei.com> for freebsd-performance@freebsd.org; Fri, 31 Oct 2008 18:01:57 +0800 (CST) Date: Fri, 31 Oct 2008 18:01:56 +0800 From: Sam Xia In-reply-to: <490ACA04.6060203@bulinfo.net> To: 'Krassimir Slavchev' Message-id: <000001c93b3f$b5767eb0$2f096f0a@china.huawei.com> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Mailer: Microsoft Office Outlook 11 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Thread-index: Ack7OBj56+fgECyVQWyLWHTqoCSRMAABuJeA Cc: freebsd-performance@freebsd.org Subject: RE: 1. thread switching time? (Krassimir Slavchev) X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 10:03:42 -0000 hi Krassimir, The smallest time quatum moving a thread from sleep queue to ready queue is equal to one tick(about 1 ms). This is dependent of os scheduling mechanism. Even the delay of nanosleep is less than 1 ms, actually 1 ms is the smallest unit. I guess you should modify the kernel and add clock intr frequency. BR, Sam.Xia > -----Original Message----- > From: Krassimir Slavchev [mailto:krassi@bulinfo.net] > Sent: Friday, October 31, 2008 5:04 PM > To: Julian Elischer > Cc: freebsd-performance@freebsd.org; Sam Xia > Subject: Re: 1. thread switching time? (Krassimir Slavchev) > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello Julian, > > Julian Elischer wrote: > > Krassimir Slavchev wrote: > > > >> > >> Also, I am able to set HZ=100000 but the thread switching time is > >> still ~1ms. > > > > You must be talking about the time that a thread can run > before it is > > pushed out by other threads? I know I've seem many x > 10,000 context > > switches in some cases, i.e. look at very high interrupt > rates etc. so > > I guess I'm not sure what you are measuring.. > > Okay, I have a thread with: > > while(1) { > clock_gettime(CLOCK_REALTIME, &tv); > nanosleep(&delay, NULL); > clock_gettime(CLOCK_REALTIME, &tv2); > timespecsub(&tv2, &tv); > } > > If the delay is configured to be 0 < delay < 1ms I always get > ~1ms delay. > Since nanosleep() is a cancellation point this means that the > scheduler will switch to another thread. > If the delay = 0 I get ~1600ns delay. > > Yes. You are right. This is "the time that a thread can run > before it is pushed out by other threads". > > Is there a way to decrease this time? > > > > > at one time the scheduling quantum was independent of Hz. > > I am not sure how true that is now.. > > > > It seems to be independent of HZ. > > > Best Regards > > > > > _______________________________________________ > > freebsd-performance@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-performance > > To unsubscribe, send any mail to > > "freebsd-performance-unsubscribe@freebsd.org" > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (FreeBSD) > > iD8DBQFJCsoDxJBWvpalMpkRAteuAJ9Jd8ICvPSiWB/4eGquUunoclpeXgCgjqyE > vBXA0vGoRgsQ9eHZ/YwR/lw= > =AjjC > -----END PGP SIGNATURE----- > From owner-freebsd-performance@FreeBSD.ORG Fri Oct 31 16:08:50 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E8601065686 for ; Fri, 31 Oct 2008 16:08:50 +0000 (UTC) (envelope-from raykinsella78@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id 12E5B8FC12 for ; Fri, 31 Oct 2008 16:08:49 +0000 (UTC) (envelope-from raykinsella78@gmail.com) Received: by qw-out-2122.google.com with SMTP id 9so499986qwb.7 for ; Fri, 31 Oct 2008 09:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=L1tgdjPeKcZy1+tIOSqGdbyvKz2/yAnk+KrWSOuRwn8=; b=ZogmzCAFS8mbGGt00ZVF621A2yU6S9FTn9bfxWJDBNAylHXaR6BPwYRYZW5x4vAe7A mdlF8u7GnaUUu6j3Fovf20OQpa7YN/THtRVN1kQxTkz0gkYhciffptcJvEf/6ZrtCPix 3RSwk6y74VRSRGY0bvA2LJ32nR2H06s2PLj7Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=xe++wC3S0W0td4YPNbSEPr2I74qsi1XujH4RVymuWuEZsR6R0SLUxlEdS89Xa0PIYL mgj6jevlD+wVOlyccSzQgOawpKPt/W/ZKIi38Pi1VIIicqCPLiCHS4LQW/YGXDJHyLtj fGJCdbT4TFRIbNxpoD3TvHXtWis/TGQZDAioc= Received: by 10.215.14.13 with SMTP id r13mr1377843qai.109.1225468114984; Fri, 31 Oct 2008 08:48:34 -0700 (PDT) Received: by 10.214.59.13 with HTTP; Fri, 31 Oct 2008 08:48:34 -0700 (PDT) Message-ID: <584ec6bb0810310848q843ed24x3e16880be450a492@mail.gmail.com> Date: Fri, 31 Oct 2008 15:48:34 +0000 From: "Ray Kinsella" To: freebsd-performance@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Interrupt handling in 6.2 X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 16:08:50 -0000 Has anyone had any success performance tuning interrupt handling in 6.2 ? I know that there is a improved performance handling mechanism in 7.0 but I kinda stuck using 6.2. The performance of interrupt handling mechanism on 6.2 during "interrupt storms" is quiet poor, is there any anything I tweak to improve it ? Any documentation on the same ? Also I going to post this also in another list, but I tried using the PMCStat and kgmon to profile my interrupt handling kernel objects (ko's, loadable objects). To get a handle on the source of the issue. PMCStat supports profiling ko's in 7.0 but not 6.2, Kgmon suggests that profiling kernel objects should be possible in 6.2, but I have had no success with it. Any documentation I have seen suggests compiling the sources straight into the kernel rather than using ko's to profile, but this is not possible. Has anyone had any luck profiling ko's in 6.2. Thanks Ray Kinsella