forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit43c1c4f
committed
Introduce GUC shared_memory_size_in_huge_pages
This runtime-computed GUC shows the number of huge pages requiredfor the server's main shared memory area, taking advantage of thework done in 0c39c29 and 0bd305e. This is useful for users to estimatethe amount of huge pages required for a server as it becomes possible todo an estimation without having to start the server and potentiallyallocate a large chunk of shared memory.The number of huge pages is calculated based on the existing GUChuge_page_size if set, or by using the system's default by looking at/proc/meminfo on Linux. There is nothing new here as this commit reusesthe existing calculation methods, and just exposes this informationdirectly to the user. The routine calculating the huge page size isrefactored to limit the number of files with platform-specific flags.This new GUC's name was the most popular choice based on the discussiondone. This is only supported on Linux.I have taken the time to test the change on Linux, Windows and MacOS,though for the last two ones large pages are not supported. The firstone calculates correctly the number of pages depending on the existingGUC huge_page_size or the system's default.Thanks to Andres Freund, Robert Haas, Kyotaro Horiguchi, Tom Lane,Justin Pryzby (and anybody forgotten here) for the discussion.Author: Nathan BossartDiscussion:https://postgr.es/m/F2772387-CE0F-46BF-B5F1-CC55516EB885@amazon.com1 parent5e6716c commit43c1c4f
File tree
8 files changed
+106
-29
lines changed- doc/src/sgml
- ref
- src
- backend
- port
- storage/ipc
- utils/misc
- include/storage
8 files changed
+106
-29
lines changedLines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10289 | 10289 |
| |
10290 | 10290 |
| |
10291 | 10291 |
| |
| 10292 | + | |
| 10293 | + | |
| 10294 | + | |
| 10295 | + | |
| 10296 | + | |
| 10297 | + | |
| 10298 | + | |
| 10299 | + | |
| 10300 | + | |
| 10301 | + | |
| 10302 | + | |
| 10303 | + | |
| 10304 | + | |
| 10305 | + | |
| 10306 | + | |
| 10307 | + | |
| 10308 | + | |
| 10309 | + | |
| 10310 | + | |
| 10311 | + | |
| 10312 | + | |
10292 | 10313 |
| |
10293 | 10314 |
| |
10294 | 10315 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
143 | 143 |
| |
144 | 144 |
| |
145 | 145 |
| |
146 |
| - | |
| 146 | + | |
| 147 | + | |
147 | 148 |
| |
148 | 149 |
| |
149 | 150 |
| |
|
Lines changed: 12 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1442 | 1442 |
| |
1443 | 1443 |
| |
1444 | 1444 |
| |
1445 |
| - | |
1446 |
| - | |
1447 |
| - | |
1448 |
| - | |
1449 |
| - | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
1450 | 1449 |
| |
1451 | 1450 |
| |
1452 |
| - | |
1453 |
| - | |
1454 |
| - | |
1455 |
| - | |
| 1451 | + | |
| 1452 | + | |
1456 | 1453 |
| |
1457 | 1454 |
| |
1458 | 1455 |
| |
1459 | 1456 |
| |
1460 | 1457 |
| |
1461 | 1458 |
| |
1462 | 1459 |
| |
1463 |
| - | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1464 | 1463 |
| |
1465 |
| - | |
1466 |
| - | |
1467 |
| - | |
1468 |
| - | |
1469 |
| - | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1470 | 1467 |
| |
1471 | 1468 |
| |
1472 | 1469 |
| |
|
Lines changed: 30 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
456 | 456 |
| |
457 | 457 |
| |
458 | 458 |
| |
459 |
| - | |
460 |
| - | |
461 | 459 |
| |
462 | 460 |
| |
463 | 461 |
| |
| |||
475 | 473 |
| |
476 | 474 |
| |
477 | 475 |
| |
478 |
| - | |
479 |
| - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
480 | 480 |
| |
481 |
| - | |
| 481 | + | |
482 | 482 |
| |
483 | 483 |
| |
| 484 | + | |
| 485 | + | |
484 | 486 |
| |
| 487 | + | |
| 488 | + | |
485 | 489 |
| |
486 | 490 |
| |
487 | 491 |
| |
| |||
519 | 523 |
| |
520 | 524 |
| |
521 | 525 |
| |
522 |
| - | |
| 526 | + | |
523 | 527 |
| |
524 | 528 |
| |
525 | 529 |
| |
526 | 530 |
| |
527 |
| - | |
| 531 | + | |
528 | 532 |
| |
529 | 533 |
| |
530 | 534 |
| |
| |||
536 | 540 |
| |
537 | 541 |
| |
538 | 542 |
| |
539 |
| - | |
| 543 | + | |
540 | 544 |
| |
541 | 545 |
| |
542 |
| - | |
| 546 | + | |
543 | 547 |
| |
544 | 548 |
| |
545 | 549 |
| |
546 | 550 |
| |
547 | 551 |
| |
548 | 552 |
| |
549 |
| - | |
| 553 | + | |
550 | 554 |
| |
551 |
| - | |
| 555 | + | |
552 | 556 |
| |
553 |
| - | |
| 557 | + | |
554 | 558 |
| |
555 | 559 |
| |
556 |
| - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
557 | 573 |
| |
558 | 574 |
| |
| 575 | + | |
559 | 576 |
| |
560 | 577 |
| |
561 | 578 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
605 | 605 |
| |
606 | 606 |
| |
607 | 607 |
| |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + |
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
326 | 326 |
| |
327 | 327 |
| |
328 | 328 |
| |
| 329 | + | |
329 | 330 |
| |
330 | 331 |
| |
331 | 332 |
| |
| |||
334 | 335 |
| |
335 | 336 |
| |
336 | 337 |
| |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
337 | 351 |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
665 | 665 |
| |
666 | 666 |
| |
667 | 667 |
| |
| 668 | + | |
668 | 669 |
| |
669 | 670 |
| |
670 | 671 |
| |
| |||
2349 | 2350 |
| |
2350 | 2351 |
| |
2351 | 2352 |
| |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
2352 | 2364 |
| |
2353 | 2365 |
| |
2354 | 2366 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
| 90 | + | |
90 | 91 |
| |
91 | 92 |
|
0 commit comments
Comments
(0)