Re: Improve monitoring of shared memory allocations
Rahila Syed <rahilasyed90@gmail.com>
From: Rahila Syed <rahilasyed90@gmail.com>
To: Tomas Vondra <tomas@vondra.me>
Cc: Nazir Bilal Yavuz <byavuz81@gmail.com>,
Andres Freund <andres@anarazel.de>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-04-01T07:43:21Z
Lists: pgsql-hackers
Attachments
- v9-0001-Improve-acounting-for-memory-used-by-shared-hash-tab.patch (application/octet-stream) patch v9-0001
- v9-0002-Improve-accounting-for-PredXactList-RWConflictPool-a.patch (application/octet-stream) patch v9-0002
- v9-0003-Add-cacheline-padding-between-heavily-accessed-array.patch (application/octet-stream) patch v9-0003
Hi, I think it's almost committable. Attached is v8 with some minor review > adjustments, and updated commit messages. Please read through those and > feel free to suggest changes. > > The changes look good to me. About the following question. /* XXX what about segment size? should check have HASH_SEGMENT? */ Do you mean for a shared hash table should the caller have specified HASH_SEGMENT in flags? It appears that the current code does not require this change. All the shared hash tables seem to have the default segment size. I left the comment as it is as I am not sure if you intend to remove it or not. > I still found the hash_get_init_size() comment unclear, and it also > referenced init_size, which is no longer relevant. I improved the > comment a bit (I find it useful to mimic comments of nearby functions, > so I did that too here). The "initial_elems" name was a bit confusing, > as it seemed to suggest "number of elements", but it's a simple flag. So > I renamed it to "prealloc", which seems clearer to me. I also tweaked > (reordered/reformatted) the conditions a bit. I appreciate your edtis, the comment and code are clearer now. PFA the patches after merging the review patches. Thank you, Rahila Syed
Commits
-
Allocate all parts of shmem hash table from a single contiguous area
- 9fe9ecd516b0 19 (unreleased) cited
-
Improve accounting for PredXactList, RWConflictPool and PGPROC
- 46df9487d973 18.0 landed
-
Improve accounting for memory used by shared hash tables
- f5930f9a98ea 18.0 landed