Use LW_SHARED in dsa.c where possible.
authorNathan Bossart <nathan@postgresql.org>
Tue, 2 Dec 2025 22:40:23 +0000 (16:40 -0600)
committerNathan Bossart <nathan@postgresql.org>
Tue, 2 Dec 2025 22:40:23 +0000 (16:40 -0600)
commita6d05c819380b0940fcfb428aa298f2d7e76e5c6
tree9575fe206b4dd70a6ccf7feb07c54ccacd14200d
parentcbe04e5d729f292bcf9b06f5d774884b4511b18a
Use LW_SHARED in dsa.c where possible.

Both dsa_get_total_size() and dsa_get_total_size_from_handle() take
an exclusive lock just to read a variable.  This commit reduces the
lock level to LW_SHARED in those functions.

Reviewed-by: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/aS8fMzWs9e8iHxk2%40nathan
src/backend/utils/mmgr/dsa.c