Drop some notes regarding required refactoring, add grown indicator

Ref #10
parent f3a99c02
...@@ -588,7 +588,6 @@ struct fellow_busy { ...@@ -588,7 +588,6 @@ struct fellow_busy {
size_t sz_returned; size_t sz_returned;
// we add more whenever we exceed estimate // we add more whenever we exceed estimate
size_t sz_increment; size_t sz_increment;
// how much we already alloced on dsk // how much we already alloced on dsk
size_t sz_dskalloc; size_t sz_dskalloc;
...@@ -601,7 +600,7 @@ struct fellow_busy { ...@@ -601,7 +600,7 @@ struct fellow_busy {
#define FCO_MAX_REGIONS ((FELLOW_DISK_LOG_BLOCK_ENTRIES - 1) * DLE_REG_NREGION) #define FCO_MAX_REGIONS ((FELLOW_DISK_LOG_BLOCK_ENTRIES - 1) * DLE_REG_NREGION)
struct buddy_off_extent region[FCO_MAX_REGIONS]; struct buddy_off_extent region[FCO_MAX_REGIONS];
unsigned nregion; unsigned nregion;
uint8_t grown;
#define FBO_NIO 11 #define FBO_NIO 11
/* protected by fco mtx */ /* protected by fco mtx */
uint8_t io_idx; uint8_t io_idx;
...@@ -3569,6 +3568,8 @@ fellow_busy_obj_getspace(struct fellow_busy *fbo, size_t *sz, uint8_t **ptr) ...@@ -3569,6 +3568,8 @@ fellow_busy_obj_getspace(struct fellow_busy *fbo, size_t *sz, uint8_t **ptr)
fbo->sz_estimate += fbo->sz_increment; fbo->sz_estimate += fbo->sz_increment;
fbo->sz_increment <<= 1; fbo->sz_increment <<= 1;
// XXX wip
fbo->grown = 1;
} }
fcs = fbo->body_seg; fcs = fbo->body_seg;
...@@ -3946,15 +3947,34 @@ fellow_busy_free(struct fellow_busy **fbop) ...@@ -3946,15 +3947,34 @@ fellow_busy_free(struct fellow_busy **fbop)
* *
* the trouble with disk vs. mem segments * the trouble with disk vs. mem segments
* *
* the log assumes we got max 51 disk segments per obj * the log assumes we got max FCO_MAX_REGIONS = 220 regions per obj
* our memory segments must not be larger than 1/16th - 1/8 of mem * our memory segments must not be larger than 1/16th - 1/8 of mem
* *
* so: alloc one big chunk of disk, chop into smaller, individually * so: alloc one big chunk of disk, chop into smaller, individually
* checksummed segments * checksummed segments
* *
* XXX CHANGE:
* for chunked: next pow2 with every chunk, so we never get above ~50 * for chunked: next pow2 with every chunk, so we never get above ~50
* disk segments * disk segments
* *
* Ballpark
* - disk/mem = 10k
* min:
* - mem = 1GB -> max seg 128MB
* - dsk = 10TB -> max obj 1.28TB
* max:
* - max seg because I/O 1<<30 = 1 GB
* - dsk = 16EB -> max obj 1<<61 2EB
* - region sz -> 2EB / 220 = 9PB (16PB/8PB)
* - seg/obj -> 1<<31 = 2g
* - sizeof(fds) = 56
* - size of all segments in seglists: 112GB
*
* TODO:
* - region != segment
* - fbo.io independent of FCO_MAX_REGIONS
* - introduce max object size depending on dsk size
* - change region allocation such that max object will always fit
*/ */
// XXX rearrange seglists ? // XXX rearrange seglists ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment