Re: DSA failed to allocate memory
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Dongming Liu <ldming101@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-01-24T17:20:02Z
Lists: pgsql-hackers
On Mon, Jan 24, 2022 at 4:59 AM Dongming Liu <ldming101@gmail.com> wrote: > Maybe we can use one of the following methods to fix it: > 1. re-bin segment to suitable segment index when called dsa_free > 2. get_best_segment search all bins (2) is definitely the wrong idea. The comments say: /* * What is the lowest bin that holds segments that *might* have n contiguous * free pages? There is no point in looking in segments in lower bins; they * definitely can't service a request for n free pages. */ #define contiguous_pages_to_segment_bin(n) Min(fls(n), DSA_NUM_SEGMENT_BINS - 1) So it's OK for a segment to be in a bin that suggests that it has more consecutive free pages than it really does. But it's NOT ok for a segment to be in a bin that suggests it has fewer consecutive pages than it really does. If dsa_free() is putting things back into the wrong place, that's what we need to fix. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Re-bin segment when memory pages are freed.
- 1605623ec686 11.21 landed
- 74ad9b0d1e7c 12.16 landed
- a0003572f214 13.12 landed
- b7ec66731dd8 14.9 landed
- 9ffb10f183f1 15.4 landed
- af8f9ec66bd1 16.0 landed
- 03f80daac8cf 17.0 landed
-
De-support floating-point timestamps.
- b6aa17e0ae36 10.0 cited