From owner-freebsd-current@FreeBSD.ORG Tue May 17 20:16:25 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E78C21065673; Tue, 17 May 2011 20:16:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 89F4C8FC12; Tue, 17 May 2011 20:16:24 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA03539; Tue, 17 May 2011 23:16:22 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QMQgo-0007df-Gf; Tue, 17 May 2011 23:16:22 +0300 Message-ID: <4DD2D795.6020106@FreeBSD.org> Date: Tue, 17 May 2011 23:16:21 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: John Baldwin References: <4DCD357D.6000109@FreeBSD.org> <201105170958.16847.jhb@freebsd.org> <4DD28781.6050002@FreeBSD.org> <201105171151.18038.jhb@freebsd.org> In-Reply-To: <201105171151.18038.jhb@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Max Laier , FreeBSD current , neel@FreeBSD.org, Peter Grehan Subject: Re: proposed smp_rendezvous change X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 20:16:26 -0000 on 17/05/2011 18:51 John Baldwin said the following: > On Tuesday, May 17, 2011 10:34:41 am Andriy Gapon wrote: >> on 17/05/2011 16:58 John Baldwin said the following: >>> No, it doesn't quite work that way. It wouldn't work on Alpha for example. >>> >>> All load_acq is a load with a memory barrier to order other loads after it. >>> It is still free to load stale data. Only a read-modify-write operation >>> would actually block until it could access an up-to-date value. >> >> Hmm, ok. >> How about atomic_add_acq_int(&smp_rv_waiters[0], 0) ? :-) >> Or an equivalent MI action that doesn't actually change smp_rv_waiters[0] value, >> if there could be any. >> Maybe explicit atomic_cmpset_acq_int(&smp_rv_waiters[0], 0, 0) ? >> >> You see at what I am getting? > > Yeah, either of those would work. At this point just leaving the > atomic_add_int() as-is would be the smallest diff. :) Yes, I agree about the smallest diff. But if we are going to remove that first spin-loop, then we would effectively be wasting one volatile variable. Only a tiny waste, but it could be confusing. Whatever we decide, this was very educational for me. -- Andriy Gapon