get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/8089/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 8089,
    "url": "https://patches.dpdk.org/api/patches/8089/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/D2550F8B.24612%25shesha@cisco.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<D2550F8B.24612%shesha@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/D2550F8B.24612%shesha@cisco.com",
    "date": "2015-10-27T18:26:06",
    "name": "[dpdk-dev,v5] mem: command line option to delete hugepage backing files",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "9eee565e280afde59d10f53261c5056163bc6b32",
    "submitter": {
        "id": 352,
        "url": "https://patches.dpdk.org/api/people/352/?format=api",
        "name": "shesha Sreenivasamurthy (shesha)",
        "email": "shesha@cisco.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/D2550F8B.24612%25shesha@cisco.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8089/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8089/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 9821C8DA1;\n\tTue, 27 Oct 2015 19:26:32 +0100 (CET)",
            "from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77])\n\tby dpdk.org (Postfix) with ESMTP id C746B8D8D\n\tfor <dev@dpdk.org>; Tue, 27 Oct 2015 19:26:31 +0100 (CET)",
            "from rcdn-core-8.cisco.com ([173.37.93.144])\n\tby rcdn-iport-6.cisco.com with ESMTP; 27 Oct 2015 18:26:30 +0000",
            "from XCH-RCD-005.cisco.com (xch-rcd-005.cisco.com [173.37.102.15])\n\tby rcdn-core-8.cisco.com (8.14.5/8.14.5) with ESMTP id\n\tt9RIQUMF004173\n\t(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL);\n\tTue, 27 Oct 2015 18:26:30 GMT",
            "from xch-rcd-004.cisco.com (173.37.102.14) by XCH-RCD-005.cisco.com\n\t(173.37.102.15) with Microsoft SMTP Server (TLS) id 15.0.1104.5;\n\tTue, 27 Oct 2015 13:26:06 -0500",
            "from xch-rcd-004.cisco.com ([173.37.102.14]) by\n\tXCH-RCD-004.cisco.com ([173.37.102.14]) with mapi id 15.00.1104.000;\n\tTue, 27 Oct 2015 13:26:06 -0500"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=5854; q=dns/txt; s=iport;\n\tt=1445970391; x=1447179991;\n\th=from:to:cc:subject:date:message-id:content-id:\n\tcontent-transfer-encoding:mime-version;\n\tbh=Llu0Il2ec4RL7HGe6zsBpS97/a5C8swT3T+atO1SULs=;\n\tb=RILateUV1EWRQw/lkaClmKoFL6pUPGsHAAG8Sb0vvz4/TEA6cUrePA/K\n\tWvS7avSlcz85SwW+XEmYf1wUUu73tzUTXRvfNIrc9OkVlZDYkzJkzRX5N\n\tX7WBq+neu8fiMcmXIt6gSEHUbpoE/KgVtjspBbvxwUqdwMFpl3pVsZQr3 o=;",
        "X-IronPort-Anti-Spam-Filtered": "true",
        "X-IronPort-Anti-Spam-Result": "A0AYAgABwS9W/5BdJa1egzaBQwa6YoQhAQ2BWoYagUM4FAEBAQEBAQF/C4Q1BCcTPxIBPkInBA4FiDDFcwEBAQEBAQEBAQEBAQEBAQEBHIpvhhOENQWHQIcJh28BjSOcMQEfAQFCghEdgVZyAYQkJB+BBgEBAQ",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,206,1444694400\"; d=\"scan'208\";a=\"41620337\"",
        "From": "\"shesha Sreenivasamurthy (shesha)\" <shesha@cisco.com>",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>",
        "Thread-Topic": "[PATCH v5] mem: command line option to delete hugepage backing\n\tfiles",
        "Thread-Index": "AQHREOTxrIF5JRX94kiIe54ghlfDzA==",
        "Date": "Tue, 27 Oct 2015 18:26:06 +0000",
        "Message-ID": "<D2550F8B.24612%shesha@cisco.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-ms-exchange-transport-fromentityheader": "Hosted",
        "x-originating-ip": "[10.24.15.126]",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-ID": "<B5FF062293B0914A988A36BDCC1DB5AD@emea.cisco.com>",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "Subject": "[dpdk-dev] [PATCH v5] mem: command line option to delete hugepage\n\tbacking files",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://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": "<http://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": "When an application using huge-pages crash or exists, the hugetlbfs\nbacking files are not cleaned up. This is a patch to clean those files.\nThere are multi-process DPDK applications that may be benefited by those\nbacking files. Therefore, I have made that configurable so that the\napplication that does not need those backing files can remove them, thus\nnot changing the current default behavior. The application itself can\nclean it up, however the rationale behind DPDK cleaning it up is, DPDK\ncreated it and therefore, it is better it unlinks it.\n\nSigned-off-by: Shesha Sreenivasamurthy <shesha@cisco.com>\nAcked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>\n---\n lib/librte_eal/common/eal_common_options.c | 12 ++++++++++++\n lib/librte_eal/common/eal_internal_cfg.h   |  1 +\n lib/librte_eal/common/eal_options.h        |  2 ++\n lib/librte_eal/linuxapp/eal/eal_memory.c   | 30\n++++++++++++++++++++++++++++++\n 4 files changed, 45 insertions(+)\n\nallocate\n  * ALL hugepages (not just those we need), additional unmapping needs to\nbe done.\n@@ -1289,6 +1311,14 @@ rte_eal_hugepage_init(void)\n \t\tgoto fail;\n \t}\n \n+\t/* free the hugepage backing files */\n+\tif (internal_config.hugepage_unlink &&\n+\t\tunlink_hugepage_files(tmp_hp,\n+\t\t\tinternal_config.num_hugepage_sizes) < 0) {\n+\t\t\tRTE_LOG(ERR, EAL, \"Unlinking hugepage backing files failed!\\n\");\n+\t\tgoto fail;\n+\t}\n+\n \t/* free the temporary hugepage table */\n \tfree(tmp_hp);\n \ttmp_hp = NULL;",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_options.c\nb/lib/librte_eal/common/eal_common_options.c\nindex 1f459ac..5fe6374 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -79,6 +79,7 @@ eal_long_options[] = {\n \t{OPT_MASTER_LCORE,      1, NULL, OPT_MASTER_LCORE_NUM     },\n \t{OPT_NO_HPET,           0, NULL, OPT_NO_HPET_NUM          },\n \t{OPT_NO_HUGE,           0, NULL, OPT_NO_HUGE_NUM          },\n+\t{OPT_HUGE_UNLINK,       0, NULL, OPT_HUGE_UNLINK_NUM      },\n \t{OPT_NO_PCI,            0, NULL, OPT_NO_PCI_NUM           },\n \t{OPT_NO_SHCONF,         0, NULL, OPT_NO_SHCONF_NUM        },\n \t{OPT_PCI_BLACKLIST,     1, NULL, OPT_PCI_BLACKLIST_NUM    },\n@@ -722,6 +723,10 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\tconf->no_hugetlbfs = 1;\n \t\tbreak;\n \n+\tcase OPT_HUGE_UNLINK_NUM:\n+\t\tconf->hugepage_unlink = 1;\n+\t\tbreak;\n+\n \tcase OPT_NO_PCI_NUM:\n \t\tconf->no_pci = 1;\n \t\tbreak;\n@@ -856,6 +861,12 @@ eal_check_common_options(struct internal_config\n*internal_cfg)\n \t\treturn -1;\n \t}\n \n+\tif (internal_cfg->no_hugetlbfs && internal_cfg->hugepage_unlink) {\n+\t\tRTE_LOG(ERR, EAL, \"Option --\"OPT_HUGE_UNLINK\" cannot \"\n+\t\t\t\"be specified together with --\"OPT_NO_HUGE\"\\n\");\n+\t\treturn -1;\n+\t}\n+\n \tif (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 0 &&\n \t\trte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 0) {\n \t\tRTE_LOG(ERR, EAL, \"Options blacklist (-b) and whitelist (-w) \"\n@@ -906,6 +917,7 @@ eal_common_usage(void)\n \t       \"  -h, --help          This help\\n\"\n \t       \"\\nEAL options for DEBUG use only:\\n\"\n \t       \"  --\"OPT_NO_HUGE\"           Use malloc instead of hugetlbfs\\n\"\n+\t       \"  --\"OPT_HUGE_UNLINK\"       Unlink hugepage backing file after\ninitalization\\n\"\n \t       \"  --\"OPT_NO_PCI\"            Disable PCI\\n\"\n \t       \"  --\"OPT_NO_HPET\"           Disable HPET\\n\"\n \t       \"  --\"OPT_NO_SHCONF\"         No shared config (mmap'd files)\\n\"\ndiff --git a/lib/librte_eal/common/eal_internal_cfg.h\nb/lib/librte_eal/common/eal_internal_cfg.h\nindex e2ecb0d..84b075f 100644\n--- a/lib/librte_eal/common/eal_internal_cfg.h\n+++ b/lib/librte_eal/common/eal_internal_cfg.h\n@@ -64,6 +64,7 @@ struct internal_config {\n \tvolatile unsigned force_nchannel; /**< force number of channels */\n \tvolatile unsigned force_nrank;    /**< force number of ranks */\n \tvolatile unsigned no_hugetlbfs;   /**< true to disable hugetlbfs */\n+\tvolatile unsigned hugepage_unlink; /** < true to unlink backing files */\n \tvolatile unsigned xen_dom0_support; /**< support app running on Xen\nDom0*/\n \tvolatile unsigned no_pci;         /**< true to disable PCI */\n \tvolatile unsigned no_hpet;        /**< true to disable HPET */\ndiff --git a/lib/librte_eal/common/eal_options.h\nb/lib/librte_eal/common/eal_options.h\nindex f6714d9..745f38c 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -63,6 +63,8 @@ enum {\n \tOPT_PROC_TYPE_NUM,\n #define OPT_NO_HPET           \"no-hpet\"\n \tOPT_NO_HPET_NUM,\n+#define OPT_HUGE_UNLINK        \"huge-unlink\"\n+\tOPT_HUGE_UNLINK_NUM,\n #define OPT_NO_HUGE           \"no-huge\"\n \tOPT_NO_HUGE_NUM,\n #define OPT_NO_PCI            \"no-pci\"\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c\nb/lib/librte_eal/linuxapp/eal/eal_memory.c\nindex ac2745e..c7e2485 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memory.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c\n@@ -786,6 +786,28 @@ copy_hugepages_to_shared_mem(struct hugepage_file *\ndst, int dest_size,\n \treturn 0;\n }\n \n+static int\n+unlink_hugepage_files(struct hugepage_file *hugepg_tbl,\n+\t\tunsigned num_hp_info)\n+{\n+\tunsigned socket, size;\n+\tint page, nrpages = 0;\n+\n+\t/* get total number of hugepages */\n+\tfor (size = 0; size < num_hp_info; size++)\n+\t\tfor (socket = 0; socket < RTE_MAX_NUMA_NODES; socket++)\n+\t\t\tnrpages += internal_config.hugepage_info[size].num_pages[socket];\n+\n+\tfor (page = 0; page < nrpages; page++) {\n+\t\tstruct hugepage_file *hp = &hugepg_tbl[page];\n+\t\tif (hp->final_va != NULL && unlink(hp->filepath)) {\n+\t\t\tRTE_LOG(WARNING, EAL, \"%s(): Removing %s failed: %s\\n\",\n+\t\t\t\t__func__, hp->filepath, strerror(errno));\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n /*\n  * unmaps hugepages that are not going to be used. since we originally\n",
    "prefixes": [
        "dpdk-dev",
        "v5"
    ]
}