forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf2db5f3
committed
Pad semaphores to avoid false sharing.
In a USE_UNNAMED_SEMAPHORES build, the default on Linux and FreeBSDsince commitecb0d20, we have an array of sem_t objects. Thisturned out to reduce performance compared to the previous defaultUSE_SYSV_SEMAPHORES on an 8 socket system. Testing showed that thelost performance could be regained by padding the array elements sothat they have their own cache lines. This matches what we do forsimilar hot arrays (see LWLockPadded, WALInsertLockPadded).Back-patch to 10, where unnamed semaphores were adopted as the defaultsemaphore interface on those operating systems.Author: Thomas MunroReviewed-by: Andres FreundReported-by: Mithun CyTested-by: Mithun Cy, Tom Lane, Thomas MunroDiscussion:https://postgr.es/m/CAD__OugYDM3O%2BdyZnnZSbJprSfsGFJcQ1R%3De59T3hcLmDug4_w%40mail.gmail.com1 parente0a2a4c commitf2db5f3
1 file changed
+8
-2
lines changedLines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 |
| |
45 | 51 |
| |
46 | 52 |
| |
47 |
| - | |
| 53 | + | |
48 | 54 |
| |
49 | 55 |
| |
50 |
| - | |
| 56 | + | |
51 | 57 |
| |
52 | 58 |
| |
53 | 59 |
| |
|
0 commit comments
Comments
(0)