Re: Alpha tas() patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brent Verner <brent(at)rcfile(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Alpha tas() patch
Date: 2000-12-28 17:41:44
Message-ID: 5618.978025304@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Brent Verner <brent(at)rcfile(dot)org> writes:
> I see this with the version of TAS() that you recently suggested, but not
> with either of the versions I'd hacked up.

Hm. Your second version might incorrectly appear to work because it's
not checking for stq_c failure. The first one loops until it succeeds,
so if the deal is that stq_c might work sometimes but not always
(dependent on, say, cache miss effects) then that might explain why it
works. Clearly there's more here to worry about than the available
documentation suggests.

Awhile back I received some mail from a guy at Compaq saying that a
taken branch between ldq_l and stq_c is no good, apparently because some
versions of the processor will clear the lock register when any transfer
of control occurs. But it sounded like a not-taken conditional branch
is OK. Nonetheless, it's interesting that the
__INTERLOCKED_TESTBITSS_QUAD macro doesn't use any branch at all between
those two instructions. Maybe we should try it that way.

Is there any documentation on exactly what __INTERLOCKED_TESTBITSS_QUAD
is supposed to do? It looks like it's computing which bit to set in the
quadword, but I'm not sure I'm interpreting the code correctly.

I'm going to instrument my version a little more to see exactly which
step is failing ... I suspect it's the stq_c result test but want to
prove that before trying alternatives.

BTW, is your machine single- or multi-processor?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-12-28 17:57:26 Re: configure in snapshout == configure.in
Previous Message Jean-Louis Leroy 2000-12-28 17:32:01 Possible SELECT bug in 7.0.2

Browse pgsql-patches by date

  From Date Subject
Next Message Brent Verner 2000-12-28 21:10:56 Re: Alpha tas() patch
Previous Message Brent Verner 2000-12-28 16:54:58 Re: Alpha tas() patch