forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9ffb10f
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 parentd34aa0a commit9ffb10f
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 |
| |
| |||
1846 | 1851 |
| |
1847 | 1852 |
| |
1848 | 1853 |
| |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1849 | 1859 |
| |
1850 | 1860 |
| |
1851 | 1861 |
| |
| |||
2009 | 2019 |
| |
2010 | 2020 |
| |
2011 | 2021 |
| |
2012 |
| - | |
2013 |
| - | |
2014 |
| - | |
2015 |
| - | |
2016 |
| - | |
2017 |
| - | |
2018 |
| - | |
2019 |
| - | |
2020 |
| - | |
2021 |
| - | |
2022 |
| - | |
2023 |
| - | |
2024 |
| - | |
2025 |
| - | |
2026 |
| - | |
2027 |
| - | |
2028 |
| - | |
2029 |
| - | |
2030 |
| - | |
2031 |
| - | |
2032 |
| - | |
2033 |
| - | |
| 2022 | + | |
2034 | 2023 |
| |
2035 | 2024 |
| |
2036 | 2025 |
| |
| |||
2285 | 2274 |
| |
2286 | 2275 |
| |
2287 | 2276 |
| |
| 2277 | + | |
| 2278 | + | |
| 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 | + |
0 commit comments
Comments
(0)