- Notifications
You must be signed in to change notification settings - Fork5
Commitdaa7527
committed
Reduce the number of semaphores used under --disable-spinlocks.
Instead of allocating a semaphore from the operating system for everyspinlock, allocate a fixed number of semaphores (by default, 1024)from the operating system and multiplex all the spinlocks that getcreated onto them. This could self-deadlock if a process attemptedto acquire more than one spinlock at a time, but since processesaren't supposed to execute anything other than short stretches ofstraight-line code while holding a spinlock, that shouldn't happen.One motivation for this change is that, with the introduction ofdynamic shared memory, it may be desirable to create spinlocks thatlast for less than the lifetime of the server. Without this change,attempting to use such facilities under --disable-spinlocks wouldquickly exhaust any supply of available semaphores. Quite apartfrom that, it's desirable to contain the quantity of semaphoresneeded to run the server simply on convenience grounds, since usingtoo many may make it harder to get PostgreSQL running on a newplatform, which is mostly the point of --disable-spinlocks in thefirst place.Patch by me; review by Tom Lane.1 parent3739e5a commitdaa7527
File tree
7 files changed
+74
-23
lines changed- src
- backend
- postmaster
- storage
- ipc
- lmgr
- include
- storage
7 files changed
+74
-23
lines changedLines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
| 474 | + | |
| 475 | + | |
| 476 | + | |
474 | 477 |
| |
475 | 478 |
| |
476 | 479 |
| |
| |||
5626 | 5629 |
| |
5627 | 5630 |
| |
5628 | 5631 |
| |
| 5632 | + | |
| 5633 | + | |
| 5634 | + | |
5629 | 5635 |
| |
5630 | 5636 |
| |
5631 | 5637 |
| |
| |||
5854 | 5860 |
| |
5855 | 5861 |
| |
5856 | 5862 |
| |
| 5863 | + | |
| 5864 | + | |
| 5865 | + | |
5857 | 5866 |
| |
5858 | 5867 |
| |
5859 | 5868 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
| 108 | + | |
108 | 109 |
| |
109 | 110 |
| |
110 | 111 |
| |
|
Lines changed: 18 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
119 |
| - | |
120 |
| - | |
121 |
| - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
122 | 137 |
| |
123 | 138 |
| |
124 | 139 |
| |
|
Lines changed: 31 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
32 | 44 |
| |
33 | 45 |
| |
34 | 46 |
| |
| |||
52 | 64 |
| |
53 | 65 |
| |
54 | 66 |
| |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
71 | 81 |
| |
72 | 82 |
| |
73 | 83 |
| |
| |||
77 | 87 |
| |
78 | 88 |
| |
79 | 89 |
| |
80 |
| - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
81 | 93 |
| |
82 | 94 |
| |
83 | 95 |
| |
84 | 96 |
| |
85 | 97 |
| |
86 |
| - | |
| 98 | + | |
87 | 99 |
| |
88 | 100 |
| |
89 | 101 |
| |
| |||
98 | 110 |
| |
99 | 111 |
| |
100 | 112 |
| |
101 |
| - | |
| 113 | + | |
102 | 114 |
| |
103 | 115 |
| |
104 | 116 |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 |
| |
60 | 68 |
| |
61 | 69 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
915 | 915 |
| |
916 | 916 |
| |
917 | 917 |
| |
918 |
| - | |
| 918 | + | |
919 | 919 |
| |
920 | 920 |
| |
921 | 921 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 |
| |
73 | 79 |
|
0 commit comments
Comments
(0)