Skip to content

Commit e27a627

Browse files
bdrouvotAWSCommitfest Bot
authored andcommitted
Fix comment in pg_get_shmem_allocations_numa()
The comment incorrectly described the function as dealing with database blocks when it actually processes shared memory allocations from the shmem index.
1 parent d74cfe3 commit e27a627

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/backend/storage/ipc/shmem.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -606,16 +606,13 @@ pg_get_shmem_allocations_numa(PG_FUNCTION_ARGS)
606606
nodes = palloc(sizeof(Size) * (max_nodes + 1));
607607

608608
/*
609-
* Different database block sizes (4kB, 8kB, ..., 32kB) can be used, while
610-
* the OS may have different memory page sizes.
609+
* Shared memory allocations can vary in size and may not align with OS
610+
* memory page boundaries, while NUMA queries work on pages.
611611
*
612-
* To correctly map between them, we need to: 1. Determine the OS memory
613-
* page size 2. Calculate how many OS pages are used by all buffer blocks
614-
* 3. Calculate how many OS pages are contained within each database
615-
* block.
616-
*
617-
* This information is needed before calling move_pages() for NUMA memory
618-
* node inquiry.
612+
* To correctly map each allocation to NUMA nodes, we need to: 1.
613+
* Determine the OS memory page size. 2. Align each allocation's start/end
614+
* addresses to page boundaries. 3. Query NUMA node information for all
615+
* pages spanning the allocation.
619616
*/
620617
os_page_size = pg_get_shmem_pagesize();
621618

0 commit comments

Comments
 (0)