cpython/Doc/using
Pablo Galindo Salgado 96e4cd698a
gh-144319: Fix huge page safety in pymalloc arenas (#144331)
The pymalloc huge page support had two problems. First, on
architectures where the default huge page size exceeds the arena
size (e.g. 32 MiB on PPC, 512 MiB on ARM64 with 64 KB base
pages), mmap with MAP_HUGETLB silently allocates a full huge page
even when the requested size is smaller. The subsequent munmap
with the original arena size then fails with EINVAL, permanently
leaking the entire huge page. Second, huge pages were always
attempted when compiled in, with no way to disable them at
runtime. On Linux, if the huge page pool is exhausted, page
faults including copy-on-write faults after fork deliver SIGBUS
and kill the process.

The arena allocator now queries the system huge page size from
/proc/meminfo and skips MAP_HUGETLB when the arena size is not a
multiple of it. Huge pages also now require explicit opt-in at
runtime via the PYTHON_PYMALLOC_HUGEPAGES environment variable,
which is read through PyConfig and respects -E and -I flags.
The config field pymalloc_hugepages is propagated to the runtime
allocators struct so the low-level arena allocator can check it
without calling getenv directly.
2026-01-30 18:18:56 +00:00
..
android.rst gh-137242: Mention Android binary releases in documentation (#138305) 2025-09-18 13:25:30 +00:00
cmdline.rst gh-144319: Fix huge page safety in pymalloc arenas (#144331) 2026-01-30 18:18:56 +00:00
configure.rst gh-144319: Fix huge page safety in pymalloc arenas (#144331) 2026-01-30 18:18:56 +00:00
editors.rst gh-59149: Setup documentation for IDLE on Linux and add section in Editors (#130003) 2025-02-12 03:16:56 -05:00
index.rst gh-116622: Complete Android documentation (#124259) 2024-09-23 23:09:53 +00:00
ios.rst gh-132006: Add support for handling XCPrivacy manifests (#139163) 2025-09-29 05:50:46 +08:00
mac.rst gh-137749: Python 3.14 installer is for macOS 10.15 and later (#137753) 2025-08-14 14:01:45 +03:00
mac_installer_01_introduction.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_02_readme.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_03_license.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_04_installation_type.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_05_custom_install.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_06_summary.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_07_applications.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
mac_installer_08_install_certificates.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_09_custom_install_free_threaded.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
unix.rst gh-139707: Add docs for optional modules (GH-140171) 2025-11-06 11:49:44 +01:00
win_install_freethreaded.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
win_installer.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
windows.rst Update install manager docs (python/pymanager#227) (GH-144079) 2026-01-21 15:33:05 +00:00