Commit 6f5840d2 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

env: remove default pre-reserved memory size



Now that we utilize DPDK dynamic memory allocation, we
no longer need to set the default pre-reserved memory size.
It'll now be 0, which implies all memory will be allocated
at runtime.

The option to pre-reserve all hugepages on the system is
now only available on BSD, so also clarify that bit in the
app usage text.

Change-Id: I5a8a1d9bf14ad6d938532d7e6254a45e4a81bb92
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/432204


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 9bec4525
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -38,19 +38,8 @@

#include "spdk/vhost.h"


#define SPDK_VHOST_DEFAULT_MEM_SIZE 1024

static const char *g_pid_path = NULL;

static void
vhost_app_opts_init(struct spdk_app_opts *opts)
{
	spdk_app_opts_init(opts);
	opts->name = "vhost";
	opts->mem_size = SPDK_VHOST_DEFAULT_MEM_SIZE;
}

static void
vhost_usage(void)
{
@@ -97,7 +86,8 @@ main(int argc, char *argv[])
	struct spdk_app_opts opts = {};
	int rc;

	vhost_app_opts_init(&opts);
	spdk_app_opts_init(&opts);
	opts.name = "vhost";

	if ((rc = spdk_app_parse_args(argc, argv, &opts, "f:S:", NULL,
				      vhost_parse_arg, vhost_usage)) !=
+1 −1
Original line number Diff line number Diff line
@@ -861,7 +861,7 @@ static struct fio_option options[] = {
		.lname		= "Memory size in MB",
		.type		= FIO_OPT_INT,
		.off1		= offsetof(struct spdk_fio_options, mem_size),
		.def		= "512",
		.def		= "0",
		.help		= "Memory Size for SPDK (MB)",
		.category	= FIO_OPT_C_ENGINE,
		.group		= FIO_OPT_G_INVALID,
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ static bool g_hex_dump = false;

static int g_shm_id = -1;

static int g_dpdk_mem = 64;
static int g_dpdk_mem = 0;

static int g_master_core = 0;

+6 −3
Original line number Diff line number Diff line
@@ -714,10 +714,13 @@ usage(void (*app_usage)(void))
	printf(" -p, --master-core <id>    master (primary) core for DPDK\n");
	printf(" -r, --rpc-socket <path>   RPC listen address (default %s)\n", SPDK_DEFAULT_RPC_ADDR);
	printf(" -s, --mem-size <size>     memory size in MB for DPDK (default: ");
	if (g_default_opts.mem_size > 0) {
		printf("%dMB)\n", g_default_opts.mem_size);
	} else {
#ifndef __linux__
	if (g_default_opts.mem_size <= 0) {
		printf("all hugepage memory)\n");
	} else
#endif
	{
		printf("%dMB)\n", g_default_opts.mem_size);
	}
	printf("     --silence-noticelog   disable notice level logging to stderr\n");
	printf(" -u, --no-pci              disable PCI access\n");
+0 −1
Original line number Diff line number Diff line
@@ -700,7 +700,6 @@ SpdkEnv::SpdkEnv(Env *base_env, const std::string &dir, const std::string &conf,
	spdk_app_opts_init(opts);
	opts->name = "rocksdb";
	opts->config_file = mConfig.c_str();
	opts->mem_size = 1024 + cache_size_in_mb;
	opts->shutdown_cb = spdk_rocksdb_shutdown;

	spdk_fs_set_cache_size(cache_size_in_mb);
Loading