From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Fri, 18 Jun 2010 19:26:25 EDT." References: From: Bakul Shah Date: Mon, 21 Jun 2010 14:11:00 -0700 Message-Id: <20100621211101.0405C5B3E@mail.bitblocks.com> Subject: Re: [9fans] interesting timing tests Topicbox-Message-UUID: 3618b892-ead6-11e9-9d60-3106f5b1d025 On Fri, 18 Jun 2010 19:26:25 EDT erik quanstrom wrote: > note the extreme system time on the 16 processor machine Could this be due to memory contention caused by spinlocks? While locks are spinning they eat up memory bandwidth which slows down everyone's memory accesses (including the one who is trying to finish its work while holding the spinlock). And the more processors contend, the worse it gets.... How well does plan9 lock() scale with the number of processor? Since this is analogous to accessing a CSMA network, one can use a similar algorithm to ameliorate the bandwidth problem: if you didn't get the lock, assume it will be a little while before you can get it so you might as well backoff. There is an old paper that talks about this. Or it could simply be due to caching behaviour, if everyone is accessing/mutating the same pages at the same time.