From owner-p4-projects@FreeBSD.ORG Fri Aug 11 17:20:47 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2D0E616A4E7; Fri, 11 Aug 2006 17:20:47 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F09F816A4E0; Fri, 11 Aug 2006 17:20:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B55443D78; Fri, 11 Aug 2006 17:20:42 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id C71CF46D3C; Fri, 11 Aug 2006 13:20:41 -0400 (EDT) Date: Fri, 11 Aug 2006 18:20:41 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200608111249.44686.jhb@freebsd.org> Message-ID: <20060811181817.C8215@fledge.watson.org> References: <200608111110.k7BBAxIO059339@repoman.freebsd.org> <20060811124027.K45647@fledge.watson.org> <20060811121314.GA85207@stud.fit.vutbr.cz> <200608111249.44686.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Divacky Roman , Perforce Change Reviews , Roman Divacky Subject: Re: PERFORCE change 103633 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2006 17:20:47 -0000 On Fri, 11 Aug 2006, John Baldwin wrote: >> I think the main problem (which is now fixed) was with this: >> >> copyin(addr, val1); >> if (val1 == val2) >> .... >> >> being non-atomic. On the other hand I tried to use other locks other then >> Giant and it didnt work. I hope to investigate that later. Now I have this >> working and my focus is elsewhere. > > No, what you have done is wrong. The idea of doing copyin() and then > compare is just plain not going to work. :) You will need to use casuptr() > or the like similar to the umtx code. This is assuming that a futex can be > manipulated from userland w/o entering the kernel. I assume that we can basically just do whatever Linux does here for synchronization... Robert N M Watson Computer Laboratory University of Cambridge