From owner-p4-projects@FreeBSD.ORG Fri Aug 11 17:50:04 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 4136916A4E5; Fri, 11 Aug 2006 17:50:04 +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 E64E016A4DE; Fri, 11 Aug 2006 17:50:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AA9B43D46; Fri, 11 Aug 2006 17:50:03 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k7BHo0Hh082864; Fri, 11 Aug 2006 13:50:01 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Robert Watson Date: Fri, 11 Aug 2006 13:29:52 -0400 User-Agent: KMail/1.9.1 References: <200608111110.k7BBAxIO059339@repoman.freebsd.org> <200608111249.44686.jhb@freebsd.org> <20060811181817.C8215@fledge.watson.org> In-Reply-To: <20060811181817.C8215@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608111329.52886.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 11 Aug 2006 13:50:02 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1646/Fri Aug 11 05:51:17 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx 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:50:04 -0000 On Friday 11 August 2006 13:20, Robert Watson wrote: > 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... Yes, but my assumption is that it lets the easy cases just run in userland and only goes into the kernel for a hard case, so you need to use atomic ops such as casuptr(). -- John Baldwin