users/rhaas/postgres.git
11 years agoFix build. memory2
Robert Haas [Wed, 2 Jul 2014 14:48:38 +0000 (14:48 +0000)]
Fix build.

11 years agoInlining.
Robert Haas [Fri, 13 Jun 2014 17:57:35 +0000 (17:57 +0000)]
Inlining.

11 years agoRemove balloc_map stuff and sub in an inline implementation.
Robert Haas [Fri, 13 Jun 2014 17:50:06 +0000 (17:50 +0000)]
Remove balloc_map stuff and sub in an inline implementation.

11 years agoCache the most recent region lookup.
Robert Haas [Fri, 13 Jun 2014 16:24:21 +0000 (16:24 +0000)]
Cache the most recent region lookup.

The general value of this is debatable, because access could be pretty
random across a large number of regions.  But the sort code, for example,
likes to ask about chunks of memory that were just recently allocated
or are about to be freed, so this will help there, too.  And it helps
a lot if someone (say) builds a linked list and then frees the elements
in order.

11 years agoRemove unused stuff.
Robert Haas [Thu, 12 Jun 2014 21:09:04 +0000 (21:09 +0000)]
Remove unused stuff.

11 years agoCruft removal.
Robert Haas [Thu, 12 Jun 2014 21:04:46 +0000 (17:04 -0400)]
Cruft removal.

11 years agoBlockAllocatorStats
Robert Haas [Thu, 12 Jun 2014 20:37:10 +0000 (16:37 -0400)]
BlockAllocatorStats

11 years agoFix context reset to not corrupt the context.
Robert Haas [Thu, 12 Jun 2014 19:59:25 +0000 (15:59 -0400)]
Fix context reset to not corrupt the context.

11 years agoFix a couple of XXXs.
Robert Haas [Thu, 12 Jun 2014 19:44:48 +0000 (15:44 -0400)]
Fix a couple of XXXs.

11 years agoI have a bug!
Robert Haas [Thu, 12 Jun 2014 19:43:18 +0000 (15:43 -0400)]
I have a bug!

11 years agoGet test_balloc to compile again.
Robert Haas [Wed, 11 Jun 2014 21:21:47 +0000 (17:21 -0400)]
Get test_balloc to compile again.

11 years agoFix aregion.c bugs in computing which region freelist to target.
Robert Haas [Mon, 9 Jun 2014 21:00:30 +0000 (21:00 +0000)]
Fix aregion.c bugs in computing which region freelist to target.

11 years agoRemove unneeded variable.
Robert Haas [Mon, 9 Jun 2014 18:33:26 +0000 (18:33 +0000)]
Remove unneeded variable.

11 years agoComment adjustments.
Robert Haas [Mon, 9 Jun 2014 17:32:41 +0000 (13:32 -0400)]
Comment adjustments.

11 years agoAdd realloc; finish re-plumbing sort stuff.
Robert Haas [Mon, 9 Jun 2014 17:12:45 +0000 (13:12 -0400)]
Add realloc; finish re-plumbing sort stuff.

11 years agoRemove duplicate deference.
Robert Haas [Thu, 5 Jun 2014 20:56:57 +0000 (16:56 -0400)]
Remove duplicate deference.

11 years agoFix totally wrong formula.
Robert Haas [Thu, 5 Jun 2014 20:55:56 +0000 (16:55 -0400)]
Fix totally wrong formula.

11 years agoMore MemoryContext integration.
Robert Haas [Wed, 4 Jun 2014 19:04:04 +0000 (15:04 -0400)]
More MemoryContext integration.

11 years agoBetter integration for BlockAllocatorGetChunkSpace.
Robert Haas [Wed, 4 Jun 2014 17:42:50 +0000 (13:42 -0400)]
Better integration for BlockAllocatorGetChunkSpace.

11 years agoPartially integrate with MemoryContext stuff.
Robert Haas [Tue, 13 May 2014 16:02:40 +0000 (12:02 -0400)]
Partially integrate with MemoryContext stuff.

11 years agoRemove flags argument to BlockAllocatorAlloc, and other tweaks.
Robert Haas [Tue, 13 May 2014 15:19:39 +0000 (11:19 -0400)]
Remove flags argument to BlockAllocatorAlloc, and other tweaks.

11 years agotest_sballoc -> test_balloc
Robert Haas [Tue, 13 May 2014 14:54:56 +0000 (10:54 -0400)]
test_sballoc -> test_balloc

11 years agoRenaming cleanup.
Robert Haas [Tue, 13 May 2014 14:51:35 +0000 (10:51 -0400)]
Renaming cleanup.

11 years agoMore renaming, and other edits.
Robert Haas [Mon, 12 May 2014 22:32:56 +0000 (18:32 -0400)]
More renaming, and other edits.

11 years agoMore renaming, somewhat incomplete. sb_alloc.c/h -> balloc.c/h.
Robert Haas [Mon, 12 May 2014 19:22:15 +0000 (15:22 -0400)]
More renaming, somewhat incomplete.  sb_alloc.c/h -> balloc.c/h.

11 years agosb_region.c/h -> aregion.c/h
Robert Haas [Mon, 12 May 2014 18:27:11 +0000 (14:27 -0400)]
sb_region.c/h -> aregion.c/h

11 years agoRename sb_map to BlockAllocatorMap (source file balloc_map.c/h).
Robert Haas [Mon, 12 May 2014 17:24:58 +0000 (13:24 -0400)]
Rename sb_map to BlockAllocatorMap (source file balloc_map.c/h).

11 years agoMove more stuff out of sb_alloc.h.
Robert Haas [Fri, 9 May 2014 19:33:24 +0000 (15:33 -0400)]
Move more stuff out of sb_alloc.h.

11 years agoMore efficient replacement for GetMemoryChunkSpace().
Robert Haas [Mon, 5 May 2014 16:08:06 +0000 (16:08 +0000)]
More efficient replacement for GetMemoryChunkSpace().

When the allocation size is known, we can can compute the result
directly from that, rather than working it out from the pointer itself.

11 years agoTeach sb_free about large objects; avoid hysteresis therein.
Robert Haas [Mon, 5 May 2014 14:34:02 +0000 (14:34 +0000)]
Teach sb_free about large objects; avoid hysteresis therein.

11 years agoCrude plumbing to allow 'REINDEX INDEX pgbench_accounts' to use sb_alloc.
Robert Haas [Mon, 5 May 2014 13:48:24 +0000 (09:48 -0400)]
Crude plumbing to allow 'REINDEX INDEX pgbench_accounts' to use sb_alloc.

11 years agosb_chunk_space
Robert Haas [Mon, 5 May 2014 13:48:06 +0000 (09:48 -0400)]
sb_chunk_space

11 years agoAvoid fetching the size class more than once.
Robert Haas [Tue, 29 Apr 2014 20:44:20 +0000 (20:44 +0000)]
Avoid fetching the size class more than once.

This is noticeably faster.

11 years agoCache the results of the last sb_find_leaf operation.
Robert Haas [Tue, 29 Apr 2014 19:30:36 +0000 (19:30 +0000)]
Cache the results of the last sb_find_leaf operation.

If all the memory we're accessing is in the same 4GB segment of the address
space, this eliminates calls to sb_find_leaf altogether, a significant
savings.  But even if we're ranging across more than one segment, this
should win in cases that have some degree of access locality.

11 years agoAvoid referencing memory we've already freed.
Robert Haas [Tue, 29 Apr 2014 18:08:46 +0000 (18:08 +0000)]
Avoid referencing memory we've already freed.

11 years agoFinish up sb_free.
Robert Haas [Tue, 29 Apr 2014 17:17:41 +0000 (13:17 -0400)]
Finish up sb_free.

11 years agoTeach sb_free to unlink spans and return their storage to fpm.
Robert Haas [Tue, 29 Apr 2014 16:58:18 +0000 (12:58 -0400)]
Teach sb_free to unlink spans and return their storage to fpm.

The spans themselves don't get reclaimed yet.

11 years agoReset allocator after use.
Robert Haas [Tue, 29 Apr 2014 15:42:29 +0000 (11:42 -0400)]
Reset allocator after use.

11 years agoFix bug.
Robert Haas [Tue, 29 Apr 2014 15:38:36 +0000 (11:38 -0400)]
Fix bug.

11 years agoFix a bug.
Robert Haas [Tue, 29 Apr 2014 15:31:41 +0000 (11:31 -0400)]
Fix a bug.

11 years agoFix erroneous use of fpm_base rather than base.
Robert Haas [Tue, 29 Apr 2014 15:24:42 +0000 (11:24 -0400)]
Fix erroneous use of fpm_base rather than base.

11 years agoCorrect completely bogus Assert.
Robert Haas [Tue, 29 Apr 2014 15:20:32 +0000 (11:20 -0400)]
Correct completely bogus Assert.

11 years agoAdd an Assert.
Robert Haas [Tue, 29 Apr 2014 15:20:13 +0000 (11:20 -0400)]
Add an Assert.

11 years agoFix typo.
Robert Haas [Tue, 29 Apr 2014 13:53:17 +0000 (09:53 -0400)]
Fix typo.

11 years agotest_sballoc: make a big linked list, then free it one node at a time
Robert Haas [Tue, 29 Apr 2014 11:36:24 +0000 (07:36 -0400)]
test_sballoc: make a big linked list, then free it one node at a time

11 years agoSketch out sb_free.
Robert Haas [Tue, 15 Apr 2014 21:15:37 +0000 (17:15 -0400)]
Sketch out sb_free.

11 years agotest_sballoc: show palloc stats, and delete context explicitly
Robert Haas [Fri, 11 Apr 2014 18:44:04 +0000 (14:44 -0400)]
test_sballoc: show palloc stats, and delete context explicitly

11 years agoadd some stats on memory consumption
Robert Haas [Fri, 11 Apr 2014 18:31:06 +0000 (14:31 -0400)]
add some stats on memory consumption

11 years agofix contiguous freespace reporting for previous patch
Robert Haas [Fri, 11 Apr 2014 17:22:55 +0000 (13:22 -0400)]
fix contiguous freespace reporting for previous patch

11 years agoimprove FreePageManager
Robert Haas [Fri, 11 Apr 2014 17:09:01 +0000 (13:09 -0400)]
improve FreePageManager

- fix a bug when the btree root is created from the last free page
- when the btree root is a leaf and is surrounded on either side by
  freespace, collapse it to a singleton range

11 years agoFix bugs.
Robert Haas [Fri, 11 Apr 2014 14:35:32 +0000 (14:35 +0000)]
Fix bugs.

11 years agofurther test_sballoc temporary changes
Robert Haas [Fri, 11 Apr 2014 14:32:24 +0000 (14:32 +0000)]
further test_sballoc temporary changes

11 years agoRefactoring to streamline the common case.
Robert Haas [Fri, 11 Apr 2014 01:07:08 +0000 (01:07 +0000)]
Refactoring to streamline the common case.

It makes more sense this way, too.

11 years agoRemove sb_try_to_steal_superblock.
Robert Haas [Thu, 10 Apr 2014 23:51:43 +0000 (23:51 +0000)]
Remove sb_try_to_steal_superblock.

It makes no sense with just one heap per size class.

11 years agosb_region: Improve private freelist management.
Robert Haas [Thu, 10 Apr 2014 22:57:20 +0000 (22:57 +0000)]
sb_region: Improve private freelist management.

11 years agonused->nallocatable. this avoids computing nmax for every allocation,
Robert Haas [Thu, 10 Apr 2014 21:12:31 +0000 (21:12 +0000)]
nused->nallocatable.  this avoids computing nmax for every allocation,
which turns out to speed things up *a lot* (3.7s vs. 5.3s for 100m
8-byte allocations)

11 years agoPush obsize/nmax computation down.
Robert Haas [Thu, 10 Apr 2014 20:01:52 +0000 (20:01 +0000)]
Push obsize/nmax computation down.

Testing shows this is faster (5.4s vs 5.7s for 100m 8-byte allocations).

11 years agotemporary hack for test_sballoc
Robert Haas [Thu, 10 Apr 2014 19:53:52 +0000 (19:53 +0000)]
temporary hack for test_sballoc

11 years agoRemove num_size_classes. For now, at least, it's a constant.
Robert Haas [Thu, 10 Apr 2014 19:29:07 +0000 (19:29 +0000)]
Remove num_size_classes.  For now, at least, it's a constant.

11 years agoRemove support for N heaps per size class.
Robert Haas [Thu, 10 Apr 2014 18:00:34 +0000 (18:00 +0000)]
Remove support for N heaps per size class.

Profiling shows that this is wicked expensive.

11 years agoFix bugs.
Robert Haas [Thu, 10 Apr 2014 16:43:56 +0000 (16:43 +0000)]
Fix bugs.

11 years agoFix bugs.
Robert Haas [Wed, 9 Apr 2014 18:18:18 +0000 (18:18 +0000)]
Fix bugs.

11 years agoFix compiler warnings.
Robert Haas [Wed, 9 Apr 2014 17:01:00 +0000 (17:01 +0000)]
Fix compiler warnings.

11 years agoAdd debugging code, fix bugs.
Robert Haas [Fri, 28 Mar 2014 05:51:44 +0000 (22:51 -0700)]
Add debugging code, fix bugs.

11 years agotest_sballoc improvements.
Robert Haas [Wed, 26 Mar 2014 23:55:43 +0000 (16:55 -0700)]
test_sballoc improvements.

11 years agosb_reset_allocator
Robert Haas [Wed, 26 Mar 2014 23:53:44 +0000 (16:53 -0700)]
sb_reset_allocator

11 years agoFix bugs.
Robert Haas [Wed, 26 Mar 2014 23:23:59 +0000 (16:23 -0700)]
Fix bugs.

11 years agotest_sballoc: comparison testing vs. palloc
Robert Haas [Wed, 26 Mar 2014 00:07:19 +0000 (17:07 -0700)]
test_sballoc: comparison testing vs. palloc

11 years agoFix bugs.
Robert Haas [Wed, 26 Mar 2014 00:01:12 +0000 (17:01 -0700)]
Fix bugs.

11 years agoFix bugs.
Robert Haas [Tue, 25 Mar 2014 23:23:55 +0000 (16:23 -0700)]
Fix bugs.

11 years agoFix bug in test_sballoc.
Robert Haas [Tue, 25 Mar 2014 18:29:16 +0000 (11:29 -0700)]
Fix bug in test_sballoc.

11 years agoOops.
Robert Haas [Tue, 25 Mar 2014 18:26:48 +0000 (11:26 -0700)]
Oops.

11 years agoFix bug.
Robert Haas [Tue, 25 Mar 2014 00:22:08 +0000 (17:22 -0700)]
Fix bug.

11 years agotest_sballoc
Robert Haas [Tue, 25 Mar 2014 00:19:26 +0000 (17:19 -0700)]
test_sballoc

11 years agolast bits of sb_alloc_from_heap
Robert Haas [Mon, 24 Mar 2014 23:06:21 +0000 (16:06 -0700)]
last bits of sb_alloc_from_heap

11 years agofill in more of sb_alloc_from_heap
Robert Haas [Mon, 24 Mar 2014 21:55:04 +0000 (14:55 -0700)]
fill in more of sb_alloc_from_heap

11 years agorough sketch of sb_alloc_from_heap
Robert Haas [Sat, 22 Mar 2014 14:51:17 +0000 (10:51 -0400)]
rough sketch of sb_alloc_from_heap

11 years agomore of sb_alloc, still missing some guts
Robert Haas [Fri, 21 Mar 2014 18:35:56 +0000 (14:35 -0400)]
more of sb_alloc, still missing some guts

11 years agosb_alloc, less guts.
Robert Haas [Fri, 21 Mar 2014 16:51:12 +0000 (12:51 -0400)]
sb_alloc, less guts.

11 years agosb_create_private_allocator
Robert Haas [Fri, 21 Mar 2014 11:36:22 +0000 (07:36 -0400)]
sb_create_private_allocator

11 years agosb_private_region_for_allocator, part two.
Robert Haas [Thu, 20 Mar 2014 21:43:37 +0000 (17:43 -0400)]
sb_private_region_for_allocator, part two.

11 years agoAdd private flag to sb_allocator.
Robert Haas [Wed, 19 Mar 2014 20:35:00 +0000 (16:35 -0400)]
Add private flag to sb_allocator.

11 years agosb_private_region_for_allocator, part one.
Robert Haas [Wed, 19 Mar 2014 20:28:25 +0000 (16:28 -0400)]
sb_private_region_for_allocator, part one.

11 years agosb_report_contiguous_freespace
Robert Haas [Wed, 19 Mar 2014 19:47:55 +0000 (15:47 -0400)]
sb_report_contiguous_freespace

11 years agoAdd FreePageManagerInquireLargest.
Robert Haas [Wed, 12 Mar 2014 17:25:40 +0000 (13:25 -0400)]
Add FreePageManagerInquireLargest.

11 years agosb_region_lookup
Robert Haas [Wed, 12 Mar 2014 16:40:43 +0000 (12:40 -0400)]
sb_region_lookup

11 years agoStub out sb_alloc/sb_region.
Robert Haas [Tue, 11 Mar 2014 21:33:48 +0000 (17:33 -0400)]
Stub out sb_alloc/sb_region.

11 years agosb_map: Fix typo.
Robert Haas [Tue, 11 Mar 2014 21:31:17 +0000 (17:31 -0400)]
sb_map: Fix typo.

11 years agosb_map
Robert Haas [Tue, 11 Mar 2014 19:39:10 +0000 (15:39 -0400)]
sb_map

11 years agoFix typo.
Robert Haas [Tue, 11 Mar 2014 18:04:36 +0000 (14:04 -0400)]
Fix typo.

11 years agoFix bugs.
Robert Haas [Fri, 28 Feb 2014 18:27:09 +0000 (13:27 -0500)]
Fix bugs.

11 years agoMore hacking.
Robert Haas [Thu, 27 Feb 2014 18:07:28 +0000 (13:07 -0500)]
More hacking.

11 years agoMore hacking.
Robert Haas [Thu, 27 Feb 2014 16:41:54 +0000 (11:41 -0500)]
More hacking.

11 years agoMore hacking.
Robert Haas [Wed, 26 Feb 2014 13:18:17 +0000 (08:18 -0500)]
More hacking.

11 years agoFix bugs.
Robert Haas [Fri, 21 Feb 2014 05:41:13 +0000 (00:41 -0500)]
Fix bugs.

11 years agoFix bugs.
Robert Haas [Thu, 20 Feb 2014 21:17:31 +0000 (16:17 -0500)]
Fix bugs.

11 years agoFix bugs.
Robert Haas [Thu, 20 Feb 2014 19:48:28 +0000 (14:48 -0500)]
Fix bugs.

11 years agoFix bugs.
Robert Haas [Thu, 20 Feb 2014 17:25:17 +0000 (12:25 -0500)]
Fix bugs.

11 years agotest_freepage fixes.
Robert Haas [Thu, 20 Feb 2014 16:01:44 +0000 (11:01 -0500)]
test_freepage fixes.

11 years agotest_freepage harness.
Robert Haas [Thu, 20 Feb 2014 15:45:59 +0000 (10:45 -0500)]
test_freepage harness.