1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Files
Vladislav Vaintroub 6ab0036cf3 MDEV-38918 Make large pages an explicit per-caller opt-in
my_large_malloc() attempted large pages whenever --large-pages was
enabled, silently rounding the size up and reporting it back via an
in/out parameter. ut_malloc_dontdump() never passed that adjusted
size on to its own callers (the InnoDB redo log buffer and
recv_sys_t::tmp_buf), so freeing later used the original, smaller
size, causing the reported "faux memory leak".

Only the buffer pool and the MyISAM/Aria key caches are documented
to benefit from large pages. Everything else that ended up calling
my_large_malloc() only wanted its "do not dump to core" property and
picked up large pages as an undocumented side effect; those buffers
are also small and sequentially accessed, so they would have gained
little from large pages anyway.

Add MY_TRY_LARGE_PAGES: my_large_malloc() and my_large_virtual_alloc()
now only attempt large pages when a caller passes this flag, instead
of always trying whenever the global option is set. Only the buffer
pool and the key caches pass it. The redo log buffer, tmp_buf, and
row0log.cc's crypt buffers no longer request large pages at all,
which removes the size-rounding bug for them without touching that
code.

my_large_virtual_alloc()'s fallback (no usable large page size) must
also return read-write memory right away, like the Windows large-pages
fallback already does, since my_virtual_mem_commit() is a no-op for
MY_TRY_LARGE_PAGES. my_large_pages_flag is now set once, in
my_init_large_pages(), and never changed thereafter, on any platform.

Both my_virtual_mem_commit() and my_virtual_mem_decommit() are now
no-ops, aside from accounting, whenever large pages are requested.

Also fix a broken mtr suppression regex in main.large_pages that
would fail the test on Windows.
2026-09-14 15:09:31 +02:00
..
2022-02-09 19:13:52 +01:00
2019-05-11 19:25:02 +03:00
2022-01-21 16:02:34 +01:00
2024-11-29 13:43:17 +02:00
2025-11-11 10:29:45 +02:00
2019-05-11 22:19:05 +03:00
2019-05-11 19:25:02 +03:00
2023-12-18 11:19:04 +01:00
2023-01-03 17:08:42 +02:00
2020-06-19 19:43:07 +02:00
2022-11-08 17:01:28 +02:00
2023-12-18 11:19:04 +01:00
2023-04-24 12:43:47 +02:00
2023-02-10 13:03:01 +02:00
2024-03-28 09:16:57 +02:00
2019-05-11 22:19:05 +03:00
2023-11-08 12:59:00 +01:00
2019-05-11 22:19:05 +03:00
2026-07-24 17:06:39 +02:00
2022-12-20 08:55:48 +11:00
2023-01-04 14:52:25 +02:00
2019-05-11 21:29:06 +03:00
2019-05-11 21:29:06 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 21:29:06 +03:00
2022-07-31 14:54:37 +02:00
2019-05-14 17:18:46 +03:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00
2025-09-04 18:08:39 +03:00
2019-05-19 20:55:37 +02:00
2019-05-11 22:19:05 +03:00
2020-10-29 13:38:38 +02:00
2023-12-18 11:19:04 +01:00
…
2020-03-10 19:24:22 +01:00
2020-03-10 19:24:22 +01:00
2020-03-10 19:24:22 +01:00
2020-03-10 19:24:22 +01:00
2020-03-10 19:24:22 +01:00
2020-03-10 19:24:22 +01:00
2020-03-10 19:24:22 +01:00
2019-05-11 21:29:06 +03:00
2019-05-11 21:29:06 +03:00
2019-05-11 21:29:06 +03:00
2023-12-17 11:20:43 +01:00
2019-05-11 21:29:06 +03:00
2022-12-20 08:55:48 +11:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00