From owner-cvs-src@FreeBSD.ORG Tue Jul 1 04:55:36 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 595E81065677; Tue, 1 Jul 2008 04:55:36 +0000 (UTC) (envelope-from vova@sw.ru) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id AF0A28FC2A; Tue, 1 Jul 2008 04:55:35 +0000 (UTC) (envelope-from vova@sw.ru) Received: from vbook.fbsd.ru ([10.24.21.170]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id m614e5QT007586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Jul 2008 08:40:06 +0400 (MSD) Received: from vova by vbook.fbsd.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1KDO7N-000G13-DF; Mon, 30 Jun 2008 22:28:49 +0400 From: Vladimir Grebenschikov To: David Xu In-Reply-To: <200806240737.m5O7bhc5018813@repoman.freebsd.org> References: <200806240737.m5O7bhc5018813@repoman.freebsd.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: SWsoft Date: Mon, 30 Jun 2008 22:28:44 +0400 Message-Id: <1214850524.42354.9.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, current@FreeBSD.org, cvs-all@FreeBSD.org Subject: [fwd] cvs commit: src/lib/libthr/thread thr_mutex.c thr_umtx.c thr_umtx.h src/sys/kern kern_umtx.c src/sys/sys umtx.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2008 04:55:36 -0000 On Tue, 2008-06-24 at 07:32 +0000, David Xu wrote: This commit makes threaded application almost unusable on 8-CURRENT. Applications eat 100% CPU all the time and works _very_ slowly. (top shows several threads for every constantly applications eating CPU) Following applications are affected for me: firefox, evolution, eclipse (probably more). Reverting user-land part of commit fixes problem, reverting kernel changes nothing regarding the problem. I have: FreeBSD 8.0-CURRENT #0: Fri Jun 20 17:14:23 MSD 2008 root@vbook.fbsd.ru:/usr/obj/usr/src/sys/VBOOK Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz (1995.01-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x6f6 Stepping = 6 Features=0xbfebfbff Features2=0xe3bd AMD Features=0x20100000 AMD Features2=0x1 Cores per package: 2 > davidxu 2008-06-24 07:32:12 UTC > > FreeBSD src repository > > Modified files: > lib/libthr/thread thr_mutex.c thr_umtx.c thr_umtx.h > sys/kern kern_umtx.c > sys/sys umtx.h > Log: > SVN rev 179970 on 2008-06-24 07:32:12Z by davidxu > > Add two commands to _umtx_op system call to allow a simple mutex to be > locked and unlocked completely in userland. by locking and unlocking mutex > in userland, it reduces the total time a mutex is locked by a thread, > in some application code, a mutex only protects a small piece of code, the > code's execution time is less than a simple system call, if a lock contention > happens, however in current implemenation, the lock holder has to extend its > locking time and enter kernel to unlock it, the change avoids this disadvantage, > it first sets mutex to free state and then enters kernel and wake one waiter > up. This improves performance dramatically in some sysbench mutex tests. > > Tested by: kris > Sounds great: jeff > > Revision Changes Path > 1.75 +33 -35 src/lib/libthr/thread/thr_mutex.c > 1.17 +60 -10 src/lib/libthr/thread/thr_umtx.c > 1.14 +13 -9 src/lib/libthr/thread/thr_umtx.h > 1.71 +142 -35 src/sys/kern/kern_umtx.c > 1.33 +3 -1 src/sys/sys/umtx.h > _______________________________________________ > cvs-src@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/cvs-src > To unsubscribe, send any mail to "cvs-src-unsubscribe@freebsd.org" -- Vladimir B. Grebenschikov vova@fbsd.ru