Received: from eggs.gnu.org ([2001:4830:134:3::10]:59321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNh8F-0007jF-Hz for qemu-devel@nongnu.org; Thu, 14 Jul 2016 09:56:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNh8B-0004tM-GM for qemu-devel@nongnu.org; Thu, 14 Jul 2016 09:56:51 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:33108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNh8B-0004tB-7H for qemu-devel@nongnu.org; Thu, 14 Jul 2016 09:56:47 -0400 Received: by mail-lf0-x244.google.com with SMTP id f93so5443486lfi.0 for ; Thu, 14 Jul 2016 06:56:46 -0700 (PDT) Sender: Paolo Bonzini References: <1468354426-837-1-git-send-email-sergey.fedorov@linaro.org> <1468354426-837-2-git-send-email-sergey.fedorov@linaro.org> <20160712231917.GA11378@flamenco> <57867F50.4030503@gmail.com> From: Paolo Bonzini Message-ID: <87335ff3-c78f-35e7-bc11-3823de603a85@redhat.com> Date: Thu, 14 Jul 2016 15:56:42 +0200 MIME-Version: 1.0 In-Reply-To: <57867F50.4030503@gmail.com> 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: Sergey Fedorov , "Emilio G. Cota" , Sergey Fedorov Cc: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, patches@linaro.org, mark.burton@greensocs.com, claudio.fontana@huawei.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, jan.kiszka@siemens.com, bobby.prani@gmail.com, fred.konrad@greensocs.com, =?UTF-8?Q?Alex_Benn=c3=a9e?= , rth@twiddle.net On 13/07/2016 19:50, Sergey Fedorov wrote: > 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. There are a few "gaurantee"s in the patch. If you decide to go with my own patch (http://article.gmane.org/gmane.comp.emulators.qemu/426431) for v4, please add a Signed-off-by: Paolo Bonzini Thanks, Paolo