get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7787,
    "url": "https://patches.dpdk.org/api/patches/7787/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/D24BC18B.23BEE%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": "<D24BC18B.23BEE%shesha@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/D24BC18B.23BEE%shesha@cisco.com",
    "date": "2015-10-20T17:04:50",
    "name": "[dpdk-dev,v2] mem: command line option to delete hugepage backing files",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3b9477ec152bb14717441947a7c20522afb3bc6f",
    "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/D24BC18B.23BEE%25shesha@cisco.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7787/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7787/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 342AB8E7A;\n\tTue, 20 Oct 2015 19:05:13 +0200 (CEST)",
            "from alln-iport-3.cisco.com (alln-iport-3.cisco.com\n\t[173.37.142.90]) by dpdk.org (Postfix) with ESMTP id 16DB45A5E\n\tfor <dev@dpdk.org>; Tue, 20 Oct 2015 19:05:10 +0200 (CEST)",
            "from rcdn-core-5.cisco.com ([173.37.93.156])\n\tby alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Oct 2015 17:05:09 +0000",
            "from XCH-ALN-004.cisco.com (xch-aln-004.cisco.com [173.36.7.14])\n\tby rcdn-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id t9KH59lj003345\n\t(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL);\n\tTue, 20 Oct 2015 17:05:09 GMT",
            "from xch-rcd-004.cisco.com (173.37.102.14) by XCH-ALN-004.cisco.com\n\t(173.36.7.14) with Microsoft SMTP Server (TLS) id 15.0.1104.5;\n\tTue, 20 Oct 2015 12:04:50 -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, 20 Oct 2015 12:04:50 -0500"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=27047; q=dns/txt;\n\ts=iport; t=1445360711; x=1446570311;\n\th=from:to:cc:subject:date:message-id:references:\n\tin-reply-to:mime-version;\n\tbh=TpoeHtd1PGcD/Lz5vJxO+YIlThOjkIzNXDp4pXrdacg=;\n\tb=WqeghayrRdolVsbKHPDrTuitFAkxtgtdfzwbp7QimbGfayZGrNqR7Um6\n\tJXWZwGdioRmy1Lr2zJSyAynrs2JJt7LcC0Bj9Bw7HEvJBVE1V8PVyaNuy\n\tKIZAzJK5hdAK3gSWWlryuxC1gGSQz7a24jduZ/Jwp2EkG8SYtg+wI7xiv w=;",
        "X-IronPort-Anti-Spam-Filtered": "true",
        "X-IronPort-Anti-Spam-Result": "A0D4AQD4cyZW/5xdJa1dgmlNgUMGuXiEIQENgVqGHgKBOzgUAQEBAQEBAX8LhC4BAQQnUhACAUAHBzIUEQIEDgWIMMQMAQEBAQEBAQECAQEBAQEBAQEBAQEYim+GEweELgWHO4cHh2IBjR6cIAEfAQFCghEdgVVyhB4kH4EGAQEB",
        "X-IronPort-AV": "E=Sophos;i=\"5.17,707,1437436800\"; \n\td=\"scan'208,217\";a=\"199416642\"",
        "From": "\"shesha Sreenivasamurthy (shesha)\" <shesha@cisco.com>",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>",
        "Thread-Topic": "[PATCH v2] mem: command line option to delete hugepage backing\n\tfiles",
        "Thread-Index": "AQHRC1jVXvzHm9nhFUW3n7KImjqHHJ50erYA",
        "Date": "Tue, 20 Oct 2015 17:04:50 +0000",
        "Message-ID": "<D24BC18B.23BEE%shesha@cisco.com>",
        "References": "<D243F2E1.2368F%shesha@cisco.com>\n\t<1445335331-9050-1-git-send-email-shesha@cisco.com>",
        "In-Reply-To": "<1445335331-9050-1-git-send-email-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.228.81]",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-Content-Filtered-By": "Mailman/MimeDel 2.1.15",
        "Subject": "[dpdk-dev] [PATCH v2] 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 backing files are not cleaned up. This is a patch to clean those files. There are multi-process DPDK applications that may be benefited by those backing files. Therefore, I have made that configurable so that the application that does not need those backing files can remove them, thus not changing the current default behavior. The application itself can clean it up, however the rationale behind DPDK cleaning it up is, DPDK created it and therefore, it is better it unlinks it.\n\nSigned-off-by: Shesha Sreenivasamurthy <shesha@cisco.com<mailto:shesha@cisco.com>>\n---\nlib/librte_eal/common/eal_common_options.c | 12 +++++++++\nlib/librte_eal/common/eal_internal_cfg.h   |  1 +\nlib/librte_eal/common/eal_options.h        |  2 ++\nlib/librte_eal/linuxapp/eal/eal_memory.c   | 39 ++++++++++++++++++++++++++++++\n4 files changed, 54 insertions(+)\n\ngoto fail;\n}\n+ /* free the hugepage backing files */\n+ if (internal_config.hugepage_unlink &&\n+ unlink_hugepage_files(tmp_hp, used_hp,\n+ internal_config.num_hugepage_sizes) < 0) {\n+ RTE_LOG(ERR, EAL, \"Unlinking hugepage backing files failed!\\n\");\n+ goto fail;\n+ }\n+\n/* free the temporary hugepage table */\nfree(tmp_hp);\ntmp_hp = NULL;\n--\n1.9.1",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_options.c b/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{OPT_MASTER_LCORE,      1, NULL, OPT_MASTER_LCORE_NUM     },\n{OPT_NO_HPET,           0, NULL, OPT_NO_HPET_NUM          },\n{OPT_NO_HUGE,           0, NULL, OPT_NO_HUGE_NUM          },\n+ {OPT_HUGE_UNLINK,       0, NULL, OPT_HUGE_UNLINK_NUM      },\n{OPT_NO_PCI,            0, NULL, OPT_NO_PCI_NUM           },\n{OPT_NO_SHCONF,         0, NULL, OPT_NO_SHCONF_NUM        },\n{OPT_PCI_BLACKLIST,     1, NULL, OPT_PCI_BLACKLIST_NUM    },\n@@ -722,6 +723,10 @@ eal_parse_common_option(int opt, const char *optarg,\nconf->no_hugetlbfs = 1;\nbreak;\n+ case OPT_HUGE_UNLINK_NUM:\n+ conf->hugepage_unlink = 1;\n+ break;\n+\ncase OPT_NO_PCI_NUM:\nconf->no_pci = 1;\nbreak;\n@@ -856,6 +861,12 @@ eal_check_common_options(struct internal_config *internal_cfg)\nreturn -1;\n}\n+ if (internal_cfg->no_hugetlbfs && internal_cfg->hugepage_unlink) {\n+ RTE_LOG(ERR, EAL, \"Option --\"OPT_HUGE_UNLINK\" cannot \"\n+ \"be specified together with --\"OPT_NO_HUGE\"\\n\");\n+ return -1;\n+ }\n+\nif (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 0 &&\nrte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 0) {\nRTE_LOG(ERR, EAL, \"Options blacklist (-b) and whitelist (-w) \"\n@@ -906,6 +917,7 @@ eal_common_usage(void)\n       \"  -h, --help          This help\\n\"\n       \"\\nEAL options for DEBUG use only:\\n\"\n       \"  --\"OPT_NO_HUGE\"           Use malloc instead of hugetlbfs\\n\"\n+        \"  --\"OPT_HUGE_UNLINK\"       Unlink hugepage backing file after initalization\\n\"\n       \"  --\"OPT_NO_PCI\"            Disable PCI\\n\"\n       \"  --\"OPT_NO_HPET\"           Disable HPET\\n\"\n       \"  --\"OPT_NO_SHCONF\"         No shared config (mmap'd files)\\n\"\ndiff --git a/lib/librte_eal/common/eal_internal_cfg.h b/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 {\nvolatile unsigned force_nchannel; /**< force number of channels */\nvolatile unsigned force_nrank;    /**< force number of ranks */\nvolatile unsigned no_hugetlbfs;   /**< true to disable hugetlbfs */\n+ volatile unsigned hugepage_unlink; /** < true to unlink backing files */\nvolatile unsigned xen_dom0_support; /**< support app running on Xen Dom0*/\nvolatile unsigned no_pci;         /**< true to disable PCI */\nvolatile unsigned no_hpet;        /**< true to disable HPET */\ndiff --git a/lib/librte_eal/common/eal_options.h b/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 {\nOPT_PROC_TYPE_NUM,\n#define OPT_NO_HPET           \"no-hpet\"\nOPT_NO_HPET_NUM,\n+#define OPT_HUGE_UNLINK        \"huge-unlink\"\n+ OPT_HUGE_UNLINK_NUM,\n#define OPT_NO_HUGE           \"no-huge\"\nOPT_NO_HUGE_NUM,\n#define OPT_NO_PCI            \"no-pci\"\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c\nindex ac2745e..2b86428 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,37 @@ copy_hugepages_to_shared_mem(struct hugepage_file * dst, int dest_size,\nreturn 0;\n}\n+static int\n+unlink_hugepage_files(struct hugepage_file *hugepg_tbl,\n+ struct hugepage_info *hpi,\n+ unsigned num_hp_info)\n+{\n+ unsigned socket, size;\n+ int page, nrpages = 0;\n+\n+ /* get total number of hugepages */\n+ for (size = 0; size < num_hp_info; size++)\n+ for (socket = 0; socket < RTE_MAX_NUMA_NODES; socket++)\n+ nrpages += internal_config.hugepage_info[size].num_pages[socket];\n+\n+ for (size = 0; size < num_hp_info; size++) {\n+ for (socket = 0; socket < RTE_MAX_NUMA_NODES; socket++) {\n+ for (page = 0; page < nrpages; page++) {\n+ struct hugepage_file *hp = &hugepg_tbl[page];\n+ if ((hp->size == hpi[size].hugepage_sz) &&\n+ (hp->socket_id == (int) socket) &&\n+ hp->final_va != NULL) {\n+ if (unlink(hp->filepath)) {\n+ RTE_LOG(WARNING, EAL, \"%s(): Removing %s failed: %s\\n\",\n+ __func__, hp->filepath, strerror(errno));\n+ }\n+ }\n+ } /* foreach page */\n+ } /* foreach socket */\n+ } /* foreach pagesize */\n+ return 0;\n+}\n+\n/*\n  * unmaps hugepages that are not going to be used. since we originally allocate\n  * ALL hugepages (not just those we need), additional unmapping needs to be done.\n@@ -1289,6 +1320,14 @@ rte_eal_hugepage_init(void)\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}