From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUN6I-0007X3-NO for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUN6D-0001AY-TE for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:53:54 -0400 Received: from mx3-phx2.redhat.com ([209.132.183.24]:59436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUN6D-0001A9-KX for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:53:49 -0400 Date: Tue, 25 Aug 2015 18:53:43 -0400 (EDT) From: Paolo Bonzini Message-ID: <900309895.18985220.1440543223583.JavaMail.zimbra@redhat.com> In-Reply-To: <20150825193053.GA29063@flamenco> References: <1440375847-17603-1-git-send-email-cota@braap.org> <1440375847-17603-6-git-send-email-cota@braap.org> <55DA6DAE.9070105@redhat.com> <20150825023003.GB8880@flamenco> <20150825193053.GA29063@flamenco> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" Cc: mttcg@greensocs.com, mark burton , a rigo , qemu-devel@nongnu.org, guillaume delbergue , alex bennee , Frederic Konrad > > I just tested a fetch-and-swap+exp.backoff spinlock with usermode on a > > program that spawns N threads and each thread performs an 2**M atomic > > increments > > on the same variable. That is, a degenerate worst-case kind of contention. > > N varies from 1 to 64, and M=15 on all runs, 5 runs per experiment: > > > > http://imgur.com/XpYctyT > > With backoff, the per-access latency grows roughly linearly with the > > number of > > cores, i.e. this is scalable. The other two are clearly superlinear. > > Just tried MCS, CLH and ticket spinlocks (with and without backoff). > They take essentially forever for this (admittedly worst-case) test; [snip interesting stuff] Yeah, fair spinlocks in userspace wasn't a smart suggestion. :) Paolo