mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Fix comment in pg_get_shmem_allocations_numa()
The comment fixed in this commit described the function as dealing with database blocks, but in reality it processes shared memory allocations. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/aH4DDhdiG9Gi0rG7@ip-10-97-1-34.eu-west-3.compute.internal Backpatch-through: 18
This commit is contained in:
@@ -606,16 +606,13 @@ pg_get_shmem_allocations_numa(PG_FUNCTION_ARGS)
|
|||||||
nodes = palloc(sizeof(Size) * (max_nodes + 1));
|
nodes = palloc(sizeof(Size) * (max_nodes + 1));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Different database block sizes (4kB, 8kB, ..., 32kB) can be used, while
|
* Shared memory allocations can vary in size and may not align with OS
|
||||||
* the OS may have different memory page sizes.
|
* memory page boundaries, while NUMA queries work on pages.
|
||||||
*
|
*
|
||||||
* To correctly map between them, we need to: 1. Determine the OS memory
|
* To correctly map each allocation to NUMA nodes, we need to: 1.
|
||||||
* page size 2. Calculate how many OS pages are used by all buffer blocks
|
* Determine the OS memory page size. 2. Align each allocation's start/end
|
||||||
* 3. Calculate how many OS pages are contained within each database
|
* addresses to page boundaries. 3. Query NUMA node information for all
|
||||||
* block.
|
* pages spanning the allocation.
|
||||||
*
|
|
||||||
* This information is needed before calling move_pages() for NUMA memory
|
|
||||||
* node inquiry.
|
|
||||||
*/
|
*/
|
||||||
os_page_size = pg_get_shmem_pagesize();
|
os_page_size = pg_get_shmem_pagesize();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user