- Notifications
You must be signed in to change notification settings - Fork5k
Commitba2a3c2
committed
Add pg_buffercache_numa view with NUMA node info
Introduces a new view pg_buffercache_numa, showing NUMA memory nodesfor individual buffers. For each buffer the view returns an entry foreach memory page, with the associated NUMA node.The database blocks and OS memory pages may have different size - thedefault block size is 8KB, while the memory page is 4K (on x86). Butother combinations are possible, depending on configure parameters,platform, etc. This means buffers may overlap with multiple memorypages, each associated with a different NUMA node.To determine the NUMA node for a buffer, we first need to touch thememory pages using pg_numa_touch_mem_if_required, otherwise we might getstatus -2 (ENOENT = The page is not present), indicating the page iseither unmapped or unallocated.The view may be relatively expensive, especially when accessed for thefirst time in a backend, as it touches all memory pages to get reliableinformation about the NUMA node. This may also force allocation of theshared memory.Author: Jakub Wartak <jakub.wartak@enterprisedb.com>Reviewed-by: Andres Freund <andres@anarazel.de>Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Reviewed-by: Tomas Vondra <tomas@vondra.me>Discussion:https://postgr.es/m/CAKZiRmxh6KWo0aqRqvmcoaX2jUxZYb4kGp3N%3Dq1w%2BDiH-696Xw%40mail.gmail.com1 parent8cc139b commitba2a3c2
File tree
10 files changed
+452
-4
lines changed- contrib/pg_buffercache
- expected
- sql
- doc/src/sgml
- src/tools/pgindent
10 files changed
+452
-4
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
| 12 | + | |
12 | 13 |
| |
13 | 14 |
| |
14 |
| - | |
| 15 | + | |
15 | 16 |
| |
16 | 17 |
| |
17 | 18 |
| |
|
Lines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + |
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + |
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
| 38 | + | |
37 | 39 |
| |
38 | 40 |
| |
39 | 41 |
|
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
|
0 commit comments
Comments
(0)