DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: ray.kinsella@intel.com, kuralamudhan.ramakrishnan@intel.com,
	louise.m.daly@intel.com, bruce.richardson@intel.com,
	ferruh.yigit@intel.com, konstantin.ananyev@intel.com
Subject: [dpdk-dev] [RFC 03/10] eal: make --huge-unlink an alias for --no-shared-files
Date: Thu, 31 May 2018 15:32:26 +0100	[thread overview]
Message-ID: <982894da145a836cb61999180f3f0fdeecb4cffc.1527776837.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <cover.1527776837.git.anatoly.burakov@intel.com>
In-Reply-To: <cover.1527776837.git.anatoly.burakov@intel.com>

Move all functionality associated with --huge-unlink command-line
option to --no-shared-files, and make it an alias. Since the new
command-line option does things other than just unlinking hugepage
files after they've been created, it is no longer incompatible with
--no-huge option, so removing that check as well.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_options.c | 14 ++------------
 lib/librte_eal/common/eal_internal_cfg.h   |  1 -
 lib/librte_eal/common/eal_options.h        |  5 ++---
 lib/librte_eal/linuxapp/eal/eal_memory.c   |  2 +-
 4 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 0f3eb928a..63e562bdb 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -57,7 +57,7 @@ eal_long_options[] = {
 	{OPT_FILE_PREFIX,       1, NULL, OPT_FILE_PREFIX_NUM      },
 	{OPT_HELP,              0, NULL, OPT_HELP_NUM             },
 	{OPT_HUGE_DIR,          1, NULL, OPT_HUGE_DIR_NUM         },
-	{OPT_HUGE_UNLINK,       0, NULL, OPT_HUGE_UNLINK_NUM      },
+	{OPT_HUGE_UNLINK,       0, NULL, OPT_NO_SHARED_FILES_NUM  },
 	{OPT_LCORES,            1, NULL, OPT_LCORES_NUM           },
 	{OPT_LOG_LEVEL,         1, NULL, OPT_LOG_LEVEL_NUM        },
 	{OPT_MASTER_LCORE,      1, NULL, OPT_MASTER_LCORE_NUM     },
@@ -1140,10 +1140,6 @@ eal_parse_common_option(int opt, const char *optarg,
 		break;
 
 	/* long options */
-	case OPT_HUGE_UNLINK_NUM:
-		conf->hugepage_unlink = 1;
-		break;
-
 	case OPT_NO_HUGE_NUM:
 		conf->no_hugetlbfs = 1;
 		/* no-huge is legacy mem */
@@ -1318,12 +1314,6 @@ eal_check_common_options(struct internal_config *internal_cfg)
 		return -1;
 	}
 
-	if (internal_cfg->no_hugetlbfs && internal_cfg->hugepage_unlink) {
-		RTE_LOG(ERR, EAL, "Option --"OPT_HUGE_UNLINK" cannot "
-			"be specified together with --"OPT_NO_HUGE"\n");
-		return -1;
-	}
-
 	return 0;
 }
 
@@ -1374,7 +1364,7 @@ eal_common_usage(void)
 	       "  --"OPT_NO_SHARED_FILES"   Do not create any shared files (config, hugetlbfs, etc.).\n"
 	       "                      This disables secondary process support\n"
 	       "\nEAL options for DEBUG use only:\n"
-	       "  --"OPT_HUGE_UNLINK"       Unlink hugepage files after init\n"
+	       "  --"OPT_HUGE_UNLINK"       Deprecated. Alias for --no-shared-files\n"
 	       "  --"OPT_NO_HUGE"           Use malloc instead of hugetlbfs\n"
 	       "  --"OPT_NO_PCI"            Disable PCI\n"
 	       "  --"OPT_NO_HPET"           Disable HPET\n"
diff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h
index d80bacd4d..887a6a8e2 100644
--- a/lib/librte_eal/common/eal_internal_cfg.h
+++ b/lib/librte_eal/common/eal_internal_cfg.h
@@ -35,7 +35,6 @@ struct internal_config {
 	volatile unsigned force_nchannel; /**< force number of channels */
 	volatile unsigned force_nrank;    /**< force number of ranks */
 	volatile unsigned no_hugetlbfs;   /**< true to disable hugetlbfs */
-	unsigned hugepage_unlink;         /**< true to unlink backing files */
 	volatile unsigned no_pci;         /**< true to disable PCI */
 	volatile unsigned no_hpet;        /**< true to disable HPET */
 	volatile unsigned vmware_tsc_map; /**< true to use VMware TSC mapping
diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h
index 6890d4114..aef696c92 100644
--- a/lib/librte_eal/common/eal_options.h
+++ b/lib/librte_eal/common/eal_options.h
@@ -25,8 +25,6 @@ enum {
 	OPT_FILE_PREFIX_NUM,
 #define OPT_HUGE_DIR          "huge-dir"
 	OPT_HUGE_DIR_NUM,
-#define OPT_HUGE_UNLINK       "huge-unlink"
-	OPT_HUGE_UNLINK_NUM,
 #define OPT_LCORES            "lcores"
 	OPT_LCORES_NUM,
 #define OPT_LOG_LEVEL         "log-level"
@@ -43,7 +41,8 @@ enum {
 	OPT_NO_HUGE_NUM,
 #define OPT_NO_PCI            "no-pci"
 	OPT_NO_PCI_NUM,
-/* no-shconf is an alias for no-shared-files */
+/* huge-unlink and no-shconf are alias for no-shared-files */
+#define OPT_HUGE_UNLINK       "huge-unlink"
 #define OPT_NO_SHCONF         "no-shconf"
 #define OPT_NO_SHARED_FILES   "no-shared-files"
 	OPT_NO_SHARED_FILES_NUM,
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index c917de1c2..5e1810712 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -1547,7 +1547,7 @@ eal_legacy_hugepage_init(void)
 	}
 
 	/* free the hugepage backing files */
-	if (internal_config.hugepage_unlink &&
+	if (internal_config.no_shared_files &&
 		unlink_hugepage_files(tmp_hp, internal_config.num_hugepage_sizes) < 0) {
 		RTE_LOG(ERR, EAL, "Unlinking hugepage files failed!\n");
 		goto fail;
-- 
2.17.0

  parent reply	other threads:[~2018-05-31 14:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 14:32 [dpdk-dev] [RFC 00/10] Support running DPDK without hugetlbfs mountpoint Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 01/10] eal: add --no-shared-files option Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 02/10] eal: make --no-shconf an alias for --no-shared-files Anatoly Burakov
2018-05-31 14:32 ` Anatoly Burakov [this message]
2018-05-31 14:32 ` [dpdk-dev] [RFC 04/10] fbarray: support no-shared-files mode Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 05/10] mem: add support for " Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 06/10] ipc: " Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 07/10] eal: add support for no-shared-files for hugepage info Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 08/10] eal: add support for no-shared-files in hugepage data file Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 09/10] eal: do not create runtime dir in no-shared-files mode Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 10/10] mem: enable memfd-based hugepage allocation Anatoly Burakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=982894da145a836cb61999180f3f0fdeecb4cffc.1527776837.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=kuralamudhan.ramakrishnan@intel.com \
    --cc=louise.m.daly@intel.com \
    --cc=ray.kinsella@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).