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 "Mon, 21 Jun 2010 17:21:36 EDT." References: <20100621211101.0405C5B3E@mail.bitblocks.com> From: Bakul Shah Date: Mon, 21 Jun 2010 14:47:47 -0700 Message-Id: <20100621214747.B07445B3E@mail.bitblocks.com> Subject: Re: [9fans] interesting timing tests Topicbox-Message-UUID: 3628c9a8-ead6-11e9-9d60-3106f5b1d025 On Mon, 21 Jun 2010 17:21:36 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.... > > perhaps. Is there a way to check this? Is there a way to completely shut off N processors and measure benchmark speed slow down as function of processor? > > How well does plan9 lock() scale with the number of processor? > > i think the question is, are there any spin locks that can become > unreasonablly contended as conf.nmach goes up. if so, i would > think that rather than finding the optimal solution to pessimal > use of spinlocks, we should look to optimize our use of spinlocks. I mentioned this as something to check but I wouldn't be surprised the problem is a combination of factors. So first you have to find out if this is the problem in your case before worrying about it. > the underlying assumption is that the contended case is rare. > if this is not the case, then spin locks are not a good choice. With 8 dual HT processors the probability has gone up quite a bit! And what will you replace spinlocks with? The underlying issue is contention due to sharing. If you can reduce sharing you can reduce contention. Backoff alg. seems promising because it can reduce memory access where it matters most. For tens & tens of processors or more, message passing is the only way but that would be a major redesign!