allow global limitation of mrefs in trans_logger (not yet activated)

This commit is contained in:
Thomas Schoebel-Theuer 2011-11-03 12:22:50 +01:00 committed by Thomas Schoebel-Theuer
parent d4f6d3f6a4
commit fffc77a705
3 changed files with 7 additions and 0 deletions

View File

@ -587,6 +587,9 @@ int trans_logger_ref_get(struct trans_logger_output *output, struct mref_object
MARS_IO("pos = %lld len = %d\n", mref->ref_pos, mref->ref_len);
if (mref->ref_len > brick->max_mref_size && brick->max_mref_size > 0)
mref->ref_len = brick->max_mref_size;
atomic_inc(&brick->outer_balance_count);
if (atomic_read(&mref->ref_count) > 0) { // setup already performed

View File

@ -111,6 +111,7 @@ struct trans_logger_brick {
// parameters
int shadow_mem_limit; // max # master shadows
int limit_congest;// limit phase1 congestion.
int max_mref_size;// shorten mrefs to this maxlen
int align_size; // alignment between requests
int chunk_size; // must be at least 8K (better 64k)
int flush_delay; // delayed firing of incomplete chunks

View File

@ -66,6 +66,8 @@ struct light_class {
#define CONF_TRANS_SHADOW_LIMIT (65536 * 1) // don't fill the hashtable too much
#define CONF_TRANS_CHUNKSIZE (128 * 1024)
#define CONF_TRANS_MAX_MREF_SIZE 0
//#define CONF_TRANS_MAX_MREF_SIZE PAGE_SIZE
//#define CONF_TRANS_ALIGN 512
#define CONF_TRANS_ALIGN 0
//#define FLUSH_DELAY (HZ / 100 + 1)
@ -166,6 +168,7 @@ int _set_trans_params(struct mars_brick *_brick, void *private)
trans_brick->debug_shortcut = true;
#endif
trans_brick->max_mref_size = CONF_TRANS_MAX_MREF_SIZE;
trans_brick->align_size = CONF_TRANS_ALIGN;
trans_brick->chunk_size = CONF_TRANS_CHUNKSIZE;
trans_brick->flush_delay = FLUSH_DELAY;