trans_logger: make completion_semantics configurable

This commit is contained in:
Thomas Schoebel-Theuer 2012-12-30 21:48:44 +01:00
parent 5af5fbf6b2
commit ec69356a14
4 changed files with 13 additions and 7 deletions

View File

@ -42,6 +42,9 @@
///////////////////////// global tuning ////////////////////////
int trans_logger_completion_semantics = 1;
EXPORT_SYMBOL_GPL(trans_logger_completion_semantics);
int trans_logger_do_crc =
#ifdef CONFIG_MARS_DEBUG
true;
@ -1351,9 +1354,9 @@ void _complete(struct trans_logger_brick *brick, struct trans_logger_mref_aspect
CHECK_PTR(orig_mref, err);
if (orig_mref_a->is_completed ||
(pre_io &&
(brick->completion_semantics >= 2 ||
(brick->completion_semantics >= 1 && !orig_mref->ref_skip_sync)))) {
(pre_io &&
(trans_logger_completion_semantics >= 2 ||
(trans_logger_completion_semantics >= 1 && !orig_mref->ref_skip_sync)))) {
goto done;
}

View File

@ -18,6 +18,11 @@
///////////////////////// global tuning ////////////////////////
/* 0 = early completion of all writes
* 1 = early completion of non-sync
* 2 = late completion
*/
extern int trans_logger_completion_semantics;
extern int trans_logger_do_crc;
extern int trans_logger_mem_usage; // in KB
extern int trans_logger_max_depth;
@ -141,7 +146,6 @@ struct trans_logger_brick {
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 completion_semantics; // 0 = early completion of all writes, 1 = early completion of non-sync, 2 = late completion
bool replay_mode; // mode of operation
bool continuous_replay_mode; // mode of operation
bool log_reads; // additionally log pre-images

View File

@ -138,8 +138,6 @@ EXPORT_SYMBOL_GPL(mars_mem_percent);
#define CONF_TRANS_PRIO MARS_PRIO_HIGH
#define CONF_TRANS_LOG_READS false
//#define CONF_TRANS_LOG_READS true
//#define CONF_TRANS_COMPLETION_SEMANTICS 2
#define CONF_TRANS_COMPLETION_SEMANTICS 0
#define CONF_ALL_BATCHLEN 1
#define CONF_ALL_PRIO MARS_PRIO_NORMAL
@ -196,7 +194,7 @@ int _set_trans_params(struct mars_brick *_brick, void *private)
trans_brick->shadow_mem_limit = CONF_TRANS_SHADOW_LIMIT;
trans_brick->log_reads = CONF_TRANS_LOG_READS;
trans_brick->completion_semantics = CONF_TRANS_COMPLETION_SEMANTICS;
#ifdef TRANS_FAKE
trans_brick->debug_shortcut = true;
#endif

View File

@ -198,6 +198,7 @@ ctl_table mars_table[] = {
.mode = 0400,
.proc_handler = &lamport_sysctl_handler,
},
INT_ENTRY("logger_completion_semantics", trans_logger_completion_semantics, 0600),
INT_ENTRY("logger_do_crc", trans_logger_do_crc, 0600),
INT_ENTRY("syslog_min_class", brick_say_syslog_min, 0600),
INT_ENTRY("syslog_max_class", brick_say_syslog_max, 0600),