forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit74ad9b0
committed
Re-bin segment when memory pages are freed.
It's OK to be lazy about re-binning memory segments when allocating,because that can only leave segments in a bin that's too high. We'llsearch higher bins if necessary while allocating next time, andalso eventually re-bin, so no memory can become unreachable that way.However, when freeing memory, the largest contiguous range of free pagesmight go up, so we should re-bin eagerly to make sure we don't leave thesegment in a bin that is too low for get_best_segment() to find.The re-binning code is moved into a function of its own, so it can becalled whenever free pages are returned to the segment's free page map.Back-patch to all supported releases.Author: Dongming Liu <ldming101@gmail.com>Reviewed-by: Robert Haas <robertmhaas@gmail.com> (earlier version)Reviewed-by: Thomas Munro <thomas.munro@gmail.com>Discussion:https://postgr.es/m/CAL1p7e8LzB2LSeAXo2pXCW4%2BRya9s0sJ3G_ReKOU%3DAjSUWjHWQ%40mail.gmail.com1 parent255a925 commit74ad9b0
1 file changed
+43
-22
lines changedLines changed: 43 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
406 | 406 |
| |
407 | 407 |
| |
408 | 408 |
| |
| 409 | + | |
409 | 410 |
| |
410 | 411 |
| |
411 | 412 |
| |
| |||
857 | 858 |
| |
858 | 859 |
| |
859 | 860 |
| |
| 861 | + | |
| 862 | + | |
| 863 | + | |
860 | 864 |
| |
| 865 | + | |
861 | 866 |
| |
862 | 867 |
| |
863 | 868 |
| |
| |||
1849 | 1854 |
| |
1850 | 1855 |
| |
1851 | 1856 |
| |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
1852 | 1862 |
| |
1853 | 1863 |
| |
1854 | 1864 |
| |
| |||
2012 | 2022 |
| |
2013 | 2023 |
| |
2014 | 2024 |
| |
2015 |
| - | |
2016 |
| - | |
2017 |
| - | |
2018 |
| - | |
2019 |
| - | |
2020 |
| - | |
2021 |
| - | |
2022 |
| - | |
2023 |
| - | |
2024 |
| - | |
2025 |
| - | |
2026 |
| - | |
2027 |
| - | |
2028 |
| - | |
2029 |
| - | |
2030 |
| - | |
2031 |
| - | |
2032 |
| - | |
2033 |
| - | |
2034 |
| - | |
2035 |
| - | |
2036 |
| - | |
| 2025 | + | |
2037 | 2026 |
| |
2038 | 2027 |
| |
2039 | 2028 |
| |
| |||
2288 | 2277 |
| |
2289 | 2278 |
| |
2290 | 2279 |
| |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + |
0 commit comments
Comments
(0)