Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/45032/?format=api
http://patches.dpdk.org/api/patches/45032/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/7e4178219213303b982e505ae4cb4387d9d3814a.1537447684.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": "<7e4178219213303b982e505ae4cb4387d9d3814a.1537447684.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/7e4178219213303b982e505ae4cb4387d9d3814a.1537447684.git.anatoly.burakov@intel.com", "date": "2018-09-20T12:50:35", "name": "[v2] mem: fix undefined behavior in NUMA code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "52d2569c335da011780be4ceebfd15b1b8dd7c0c", "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/7e4178219213303b982e505ae4cb4387d9d3814a.1537447684.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 1417, "url": "http://patches.dpdk.org/api/series/1417/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1417", "date": "2018-09-20T12:50:35", "name": "[v2] mem: fix undefined behavior in NUMA code", "version": 2, "mbox": "http://patches.dpdk.org/series/1417/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/45032/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/45032/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 A04E47CEB;\n\tThu, 20 Sep 2018 14:50:54 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id C43877CB0;\n\tThu, 20 Sep 2018 14:50:52 +0200 (CEST)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Sep 2018 05:50:51 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga004.jf.intel.com with ESMTP; 20 Sep 2018 05:50:35 -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\tw8KCoZHs014810; Thu, 20 Sep 2018 13:50:35 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w8KCoZX7020787;\n\tThu, 20 Sep 2018 13:50:35 +0100", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w8KCoZrf020783;\n\tThu, 20 Sep 2018 13:50:35 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.53,398,1531810800\"; d=\"scan'208\";a=\"234516481\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "solal.pirelli@gmail.com, i.maximets@samsung.com, stable@dpdk.org", "Date": "Thu, 20 Sep 2018 13:50:35 +0100", "Message-Id": "<7e4178219213303b982e505ae4cb4387d9d3814a.1537447684.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": "<2624b855f3454691212cdb244f04926631c391a2.1535544966.git.anatoly.burakov@intel.com>", "References": "<2624b855f3454691212cdb244f04926631c391a2.1535544966.git.anatoly.burakov@intel.com>", "Subject": "[dpdk-dev] [PATCH v2] mem: fix undefined behavior in NUMA code", "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://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "When NUMA-aware hugepages config option is set, we rely on\nlibnuma to tell the kernel to allocate hugepages on a specific\nNUMA node. However, we allocate node mask before we check if\nNUMA is available in the first place, which, according to\nthe manpage [1], causes undefined behaviour.\n\nFix by only using nodemask when we have NUMA available.\n\n[1] https://linux.die.net/man/3/numa_alloc_onnode\n\nBugzilla ID: 20\n\nFixes: 1b72605d2416 (\"mem: balanced allocation of hugepages\")\nCc: i.maximets@samsung.com\nCc: stable@dpdk.org\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/linuxapp/eal/eal_memory.c | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c\nindex dbf19499e..1a2a84a65 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memory.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c\n@@ -263,7 +263,7 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi,\n \tint node_id = -1;\n \tint essential_prev = 0;\n \tint oldpolicy;\n-\tstruct bitmask *oldmask = numa_allocate_nodemask();\n+\tstruct bitmask *oldmask = NULL;\n \tbool have_numa = true;\n \tunsigned long maxnode = 0;\n \n@@ -275,6 +275,7 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi,\n \n \tif (have_numa) {\n \t\tRTE_LOG(DEBUG, EAL, \"Trying to obtain current memory policy.\\n\");\n+\t\toldmask = numa_allocate_nodemask();\n \t\tif (get_mempolicy(&oldpolicy, oldmask->maskp,\n \t\t\t\t oldmask->size + 1, 0, 0) < 0) {\n \t\t\tRTE_LOG(ERR, EAL,\n@@ -401,8 +402,8 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi,\n \t\t\t\tstrerror(errno));\n \t\t\tnuma_set_localalloc();\n \t\t}\n+\t\tnuma_free_cpumask(oldmask);\n \t}\n-\tnuma_free_cpumask(oldmask);\n #endif\n \treturn i;\n }\n", "prefixes": [ "v2" ] }{ "id": 45032, "url": "