Commit 963d307
committed
Convert unloggedLSN to an atomic variable.
Currently, this variable is an XLogRecPtr protected by a spinlock.
By converting it to an atomic variable, we can remove the spinlock,
which saves a small amount of shared memory space. Since this code
is not performance-critical, we use atomic operations with full
barrier semantics to make it easy to reason about correctness.
Author: John Morris
Reviewed-by: Michael Paquier, Robert Haas, Andres Freund, Stephen Frost, Bharath Rupireddy
Discussion: https://postgr.es/m/BYAPR13MB26772534335255E50318C574A0409%40BYAPR13MB2677.namprd13.prod.outlook.com
Discussion: https://postgr.es/m/MN2PR13MB2688FD8B757316CB5C54C8A2A0DDA%40MN2PR13MB2688.namprd13.prod.outlook.com1 parent 3179701 commit 963d307
1 file changed
+9
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
474 | | - | |
475 | | - | |
| 473 | + | |
| 474 | + | |
476 | 475 | | |
477 | 476 | | |
478 | 477 | | |
| |||
4498 | 4497 | | |
4499 | 4498 | | |
4500 | 4499 | | |
4501 | | - | |
4502 | | - | |
4503 | | - | |
4504 | | - | |
4505 | | - | |
4506 | | - | |
4507 | | - | |
4508 | | - | |
| 4500 | + | |
4509 | 4501 | | |
4510 | 4502 | | |
4511 | 4503 | | |
| |||
4921 | 4913 | | |
4922 | 4914 | | |
4923 | 4915 | | |
4924 | | - | |
| 4916 | + | |
4925 | 4917 | | |
4926 | 4918 | | |
4927 | 4919 | | |
| |||
5526 | 5518 | | |
5527 | 5519 | | |
5528 | 5520 | | |
5529 | | - | |
| 5521 | + | |
| 5522 | + | |
5530 | 5523 | | |
5531 | | - | |
| 5524 | + | |
| 5525 | + | |
5532 | 5526 | | |
5533 | 5527 | | |
5534 | 5528 | | |
| |||
7110 | 7104 | | |
7111 | 7105 | | |
7112 | 7106 | | |
7113 | | - | |
7114 | | - | |
7115 | | - | |
| 7107 | + | |
7116 | 7108 | | |
7117 | 7109 | | |
7118 | 7110 | | |
| |||
0 commit comments