pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Allow repalloc() to give back space when a large chunk is downsi 7+ messages / 1 participants [nested] [flat]
* pgsql: Allow repalloc() to give back space when a large chunk is downsi @ 2019-10-03 17:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-10-03 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow repalloc() to give back space when a large chunk is downsized. Up to now, if you resized a large (>8K) palloc chunk down to a smaller size, aset.c made no attempt to return any space to the malloc pool. That's unpleasant if a really large allocation is resized to a significantly smaller size. I think no such cases existed when this code was designed, and I'm not sure whether they're common even yet, but an upcoming fix to encoding conversion will certainly create such cases. Therefore, fix AllocSetRealloc so that it gives realloc() a chance to do something with the block. This doesn't noticeably increase complexity, we mostly just have to change the order in which the cases are considered. Back-patch to all supported branches. Discussion: https://postgr.es/m/20190816181418.GA898@alvherre.pgsql Discussion: https://postgr.es/m/3614.1569359690@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c477f3e449d1a7322c2453e9cd9d6b710ae91577 Modified Files -------------- src/backend/utils/mmgr/aset.c | 142 +++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 65 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Allow repalloc() to give back space when a large chunk is downsi @ 2019-10-03 17:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-10-03 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow repalloc() to give back space when a large chunk is downsized. Up to now, if you resized a large (>8K) palloc chunk down to a smaller size, aset.c made no attempt to return any space to the malloc pool. That's unpleasant if a really large allocation is resized to a significantly smaller size. I think no such cases existed when this code was designed, and I'm not sure whether they're common even yet, but an upcoming fix to encoding conversion will certainly create such cases. Therefore, fix AllocSetRealloc so that it gives realloc() a chance to do something with the block. This doesn't noticeably increase complexity, we mostly just have to change the order in which the cases are considered. Back-patch to all supported branches. Discussion: https://postgr.es/m/20190816181418.GA898@alvherre.pgsql Discussion: https://postgr.es/m/3614.1569359690@sss.pgh.pa.us Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9a407209a075b53b9ef7141c0f87e91dba41b8b1 Modified Files -------------- src/backend/utils/mmgr/aset.c | 142 +++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 65 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Allow repalloc() to give back space when a large chunk is downsi @ 2019-10-03 17:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-10-03 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow repalloc() to give back space when a large chunk is downsized. Up to now, if you resized a large (>8K) palloc chunk down to a smaller size, aset.c made no attempt to return any space to the malloc pool. That's unpleasant if a really large allocation is resized to a significantly smaller size. I think no such cases existed when this code was designed, and I'm not sure whether they're common even yet, but an upcoming fix to encoding conversion will certainly create such cases. Therefore, fix AllocSetRealloc so that it gives realloc() a chance to do something with the block. This doesn't noticeably increase complexity, we mostly just have to change the order in which the cases are considered. Back-patch to all supported branches. Discussion: https://postgr.es/m/20190816181418.GA898@alvherre.pgsql Discussion: https://postgr.es/m/3614.1569359690@sss.pgh.pa.us Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/82d0a46ea32d1f666192d197fa993fd9f07adbec Modified Files -------------- src/backend/utils/mmgr/aset.c | 142 +++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 65 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Allow repalloc() to give back space when a large chunk is downsi @ 2019-10-03 17:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-10-03 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow repalloc() to give back space when a large chunk is downsized. Up to now, if you resized a large (>8K) palloc chunk down to a smaller size, aset.c made no attempt to return any space to the malloc pool. That's unpleasant if a really large allocation is resized to a significantly smaller size. I think no such cases existed when this code was designed, and I'm not sure whether they're common even yet, but an upcoming fix to encoding conversion will certainly create such cases. Therefore, fix AllocSetRealloc so that it gives realloc() a chance to do something with the block. This doesn't noticeably increase complexity, we mostly just have to change the order in which the cases are considered. Back-patch to all supported branches. Discussion: https://postgr.es/m/20190816181418.GA898@alvherre.pgsql Discussion: https://postgr.es/m/3614.1569359690@sss.pgh.pa.us Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9ad1b572d8b7539d9c94abf66dbe0f70d002c9e3 Modified Files -------------- src/backend/utils/mmgr/aset.c | 140 +++++++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 64 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Allow repalloc() to give back space when a large chunk is downsi @ 2019-10-03 17:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-10-03 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow repalloc() to give back space when a large chunk is downsized. Up to now, if you resized a large (>8K) palloc chunk down to a smaller size, aset.c made no attempt to return any space to the malloc pool. That's unpleasant if a really large allocation is resized to a significantly smaller size. I think no such cases existed when this code was designed, and I'm not sure whether they're common even yet, but an upcoming fix to encoding conversion will certainly create such cases. Therefore, fix AllocSetRealloc so that it gives realloc() a chance to do something with the block. This doesn't noticeably increase complexity, we mostly just have to change the order in which the cases are considered. Back-patch to all supported branches. Discussion: https://postgr.es/m/20190816181418.GA898@alvherre.pgsql Discussion: https://postgr.es/m/3614.1569359690@sss.pgh.pa.us Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e5e4f12a5f8522d853752f7233f2f3426330927d Modified Files -------------- src/backend/utils/mmgr/aset.c | 140 +++++++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 64 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Allow repalloc() to give back space when a large chunk is downsi @ 2019-10-03 17:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-10-03 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow repalloc() to give back space when a large chunk is downsized. Up to now, if you resized a large (>8K) palloc chunk down to a smaller size, aset.c made no attempt to return any space to the malloc pool. That's unpleasant if a really large allocation is resized to a significantly smaller size. I think no such cases existed when this code was designed, and I'm not sure whether they're common even yet, but an upcoming fix to encoding conversion will certainly create such cases. Therefore, fix AllocSetRealloc so that it gives realloc() a chance to do something with the block. This doesn't noticeably increase complexity, we mostly just have to change the order in which the cases are considered. Back-patch to all supported branches. Discussion: https://postgr.es/m/20190816181418.GA898@alvherre.pgsql Discussion: https://postgr.es/m/3614.1569359690@sss.pgh.pa.us Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1534531fe74fbc8195eced110f61ab2ce89271a1 Modified Files -------------- src/backend/utils/mmgr/aset.c | 140 +++++++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 64 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Allow repalloc() to give back space when a large chunk is downsi @ 2019-10-03 17:56 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-10-03 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow repalloc() to give back space when a large chunk is downsized. Up to now, if you resized a large (>8K) palloc chunk down to a smaller size, aset.c made no attempt to return any space to the malloc pool. That's unpleasant if a really large allocation is resized to a significantly smaller size. I think no such cases existed when this code was designed, and I'm not sure whether they're common even yet, but an upcoming fix to encoding conversion will certainly create such cases. Therefore, fix AllocSetRealloc so that it gives realloc() a chance to do something with the block. This doesn't noticeably increase complexity, we mostly just have to change the order in which the cases are considered. Back-patch to all supported branches. Discussion: https://postgr.es/m/20190816181418.GA898@alvherre.pgsql Discussion: https://postgr.es/m/3614.1569359690@sss.pgh.pa.us Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4829576ba44b13504448d05f469af15ffc5793b7 Modified Files -------------- src/backend/utils/mmgr/aset.c | 140 +++++++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 64 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2019-10-03 17:56 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-10-03 17:56 pgsql: Allow repalloc() to give back space when a large chunk is downsi Tom Lane <tgl@sss.pgh.pa.us> 2019-10-03 17:56 pgsql: Allow repalloc() to give back space when a large chunk is downsi Tom Lane <tgl@sss.pgh.pa.us> 2019-10-03 17:56 pgsql: Allow repalloc() to give back space when a large chunk is downsi Tom Lane <tgl@sss.pgh.pa.us> 2019-10-03 17:56 pgsql: Allow repalloc() to give back space when a large chunk is downsi Tom Lane <tgl@sss.pgh.pa.us> 2019-10-03 17:56 pgsql: Allow repalloc() to give back space when a large chunk is downsi Tom Lane <tgl@sss.pgh.pa.us> 2019-10-03 17:56 pgsql: Allow repalloc() to give back space when a large chunk is downsi Tom Lane <tgl@sss.pgh.pa.us> 2019-10-03 17:56 pgsql: Allow repalloc() to give back space when a large chunk is downsi Tom Lane <tgl@sss.pgh.pa.us>
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