- Notifications
You must be signed in to change notification settings - Fork28
Commit5093857
committed
I tried to build PostgreSQL with the following step to see backends hung
during the regression test. The problem has been reproduced on two machinebut both of these are the same type of hardware and software. I also triedto recreate the problem on other machines, on older version of AIX but Icouldn't.After looked through pgsql-hackers mailing list, I focused on spin lockissue to solve the problem. The easiest and may not be the best solutionfor the problem is to give up HAS_TEST_AND_SET. This actually works.One another and better solution for the problem is to use _check_lock() and_clear_lock() as spin lock. Important thing here is to define S_UNLOCK()with _clear_lock(). This will solve the so called "Compiler bug" issuesomeone wrote on the mailing list.We have some other API such as cs(), compare_and_swap() and fetch_and_or()to do test and set on AIX, but any of these didn't solve my problem. Iwrote tiny testing program to see if we have any bug of these API of AIX,but I couldn't see any problem except for compare_and_swap(). It seems thatyou can not use compare_and_swap() for the purpose, as it would not work asspin lock on any SMP machines I tested. I don't know the reason why cs()nor fetch_and_or()/fetch_and_and() will not work with PostgreSQL on p690.These worked with my testing program on all machines I tested.Tomoyuki Niijima1 parent2232172 commit5093857
1 file changed
+3
-2
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
66 |
| - | |
| 66 | + | |
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| |||
439 | 439 |
| |
440 | 440 |
| |
441 | 441 |
| |
442 |
| - | |
| 442 | + | |
| 443 | + | |
443 | 444 |
| |
444 | 445 |
| |
445 | 446 |
| |
|
0 commit comments
Comments
(0)