Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Feb 2010 03:10:24 +0000
From:      Brandon Gooch <jamesbrandongooch@gmail.com>
To:        Giovanni Trematerra <giovanni.trematerra@gmail.com>
Cc:        Attilio Rao <attilio@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>, Randall Stewart <rrs@lakerest.net>
Subject:   Re: A strange thing with yesterday's head..
Message-ID:  <179b97fb1002031910q5889eb7fp3600059da191b3d3@mail.gmail.com>
In-Reply-To: <4e6cba831002031543r391ba4c7m620868fe9cc044a8@mail.gmail.com>
References:  <B4F940BE-04BD-4ACC-B686-21D61423D236@lakerest.net> <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>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, Feb 3, 2010 at 11:43 PM, Giovanni Trematerra
<giovanni.trematerra@gmail.com> 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   2010/01/10 09:31:57     201991
> +++ head/sys/kern/kern_umtx.c   2010/02/03 03:56:32     203414
> @@ -2526,6 +2526,12 @@
>                umtxq_busy(&uq->uq_key);
>                umtxq_unlock(&uq->uq_key);
>
> +               /*
> +                * re-read the state, in case it changed between the try-lock above
> +                * and the check below
> +                */
> +               state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state));
> +
>                /* set read contention bit */
>                while ((state & wrflags) && !(state & URWLOCK_READ_WAITERS)) {
>                        oldstate = casuword32(&rwlock->rw_state, state, state |
> URWLOCK_READ_WAITERS);
> @@ -2658,6 +2664,12 @@
>                umtxq_busy(&uq->uq_key);
>                umtxq_unlock(&uq->uq_key);
>
> +               /*
> +                * re-read the state, in case it changed between the try-lock above
> +                * and the check below
> +                */
> +               state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state));
> +
>                while (((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) &&
>                       (state & URWLOCK_WRITE_WAITERS) == 0) {
>                        oldstate = casuword32(&rwlock->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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?179b97fb1002031910q5889eb7fp3600059da191b3d3>