forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3761fe3
committed
Simplify LWLock tranche machinery by removing array_base/array_stride.
array_base and array_stride were added so that we could identify theoffset of an LWLock within a tranche, but this facility is only verymarginally used apart from the main tranche. So, give every lock inthe main tranche its own tranche ID and get rid of array_base,array_stride, and all that's attached. For debugging facilities(Trace_lwlocks and LWLOCK_STATS) print the pointer address of theLWLock using %p instead of the offset. This is arguably more useful,and certainly a lot cheaper. Drop the offset-within-tranche fromthe information reported to dtrace and from one can't-happen messageinside lwlock.c.The main user-visible impact of this change is that pg_stat_activitywill now report all waits for LWLocks as "LWLock" rather thanreporting some as "LWLockTranche" and others as "LWLockNamed".The main motivation for this change is that the need to specify anarray_base and an array_stride is awkward for parallel query. Thereis only a very limited supply of tranche IDs so we can't just keepallocating new ones, and if we try to use the same tranche IDs everytime then we run into trouble when multiple parallel contexts areuse simultaneously. So if we didn't get rid of this mechanism we'dhave to make it even more complicated. By simplifying it in thisway, we instead reduce the size of the generated code for lwlock.cby about 5%.Discussion:http://postgr.es/m/CA+TgmoYsFn6NUW1x0AZtupJGUAs1UDY4dJtCN47_Q6D0sP80PA@mail.gmail.com1 parent4e344c2 commit3761fe3
File tree
14 files changed
+112
-261
lines changed- doc/src/sgml
- src
- backend
- access/transam
- postmaster
- replication
- logical
- storage
- buffer
- ipc
- lmgr
- utils
- mmgr
- include
- access
- storage
14 files changed
+112
-261
lines changedLines changed: 19 additions & 33 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
646 | 646 |
| |
647 | 647 |
| |
648 | 648 |
| |
649 |
| - | |
650 |
| - | |
651 |
| - | |
652 |
| - | |
653 |
| - | |
654 |
| - | |
655 |
| - | |
656 |
| - | |
657 |
| - | |
658 |
| - | |
659 |
| - | |
660 |
| - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
661 | 654 |
| |
662 | 655 |
| |
663 | 656 |
| |
| |||
825 | 818 |
| |
826 | 819 |
| |
827 | 820 |
| |
828 |
| - | |
| 821 | + | |
829 | 822 |
| |
830 | 823 |
| |
831 | 824 |
| |
| |||
1011 | 1004 |
| |
1012 | 1005 |
| |
1013 | 1006 |
| |
1014 |
| - | |
1015 | 1007 |
| |
1016 | 1008 |
| |
1017 | 1009 |
| |
| |||
1279 | 1271 |
| |
1280 | 1272 |
| |
1281 | 1273 |
| |
1282 |
| - | |
| 1274 | + | |
1283 | 1275 |
| |
1284 | 1276 |
| |
1285 | 1277 |
| |
| |||
3347 | 3339 |
| |
3348 | 3340 |
| |
3349 | 3341 |
| |
3350 |
| - | |
| 3342 | + | |
3351 | 3343 |
| |
3352 | 3344 |
| |
3353 |
| - | |
3354 |
| - | |
| 3345 | + | |
3355 | 3346 |
| |
3356 | 3347 |
| |
3357 | 3348 |
| |
3358 |
| - | |
| 3349 | + | |
3359 | 3350 |
| |
3360 | 3351 |
| |
3361 |
| - | |
3362 |
| - | |
| 3352 | + | |
3363 | 3353 |
| |
3364 | 3354 |
| |
3365 | 3355 |
| |
3366 |
| - | |
| 3356 | + | |
3367 | 3357 |
| |
3368 | 3358 |
| |
3369 | 3359 |
| |
3370 |
| - | |
3371 |
| - | |
| 3360 | + | |
3372 | 3361 |
| |
3373 | 3362 |
| |
3374 | 3363 |
| |
3375 |
| - | |
| 3364 | + | |
3376 | 3365 |
| |
3377 | 3366 |
| |
3378 | 3367 |
| |
3379 |
| - | |
3380 |
| - | |
| 3368 | + | |
3381 | 3369 |
| |
3382 | 3370 |
| |
3383 | 3371 |
| |
3384 |
| - | |
| 3372 | + | |
3385 | 3373 |
| |
3386 | 3374 |
| |
3387 | 3375 |
| |
3388 |
| - | |
3389 |
| - | |
| 3376 | + | |
3390 | 3377 |
| |
3391 | 3378 |
| |
3392 | 3379 |
| |
3393 |
| - | |
| 3380 | + | |
3394 | 3381 |
| |
3395 | 3382 |
| |
3396 | 3383 |
| |
3397 |
| - | |
3398 |
| - | |
| 3384 | + | |
3399 | 3385 |
| |
3400 | 3386 |
| |
3401 | 3387 |
| |
|
Lines changed: 2 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
219 |
| - | |
220 |
| - | |
221 |
| - | |
222 | 219 |
| |
223 | 220 |
| |
224 | 221 |
| |
| |||
237 | 234 |
| |
238 | 235 |
| |
239 | 236 |
| |
240 |
| - | |
| 237 | + | |
| 238 | + | |
241 | 239 |
| |
242 | 240 |
| |
243 | 241 |
| |
|
Lines changed: 2 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
517 | 517 |
| |
518 | 518 |
| |
519 | 519 |
| |
520 |
| - | |
521 | 520 |
| |
522 | 521 |
| |
523 | 522 |
| |
| |||
4688 | 4687 |
| |
4689 | 4688 |
| |
4690 | 4689 |
| |
4691 |
| - | |
| 4690 | + | |
4692 | 4691 |
| |
4693 | 4692 |
| |
4694 | 4693 |
| |
| |||
4711 | 4710 |
| |
4712 | 4711 |
| |
4713 | 4712 |
| |
4714 |
| - | |
4715 |
| - | |
4716 |
| - | |
4717 |
| - | |
4718 |
| - | |
| 4713 | + | |
4719 | 4714 |
| |
4720 | 4715 |
| |
4721 | 4716 |
| |
|
Lines changed: 3 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3152 | 3152 |
| |
3153 | 3153 |
| |
3154 | 3154 |
| |
3155 |
| - | |
3156 |
| - | |
3157 |
| - | |
3158 |
| - | |
3159 |
| - | |
| 3155 | + | |
| 3156 | + | |
3160 | 3157 |
| |
3161 | 3158 |
| |
3162 | 3159 |
| |
| |||
3209 | 3206 |
| |
3210 | 3207 |
| |
3211 | 3208 |
| |
3212 |
| - | |
3213 |
| - | |
| 3209 | + | |
3214 | 3210 |
| |
3215 | 3211 |
| |
3216 | 3212 |
| |
|
Lines changed: 1 addition & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
143 | 143 |
| |
144 | 144 |
| |
145 | 145 |
| |
146 |
| - | |
147 | 146 |
| |
148 | 147 |
| |
149 | 148 |
| |
| |||
474 | 473 |
| |
475 | 474 |
| |
476 | 475 |
| |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
481 |
| - | |
482 | 476 |
| |
483 | 477 |
| |
484 | 478 |
| |
| |||
488 | 482 |
| |
489 | 483 |
| |
490 | 484 |
| |
491 |
| - | |
| 485 | + | |
492 | 486 |
| |
493 | 487 |
| |
494 | 488 |
| |
|
Lines changed: 1 addition & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
101 |
| - | |
102 |
| - | |
103 | 101 |
| |
104 | 102 |
| |
105 | 103 |
| |
| |||
141 | 139 |
| |
142 | 140 |
| |
143 | 141 |
| |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 | 142 |
| |
149 |
| - | |
| 143 | + | |
150 | 144 |
| |
151 | 145 |
| |
152 | 146 |
| |
|
Lines changed: 2 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
25 |
| - | |
26 | 24 |
| |
27 | 25 |
| |
28 | 26 |
| |
| |||
90 | 88 |
| |
91 | 89 |
| |
92 | 90 |
| |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
| 91 | + | |
| 92 | + | |
105 | 93 |
| |
106 | 94 |
| |
107 | 95 |
| |
|
Lines changed: 1 addition & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
106 | 106 |
| |
107 | 107 |
| |
108 | 108 |
| |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 | 109 |
| |
113 | 110 |
| |
114 | 111 |
| |
| |||
266 | 263 |
| |
267 | 264 |
| |
268 | 265 |
| |
269 |
| - | |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
| 266 | + | |
274 | 267 |
| |
275 | 268 |
| |
276 | 269 |
| |
|
0 commit comments
Comments
(0)