From owner-freebsd-bugs Thu Oct 10 2:10: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0B5437B401 for ; Thu, 10 Oct 2002 02:10:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88D7143EAF for ; Thu, 10 Oct 2002 02:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9A9A3Co006193 for ; Thu, 10 Oct 2002 02:10:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9A9A2om006191; Thu, 10 Oct 2002 02:10:02 -0700 (PDT) Date: Thu, 10 Oct 2002 02:10:02 -0700 (PDT) Message-Id: <200210100910.g9A9A2om006191@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Alexander Popkov Subject: Re: kern/43887: abnormal CPU useage when use pthread_mutex Reply-To: Alexander Popkov Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/43887; it has been noted by GNATS. From: Alexander Popkov To: freebsd-gnats-submit@FreeBSD.org Cc: Jian Tang Subject: Re: kern/43887: abnormal CPU useage when use pthread_mutex Date: Thu, 10 Oct 2002 12:55:27 +0400 Hello Jian, Thursday, October 10, 2002, 12:15:24 PM, you wrote: JT> When I ran this program, I found that the usage of CPU is very high. JT> CPU states: 25.3% user, 0.0% nice, 71.6% system, 0.4% interrupt, 2.7% idle JT> To reduce the usage of CPU,I added the time of usleep. I found that when the time of usleep is large than 1000,the status of cpu came back normal. JT> CPU states: 0.0% user, 0.0% nice, 1.6% system, 0.4% interrupt, 98.1% idle JT> I guess this problem is caused by the scheduler of thread. Yes. FreeBSD 4.6 - too. [voodoo@alpha tmp]$ uname -a FreeBSD alpha.millenniumrise.ru 4.6-STABLE FreeBSD 4.6-STABLE #4: Thu Aug 8 17:01:06 MSD 2002 root@damn.millenniumrise.ru:/usr/obj/usr/src/sys/ALPHA i386 with usleep(800): -------------------------------- CPU states: 25.3% user, 0.0% nice, 70.8% system, 3.1% interrupt, 0.8% idle PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 4075 voodoo 39 0 1088K 564K RUN 0:09 71.58% 32.32% a.out with usleep(1100): -------------------------------- CPU states: 4.3% user, 0.0% nice, 1.2% system, 0.8% interrupt, 93.8% idle PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 4133 voodoo 2 0 1088K 564K RUN 0:00 0.00% 0.00% a.out -- Best regards, Alexander mailto:voodoo_alex@mail.ru To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message