Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/38547/?format=api
http://patches.dpdk.org/api/patches/38547/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/e9ef7c6afb5a33f798de7e32bce25d9e1482716c.1524140413.git.anatoly.burakov@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<e9ef7c6afb5a33f798de7e32bce25d9e1482716c.1524140413.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/e9ef7c6afb5a33f798de7e32bce25d9e1482716c.1524140413.git.anatoly.burakov@intel.com", "date": "2018-04-19T12:26:28", "name": "[dpdk-dev,1/2] mem: add memalloc init stage", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "937ce39834b75d9665a96ba8438a375428dd9a2f", "submitter": { "id": 4, "url": "http://patches.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/e9ef7c6afb5a33f798de7e32bce25d9e1482716c.1524140413.git.anatoly.burakov@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/38547/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/38547/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id EF877D4AE;\n\tThu, 19 Apr 2018 14:26:36 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id DF60FA49F\n\tfor <dev@dpdk.org>; Thu, 19 Apr 2018 14:26:32 +0200 (CEST)", "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Apr 2018 05:26:31 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga006.jf.intel.com with ESMTP; 19 Apr 2018 05:26:30 -0700", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw3JCQUpp004561; Thu, 19 Apr 2018 13:26:30 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w3JCQUql005266;\n\tThu, 19 Apr 2018 13:26:30 +0100", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w3JCQUMA005261;\n\tThu, 19 Apr 2018 13:26:30 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.48,469,1517904000\"; d=\"scan'208\";a=\"35464742\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "Bruce Richardson <bruce.richardson@intel.com>", "Date": "Thu, 19 Apr 2018 13:26:28 +0100", "Message-Id": "<e9ef7c6afb5a33f798de7e32bce25d9e1482716c.1524140413.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<cover.1524140413.git.anatoly.burakov@intel.com>", "<cover.1524140413.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1524140413.git.anatoly.burakov@intel.com>", "<cover.1524140413.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH 1/2] mem: add memalloc init stage", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Currently, memseg lists for secondary process are allocated on\nsync (triggered by init), when they are accessed for the first\ntime. Move this initialization to a separate init stage for\nmemalloc.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/bsdapp/eal/eal_memalloc.c | 6 +++\n lib/librte_eal/common/eal_common_memory.c | 3 ++\n lib/librte_eal/common/eal_memalloc.h | 3 ++\n lib/librte_eal/linuxapp/eal/eal_memalloc.c | 66 ++++++++++++++++++------------\n 4 files changed, 52 insertions(+), 26 deletions(-)", "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal_memalloc.c b/lib/librte_eal/bsdapp/eal/eal_memalloc.c\nindex 461732f..f7f07ab 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_memalloc.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_memalloc.c\n@@ -46,3 +46,9 @@ eal_memalloc_sync_with_primary(void)\n \tRTE_LOG(ERR, EAL, \"Memory hotplug not supported on FreeBSD\\n\");\n \treturn -1;\n }\n+\n+int\n+eal_memalloc_init(void)\n+{\n+\treturn 0;\n+}\ndiff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex 24a9ed5..dd9062d 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -864,6 +864,9 @@ rte_eal_memory_init(void)\n \tif (retval < 0)\n \t\tgoto fail;\n \n+\tif (eal_memalloc_init() < 0)\n+\t\tgoto fail;\n+\n \tretval = rte_eal_process_type() == RTE_PROC_PRIMARY ?\n \t\t\trte_eal_hugepage_init() :\n \t\t\trte_eal_hugepage_attach();\ndiff --git a/lib/librte_eal/common/eal_memalloc.h b/lib/librte_eal/common/eal_memalloc.h\nindex 6736fa3..662b3b5 100644\n--- a/lib/librte_eal/common/eal_memalloc.h\n+++ b/lib/librte_eal/common/eal_memalloc.h\n@@ -76,4 +76,7 @@ eal_memalloc_mem_alloc_validator_unregister(const char *name, int socket_id);\n int\n eal_memalloc_mem_alloc_validate(int socket_id, size_t new_len);\n \n+int\n+eal_memalloc_init(void);\n+\n #endif /* EAL_MEMALLOC_H */\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\nindex 1f553dd..162306a 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n@@ -1060,33 +1060,11 @@ sync_walk(const struct rte_memseg_list *msl, void *arg __rte_unused)\n \tstruct hugepage_info *hi = NULL;\n \tunsigned int i;\n \tint msl_idx;\n-\tbool new_msl = false;\n \n \tmsl_idx = msl - mcfg->memsegs;\n \tprimary_msl = &mcfg->memsegs[msl_idx];\n \tlocal_msl = &local_memsegs[msl_idx];\n \n-\t/* check if secondary has this memseg list set up */\n-\tif (local_msl->base_va == NULL) {\n-\t\tchar name[PATH_MAX];\n-\t\tint ret;\n-\t\tnew_msl = true;\n-\n-\t\t/* create distinct fbarrays for each secondary */\n-\t\tsnprintf(name, RTE_FBARRAY_NAME_LEN, \"%s_%i\",\n-\t\t\tprimary_msl->memseg_arr.name, getpid());\n-\n-\t\tret = rte_fbarray_init(&local_msl->memseg_arr, name,\n-\t\t\tprimary_msl->memseg_arr.len,\n-\t\t\tprimary_msl->memseg_arr.elt_sz);\n-\t\tif (ret < 0) {\n-\t\t\tRTE_LOG(ERR, EAL, \"Cannot initialize local memory map\\n\");\n-\t\t\treturn -1;\n-\t\t}\n-\n-\t\tlocal_msl->base_va = primary_msl->base_va;\n-\t}\n-\n \tfor (i = 0; i < RTE_DIM(internal_config.hugepage_info); i++) {\n \t\tuint64_t cur_sz =\n \t\t\tinternal_config.hugepage_info[i].hugepage_sz;\n@@ -1101,10 +1079,8 @@ sync_walk(const struct rte_memseg_list *msl, void *arg __rte_unused)\n \t\treturn -1;\n \t}\n \n-\t/* if versions don't match or if we have just allocated a new\n-\t * memseg list, synchronize everything\n-\t */\n-\tif ((new_msl || local_msl->version != primary_msl->version) &&\n+\t/* if versions don't match, synchronize everything */\n+\tif (local_msl->version != primary_msl->version &&\n \t\t\tsync_existing(primary_msl, local_msl, hi, msl_idx))\n \t\treturn -1;\n \treturn 0;\n@@ -1122,3 +1098,41 @@ eal_memalloc_sync_with_primary(void)\n \t\treturn -1;\n \treturn 0;\n }\n+\n+static int\n+secondary_msl_create_walk(const struct rte_memseg_list *msl,\n+\t\tvoid *arg __rte_unused)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\tstruct rte_memseg_list *primary_msl, *local_msl;\n+\tchar name[PATH_MAX];\n+\tint msl_idx, ret;\n+\n+\tmsl_idx = msl - mcfg->memsegs;\n+\tprimary_msl = &mcfg->memsegs[msl_idx];\n+\tlocal_msl = &local_memsegs[msl_idx];\n+\n+\t/* create distinct fbarrays for each secondary */\n+\tsnprintf(name, RTE_FBARRAY_NAME_LEN, \"%s_%i\",\n+\t\tprimary_msl->memseg_arr.name, getpid());\n+\n+\tret = rte_fbarray_init(&local_msl->memseg_arr, name,\n+\t\tprimary_msl->memseg_arr.len,\n+\t\tprimary_msl->memseg_arr.elt_sz);\n+\tif (ret < 0) {\n+\t\tRTE_LOG(ERR, EAL, \"Cannot initialize local memory map\\n\");\n+\t\treturn -1;\n+\t}\n+\tlocal_msl->base_va = primary_msl->base_va;\n+\n+\treturn 0;\n+}\n+\n+int\n+eal_memalloc_init(void)\n+{\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY)\n+\t\tif (rte_memseg_list_walk(secondary_msl_create_walk, NULL) < 0)\n+\t\t\treturn -1;\n+\treturn 0;\n+}\n", "prefixes": [ "dpdk-dev", "1/2" ] }{ "id": 38547, "url": "