From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNOIc-0005RQ-FP for qemu-devel@nongnu.org; Wed, 13 Jul 2016 13:50:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNOIY-0007m5-Pq for qemu-devel@nongnu.org; Wed, 13 Jul 2016 13:50:17 -0400 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:32789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNOIY-0007m1-Ih for qemu-devel@nongnu.org; Wed, 13 Jul 2016 13:50:14 -0400 Received: by mail-lf0-x236.google.com with SMTP id b199so45058822lfe.0 for ; Wed, 13 Jul 2016 10:50:14 -0700 (PDT) References: <1468354426-837-1-git-send-email-sergey.fedorov@linaro.org> <1468354426-837-2-git-send-email-sergey.fedorov@linaro.org> <20160712231917.GA11378@flamenco> From: Sergey Fedorov Message-ID: <57867F50.4030503@gmail.com> Date: Wed, 13 Jul 2016 20:50:08 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 01/11] util/qht: Document memory ordering assumptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Emilio G. Cota" , Sergey Fedorov Cc: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, patches@linaro.org, jan.kiszka@siemens.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, bobby.prani@gmail.com, rth@twiddle.net, =?UTF-8?Q?Alex_Benn=c3=a9e?= , fred.konrad@greensocs.com On 13/07/16 10:36, Paolo Bonzini wrote: > > On 13/07/2016 01:19, Emilio G. Cota wrote: >> I wouldn't put those comments in the source--seqlock callers should >> know what they're doing, and what barriers seqlocks imply. > In general I'd agree with you, however in this case the "begin" calls > are what implements QHT's guarantee *for the caller*, so I think it's > worth having the comments. In other words, if for any reason you do > anything before the read_begin and write_begin you still have to provide > barrier semantics. It's not an explanation, it's a protection against > future mistakes. Exactly :) > There's no need for such comment at read_retry and write_end callsites, > though. Why? > Also, it's spelled "guarantee". :) Hmm, I can't see where the spelling isn't correct. Thanks, Sergey