Commit Graph

15 Commits

Author SHA1 Message Date
Avi Kivity
5a061fe66e lsa: increase segment size
While #152 is still open, we need to allow for moderately sized allocations
to succeed.  Extend the segment size to 256k, which allows for threads to
be allocated.

Fixes #151.
2015-08-16 19:26:59 +03:00
Avi Kivity
ecc3ccc716 lsa: emergency segment reserve for compaction
To free memory, we need to allocate memory.  In lsa compaction, we convert
N segments with average occupancy of (N-1)/N into N-1 new segments.  However,
to do that, we need to allocate segments, which we may not be able to do
due to the low memory condition which caused us to compact anyway.

Fix by introducing a segment reserve, which we normally try to ensure is
full.  During low memory conditions, we temporarily allow allocating from
the emergency reserve.
2015-08-12 11:29:09 +03:00
Tomasz Grabiec
ef549ae5a5 lsa: Reclaim space from evictable regions incrementally
When LSA reclaimer cannot reclaim more space by compaction, it
will reclaim data by evicting from evictable regions.

Currently the only evictable region is the one owned by the row cache.
2015-08-08 09:59:24 +02:00
Tomasz Grabiec
a095b39091 lsa: Don't leak empty _active segment in merge() 2015-08-08 09:59:24 +02:00
Tomasz Grabiec
5b5c0038e6 lsa: Don't allocate aligned segments
Requiring alignment means that there must be 64K of contiguous space
to allocate each 32K segment. When memory is fragmented, we may fail
to allocate such segment, even though there's plenty of free space.

This especially hurts forward progress of compaction, which frees
segments randomly and relies on the fact that freeing a segment will
make it available to the next segment request.
2015-08-07 22:13:17 +02:00
Tomasz Grabiec
64bd4bee94 lsa: Log segment closing and releasing on trace level 2015-08-07 22:06:15 +02:00
Tomasz Grabiec
02ff31b815 lsa: Reduce amount of calls to descriptor() in free() 2015-08-07 22:05:53 +02:00
Tomasz Grabiec
7b7b6dd301 lsa: Don't initialize segments 2015-08-06 18:56:48 +02:00
Tomasz Grabiec
d60c04542a lsa: Consistently use segment::at() to access data 2015-08-06 18:56:48 +02:00
Tomasz Grabiec
112385455e lsa: Drop unnecessary use of __int128_t in reclaim() 2015-08-06 18:56:48 +02:00
Tomasz Grabiec
6ae0747fe5 lsa: Use size_t for sizes 2015-08-06 18:40:06 +02:00
Tomasz Grabiec
f5fdaa61a2 lsa: Avoid overflow in reclaim() 2015-08-06 16:50:15 +02:00
Tomasz Grabiec
4389bc748e lsa: Fix target calculation in reclaim() 2015-08-06 16:19:48 +02:00
Tomasz Grabiec
df6f0c35df utils: lsa: Add reclaimer hook which compacts regions 2015-08-06 14:05:15 +02:00
Tomasz Grabiec
5a9e296803 utils: lsa: Introduce log-structured allocator 2015-08-06 14:05:15 +02:00