mem: pre-allocate only the necessary

This commit is contained in:
Thomas Schoebel-Theuer 2013-01-09 10:35:39 +01:00
parent 93b05fc6db
commit fb964fcc75
2 changed files with 16 additions and 22 deletions

View File

@ -9,6 +9,17 @@
//#define STAT_DEBUGGING // here means: display full statistics
//#define HASH_DEBUGGING
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/bio.h>
#include "mars.h"
#include "lib_rank.h"
#include "lib_limiter.h"
#include "mars_trans_logger.h"
// variants
#define KEEP_UNIQUE
#define DELAY_CALLERS // this is _needed_ for production systems
@ -20,22 +31,15 @@
#define APPLY_DATA
// tuning
#define CONF_TRANS_CHUNKSIZE (128 * 1024)
#ifdef BRICK_DEBUG_MEM
#define CONF_TRANS_CHUNKSIZE (128 * 1024 - PAGE_SIZE * 2)
#else
#define CONF_TRANS_CHUNKSIZE (128 * 1024)
#endif
#define CONF_TRANS_MAX_MREF_SIZE PAGE_SIZE
//#define CONF_TRANS_ALIGN PAGE_SIZE // FIXME: does not work
#define CONF_TRANS_ALIGN 0
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/bio.h>
#include "mars.h"
#include "lib_rank.h"
#include "lib_limiter.h"
#include "mars_trans_logger.h"
#ifdef REPLAY_DEBUGGING
#define MARS_RPL(_fmt, _args...) _MARS_MSG(false, "REPLAY ", _fmt, ##_args)
#else

View File

@ -4071,17 +4071,7 @@ done:
static struct mem_reservation global_reserve = {
.amount = {
[1] = 32,
[2] = 32,
[3] = 32,
[4] = 64,
[5] = 64,
[6] = 64,
[7] = 2,
[8] = 2,
[9] = 1,
[10] = 1,
[11] = 0,
},
};