From owner-freebsd-emulation@FreeBSD.ORG Mon Mar 7 13:24:13 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F0DAD1065670; Mon, 7 Mar 2011 13:24:13 +0000 (UTC) Date: Mon, 7 Mar 2011 13:24:13 +0000 From: Alexander Best To: Chagin Dmitry Message-ID: <20110307132413.GA72267@freebsd.org> References: <20110303212051.GA54978@freebsd.org> <20110304061328.GA4073@dchagin.static.corbina.ru> <20110304110843.GA65337@freebsd.org> <20110304174637.GA8522@dchagin.static.corbina.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110304174637.GA8522@dchagin.static.corbina.ru> Cc: freebsd-emulation@freebsd.org Subject: Re: regarding issues with futexes and multiple threads X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 13:24:14 -0000 On Fri Mar 4 11, Chagin Dmitry wrote: > On Fri, Mar 04, 2011 at 11:08:43AM +0000, Alexander Best wrote: > > On Fri Mar 4 11, Chagin Dmitry wrote: > > > On Thu, Mar 03, 2011 at 09:20:51PM +0000, Alexander Best wrote: > > > > hi there, > > > > > > > > i've been investigating this issue for quite a while now and simply wanted to > > > > post some measurements i did. > > > > > > > > basically there's a massive slowdown when a process triggers a lot of threads > > > > which are doing futex operations. the following example is from darren hart's > > > > futex test suite (performance/). the slowdown seems to SMP related. here are > > > > the measurements running with SMP enabled and with kern.smp.disabled=1: > > > > > > > > > > 1) slowdown is expected behaviour. > > > > even if the slowdown is to be expected, looking at the screenshot with the > > top(1) output it seems obvious that there are issues with the current futex > > implementation. > > > > why do you think it's a problem with the futexes? the screenshot was taken with only one flash site opened. so i assumed having so many npviewer instances in state futex and taking up so much ressources is not normaly behavior. i also added a few printf's at the end of the WAIT and WAKE cases in linux_futex.c. this showed that error is almost always != 0. i'll add a few more printf's, since a few futex related changes have been added to HEAD recently. maybe that reveals more details. cheers. alex > > > > 2) is it possible to run this test suite on FreeBSD? > > > > i used emulators/linux_dist-gentoo-stage3 to compile the testsuite and then ran > > it natively under freebsd. if you want to i can send you the file. it's > > > > futex_wait: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped > > > > ah, tests directly calls sys_futex syscall, so can't be used for umtx/futex comparison :) > It would be great to have the same set of tests to compare the linuxulator threads > and the native. > > -- > Have fun! > chd -- a13x