get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44269,
    "url": "http://patches.dpdk.org/api/patches/44269/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/c5ee2a29a7dc920c2e59d4efdd120147aad4e5cb.1536072550.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": "<c5ee2a29a7dc920c2e59d4efdd120147aad4e5cb.1536072550.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/c5ee2a29a7dc920c2e59d4efdd120147aad4e5cb.1536072550.git.anatoly.burakov@intel.com",
    "date": "2018-09-04T15:01:58",
    "name": "[v2,5/9] memalloc: track page fd's in non-single file mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fe0b21d0223d266452ccd7e17a78eaf716ee509e",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/c5ee2a29a7dc920c2e59d4efdd120147aad4e5cb.1536072550.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 1176,
            "url": "http://patches.dpdk.org/api/series/1176/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1176",
            "date": "2018-09-04T15:01:53",
            "name": "Improve running DPDK without hugetlbfs mounpoint",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/1176/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44269/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44269/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 AA9764CE4;\n\tTue,  4 Sep 2018 17:02:14 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id D690F2C4F\n\tfor <dev@dpdk.org>; Tue,  4 Sep 2018 17:02:10 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Sep 2018 08:02:09 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 04 Sep 2018 08:02:03 -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\tw84F23PO020008; Tue, 4 Sep 2018 16:02:03 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w84F23cr008574;\n\tTue, 4 Sep 2018 16:02:03 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w84F23U4008570;\n\tTue, 4 Sep 2018 16:02:03 +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,329,1531810800\"; d=\"scan'208\";a=\"80776288\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com,\n\tmaxime.coquelin@redhat.com, kuralamudhan.ramakrishnan@intel.com",
        "Date": "Tue,  4 Sep 2018 16:01:58 +0100",
        "Message-Id": "<c5ee2a29a7dc920c2e59d4efdd120147aad4e5cb.1536072550.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1536072550.git.anatoly.burakov@intel.com>",
            "<cover.1536072550.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1536072550.git.anatoly.burakov@intel.com>",
            "<cover.1535041359.git.anatoly.burakov@intel.com>\n\t<cover.1536072550.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 5/9] memalloc: track page fd's in non-single\n\tfile mode",
        "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": "Previously, we were only tracking lock file fd's in single-file\nsegments mode, but did not track fd's in non-single file mode\nbecause we didn't need to (mmap() call still kept the lock). Now\nthat we are going to expose these fd's to the world, we need to\nhave access to them, so track them even in non-single file\nsegments mode.\n\nWe don't need to close fd's after mmap() because we're still\ntracking them in an fd list. Also, for anonymous hugepages mode,\nfd will always be -1 so exit early on error.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/linuxapp/eal/eal_memalloc.c | 44 ++++++++++++----------\n 1 file changed, 25 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\nindex 14bc5dce9..7d536350e 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n@@ -318,18 +318,24 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,\n \t\t/* create a hugepage file path */\n \t\teal_get_hugefile_path(path, buflen, hi->hugedir,\n \t\t\t\tlist_idx * RTE_MAX_MEMSEG_PER_LIST + seg_idx);\n-\t\tfd = open(path, O_CREAT | O_RDWR, 0600);\n+\n+\t\tfd = fd_list[list_idx].fds[seg_idx];\n+\n \t\tif (fd < 0) {\n-\t\t\tRTE_LOG(DEBUG, EAL, \"%s(): open failed: %s\\n\", __func__,\n-\t\t\t\t\tstrerror(errno));\n-\t\t\treturn -1;\n-\t\t}\n-\t\t/* take out a read lock */\n-\t\tif (lock(fd, LOCK_SH) < 0) {\n-\t\t\tRTE_LOG(ERR, EAL, \"%s(): lock failed: %s\\n\",\n-\t\t\t\t__func__, strerror(errno));\n-\t\t\tclose(fd);\n-\t\t\treturn -1;\n+\t\t\tfd = open(path, O_CREAT | O_RDWR, 0600);\n+\t\t\tif (fd < 0) {\n+\t\t\t\tRTE_LOG(DEBUG, EAL, \"%s(): open failed: %s\\n\",\n+\t\t\t\t\t__func__, strerror(errno));\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\t/* take out a read lock */\n+\t\t\tif (lock(fd, LOCK_SH) < 0) {\n+\t\t\t\tRTE_LOG(ERR, EAL, \"%s(): lock failed: %s\\n\",\n+\t\t\t\t\t__func__, strerror(errno));\n+\t\t\t\tclose(fd);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tfd_list[list_idx].fds[seg_idx] = fd;\n \t\t}\n \t}\n \treturn fd;\n@@ -601,10 +607,6 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id,\n \t\tgoto mapped;\n \t}\n #endif\n-\t/* for non-single file segments that aren't in-memory, we can close fd\n-\t * here */\n-\tif (!internal_config.single_file_segments && !internal_config.in_memory)\n-\t\tclose(fd);\n \n \tms->addr = addr;\n \tms->hugepage_sz = alloc_sz;\n@@ -634,7 +636,10 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id,\n \t\tRTE_LOG(CRIT, EAL, \"Can't mmap holes in our virtual address space\\n\");\n \t}\n resized:\n-\t/* in-memory mode will never be single-file-segments mode */\n+\t/* some codepaths will return negative fd, so exit early */\n+\tif (fd < 0)\n+\t\treturn -1;\n+\n \tif (internal_config.single_file_segments) {\n \t\tresize_hugefile(fd, path, list_idx, seg_idx, map_offset,\n \t\t\t\talloc_sz, false);\n@@ -646,6 +651,7 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id,\n \t\t\t\tlock(fd, LOCK_EX) == 1)\n \t\t\tunlink(path);\n \t\tclose(fd);\n+\t\tfd_list[list_idx].fds[seg_idx] = -1;\n \t}\n \treturn -1;\n }\n@@ -700,6 +706,7 @@ free_seg(struct rte_memseg *ms, struct hugepage_info *hi,\n \t\t}\n \t\t/* closing fd will drop the lock */\n \t\tclose(fd);\n+\t\tfd_list[list_idx].fds[seg_idx] = -1;\n \t}\n \n \tmemset(ms, 0, sizeof(*ms));\n@@ -1364,8 +1371,7 @@ eal_memalloc_init(void)\n \t\t\treturn -1;\n \n \t/* initialize all of the fd lists */\n-\tif (internal_config.single_file_segments)\n-\t\tif (rte_memseg_list_walk(fd_list_create_walk, NULL))\n-\t\t\treturn -1;\n+\tif (rte_memseg_list_walk(fd_list_create_walk, NULL))\n+\t\treturn -1;\n \treturn 0;\n }\n",
    "prefixes": [
        "v2",
        "5/9"
    ]
}