From owner-freebsd-arch@FreeBSD.ORG Tue May 12 11:02:50 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9F9D1065696 for ; Tue, 12 May 2009 11:02:50 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1928FC0A for ; Tue, 12 May 2009 11:02:50 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id B87166D449; Tue, 12 May 2009 13:02:49 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 9D87D844BD; Tue, 12 May 2009 13:02:49 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jeff Roberson References: Date: Tue, 12 May 2009 13:02:49 +0200 In-Reply-To: (Jeff Roberson's message of "Mon, 11 May 2009 17:32:17 -1000 (HST)") Message-ID: <86bppy60ti.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org Subject: Re: lockless file descriptor lookup X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2009 11:02:51 -0000 Jeff Roberson writes: > I'd also appreciate it if someone could look at my volatile cast and > make sure I'm actually forcing the compiler to refresh the fd_ofiles > array here: > > + if (fp =3D=3D ((struct file *volatile*)fdp->fd_ofiles)[fd]) The problem is that since it is not declared as volatile, some other piece of code may have modified it but not yet flushed it to RAM. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no