pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Re-bin segment when memory pages are freed. 7+ messages / 1 participants [nested] [flat]
* pgsql: Re-bin segment when memory pages are freed. @ 2023-07-04 04:17 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Thomas Munro @ 2023-07-04 04:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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'll search higher bins if necessary while allocating next time, and also eventually re-bin, so no memory can become unreachable that way. However, when freeing memory, the largest contiguous range of free pages might go up, so we should re-bin eagerly to make sure we don't leave the segment 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 be called 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.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/03f80daac8cff257294108caf908fe0397c40e1a Modified Files -------------- src/backend/utils/mmgr/dsa.c | 65 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Re-bin segment when memory pages are freed. @ 2023-07-04 04:18 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Thomas Munro @ 2023-07-04 04:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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'll search higher bins if necessary while allocating next time, and also eventually re-bin, so no memory can become unreachable that way. However, when freeing memory, the largest contiguous range of free pages might go up, so we should re-bin eagerly to make sure we don't leave the segment 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 be called 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.com Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/af8f9ec66bd19a920d02b4c0eb65b3dd6057d324 Modified Files -------------- src/backend/utils/mmgr/dsa.c | 65 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Re-bin segment when memory pages are freed. @ 2023-07-04 04:18 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Thomas Munro @ 2023-07-04 04:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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'll search higher bins if necessary while allocating next time, and also eventually re-bin, so no memory can become unreachable that way. However, when freeing memory, the largest contiguous range of free pages might go up, so we should re-bin eagerly to make sure we don't leave the segment 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 be called 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.com Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9ffb10f183f1b7bcfbede2035fcfeeef3dee5014 Modified Files -------------- src/backend/utils/mmgr/dsa.c | 65 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Re-bin segment when memory pages are freed. @ 2023-07-04 04:18 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Thomas Munro @ 2023-07-04 04:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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'll search higher bins if necessary while allocating next time, and also eventually re-bin, so no memory can become unreachable that way. However, when freeing memory, the largest contiguous range of free pages might go up, so we should re-bin eagerly to make sure we don't leave the segment 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 be called 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.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b7ec66731dd8d47fdadc71e38c07dd561fd2953b Modified Files -------------- src/backend/utils/mmgr/dsa.c | 65 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Re-bin segment when memory pages are freed. @ 2023-07-04 04:18 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Thomas Munro @ 2023-07-04 04:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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'll search higher bins if necessary while allocating next time, and also eventually re-bin, so no memory can become unreachable that way. However, when freeing memory, the largest contiguous range of free pages might go up, so we should re-bin eagerly to make sure we don't leave the segment 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 be called 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.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a0003572f214c0e4b40374aefa46c818ad92d999 Modified Files -------------- src/backend/utils/mmgr/dsa.c | 65 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Re-bin segment when memory pages are freed. @ 2023-07-04 04:19 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Thomas Munro @ 2023-07-04 04:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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'll search higher bins if necessary while allocating next time, and also eventually re-bin, so no memory can become unreachable that way. However, when freeing memory, the largest contiguous range of free pages might go up, so we should re-bin eagerly to make sure we don't leave the segment 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 be called 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.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/74ad9b0d1e7c7ef2f1c6c2468e87469b11700359 Modified Files -------------- src/backend/utils/mmgr/dsa.c | 65 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Re-bin segment when memory pages are freed. @ 2023-07-04 04:19 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Thomas Munro @ 2023-07-04 04:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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'll search higher bins if necessary while allocating next time, and also eventually re-bin, so no memory can become unreachable that way. However, when freeing memory, the largest contiguous range of free pages might go up, so we should re-bin eagerly to make sure we don't leave the segment 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 be called 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.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1605623ec6868aab1de2ddf992c36a1fcf9ad555 Modified Files -------------- src/backend/utils/mmgr/dsa.c | 65 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2023-07-04 04:19 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-07-04 04:17 pgsql: Re-bin segment when memory pages are freed. Thomas Munro <tmunro@postgresql.org> 2023-07-04 04:18 pgsql: Re-bin segment when memory pages are freed. Thomas Munro <tmunro@postgresql.org> 2023-07-04 04:18 pgsql: Re-bin segment when memory pages are freed. Thomas Munro <tmunro@postgresql.org> 2023-07-04 04:18 pgsql: Re-bin segment when memory pages are freed. Thomas Munro <tmunro@postgresql.org> 2023-07-04 04:18 pgsql: Re-bin segment when memory pages are freed. Thomas Munro <tmunro@postgresql.org> 2023-07-04 04:19 pgsql: Re-bin segment when memory pages are freed. Thomas Munro <tmunro@postgresql.org> 2023-07-04 04:19 pgsql: Re-bin segment when memory pages are freed. Thomas Munro <tmunro@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox