Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0fad355

Browse files
committed
Update obsolete comments in lwlock.h.
The typical size of an LWLock is now 16 bytes even on 64-bit platforms,and the size of slock_t is now irrelevant. But pg_atomic_uint32 can(perhaps surprisingly) still be larger than 4 bytes, so there's stillsome marginal point to allowing LWLOCK_MINIMAL_SIZE == 64.Commit008608b made the changesthat led to the need for these updates.
1 parent0813216 commit0fad355

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

‎src/include/storage/lwlock.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,17 @@ typedef struct LWLock
5858
* LWLockPadded can be used for cases where we want each lock to be an entire
5959
* cache line.
6060
*
61-
*On 32-bit platforms, anLWLockMinimallyPadded mightactuallycontain more
62-
*than the absolute minimum amountof padding required to keep a lock from
63-
*crossing a cache line boundary,because an unpadded LWLockmightfit into
64-
*16 bytes. We ignore thatpossibility when determining the minimal amount
65-
*of padding. Older releaseshad larger LWLocks, so 32 really was the
66-
*minimum, and packing them intighter might hurt performance.
61+
*AnLWLockMinimallyPadded might contain more than the absolute minimum amount
62+
* of padding required to keep a lock from crossing a cache line boundary,
63+
* because an unpadded LWLockwill normallyfit into 16 bytes. We ignore that
64+
* possibility when determining the minimal amount of padding. Older releases
65+
* had larger LWLocks, so 32 really was the minimum, and packing them in
66+
* tighter might hurt performance.
6767
*
6868
* LWLOCK_MINIMAL_SIZE should be 32 on basically all common platforms, but
69-
* because slock_t is more than 2 bytes on some obscure platforms, we allow
70-
* for the possibility that it might be 64.
69+
* because pg_atomic_uint32 is more than 4 bytes on some obscure platforms, we
70+
* allow for the possibility that it might be 64. Even on those platforms,
71+
* we probably won't exceed 32 bytes unless LOCK_DEBUG is defined.
7172
*/
7273
#defineLWLOCK_PADDED_SIZEPG_CACHE_LINE_SIZE
7374
#defineLWLOCK_MINIMAL_SIZE (sizeof(LWLock) <= 32 ? 32 : 64)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp