From owner-freebsd-current@FreeBSD.ORG Thu Feb 4 03:10:25 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 365661065676; Thu, 4 Feb 2010 03:10:25 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-pz0-f184.google.com (mail-pz0-f184.google.com [209.85.222.184]) by mx1.freebsd.org (Postfix) with ESMTP id F03538FC1A; Thu, 4 Feb 2010 03:10:24 +0000 (UTC) Received: by pzk14 with SMTP id 14so117347pzk.3 for ; Wed, 03 Feb 2010 19:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=m2pRwukvqbtjXfAU0FDJLQ9sf95hSXWEtDKTZvNKleE=; b=aSqPLabdlfoDoxLCgU8NcBWiXrBXxpfh8Znx0NeKna8wBEqcITopgmrpm+OKGCC0qh XR5Yym/3u4nEe6Q/oA2zGlzOCCVG6JELj0QjXA/3NG33CcVTgMrXiYeIadBdm5mRRjYY Va9JWm7HB9U4Mr3y1FIbLn25dutqDyB6GBS5o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lk6FdypsS81uj8cF7EYf8peJcXPjDkxTIbdiPGPZ1Y7PYz0sr8ajZ3e41pJXCkWds4 AFZdTaL5coz234t8PIx/AdtMFsHzvp8kWOwZ4+kdIV3NIxlZvVHrmLUmXpNkyu8lTItn X0ePux257TKySJ+LZ5HzW7q33ahWGNCFJam0w= MIME-Version: 1.0 Received: by 10.142.66.6 with SMTP id o6mr324929wfa.226.1265253024512; Wed, 03 Feb 2010 19:10:24 -0800 (PST) In-Reply-To: <4e6cba831002031543r391ba4c7m620868fe9cc044a8@mail.gmail.com> References: <20100128201520.6a114290@ernst.jennejohn.org> <117532D7-75B9-4BE8-A8B6-0A6761064B92@lakerest.net> <4e6cba831001290744m6067691ct489c61fe9cd28502@mail.gmail.com> <179b97fb1001291212p5b0829f2pea28ab36a85751cf@mail.gmail.com> <4e6cba831002011404h1b6b893cj2390bf0a7560a7f2@mail.gmail.com> <179b97fb1002011424p4a799ff6t8f6b39e6f4b66828@mail.gmail.com> <4e6cba831002022320u2bd5f325m6564556a1abcf4c5@mail.gmail.com> <179b97fb1002031002g617aee35uec79e3367b2ff7a5@mail.gmail.com> <4e6cba831002031543r391ba4c7m620868fe9cc044a8@mail.gmail.com> Date: Thu, 4 Feb 2010 03:10:24 +0000 Message-ID: <179b97fb1002031910q5889eb7fp3600059da191b3d3@mail.gmail.com> From: Brandon Gooch To: Giovanni Trematerra Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Attilio Rao , FreeBSD Current , Randall Stewart Subject: Re: A strange thing with yesterday's head.. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2010 03:10:25 -0000 On Wed, Feb 3, 2010 at 11:43 PM, Giovanni Trematerra wrote: >> Just tried it again (a few times) at r203430, with similar results. > > Hi Brandon, > did you update -STABLE? I meant -CURRENT! > Anyway, if you are updating -STABLE, please try the patch below. I > don't know if it applies on -STABLE, let me know. > > Thanks for your time. > > -- > Gianni > > --- head/sys/kern/kern_umtx.c =A0 2010/01/10 09:31:57 =A0 =A0 201991 > +++ head/sys/kern/kern_umtx.c =A0 2010/02/03 03:56:32 =A0 =A0 203414 > @@ -2526,6 +2526,12 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_busy(&uq->uq_key); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_unlock(&uq->uq_key); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* re-read the state, in case it changed = between the try-lock above > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* and the check below > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 state =3D fuword32(__DEVOLATILE(int32_t *, = &rwlock->rw_state)); > + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* set read contention bit */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0while ((state & wrflags) && !(state & URWL= OCK_READ_WAITERS)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0oldstate =3D casuword32(&r= wlock->rw_state, state, state | > URWLOCK_READ_WAITERS); > @@ -2658,6 +2664,12 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_busy(&uq->uq_key); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_unlock(&uq->uq_key); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* re-read the state, in case it changed = between the try-lock above > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* and the check below > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 state =3D fuword32(__DEVOLATILE(int32_t *, = &rwlock->rw_state)); > + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0while (((state & URWLOCK_WRITE_OWNER) || U= RWLOCK_READER_COUNT(state) !=3D 0) && > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (state & URWLOCK_WRITE_WAITER= S) =3D=3D 0) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0oldstate =3D casuword32(&r= wlock->rw_state, state, state | > URWLOCK_WRITE_WAITERS); > I rebuilt the kernel (and libthr for safe measure), recompiled my_thr.c, and reran it. It still seems to freak X out (noticeably Firefox) and the machine, even after 'my_thr' completes, just acts very strange. It's as if something never completely finishes its business -- I don't know exactly what I'm talking about though :) Am I testing this right? Am I rebuilding everything I should be? -Brandon