get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 38792,
    "url": "http://patches.dpdk.org/api/patches/38792/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/a722290d4687d87f4a85ffb0fc42db23ae15dc71.1524564892.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": "<a722290d4687d87f4a85ffb0fc42db23ae15dc71.1524564892.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/a722290d4687d87f4a85ffb0fc42db23ae15dc71.1524564892.git.anatoly.burakov@intel.com",
    "date": "2018-04-24T10:19:24",
    "name": "[dpdk-dev,v3,3/3] mem: improve autodetection of hugepage counts on 32-bit",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "327d3b5e6ed450ba1d16438e843b1a2304e1d626",
    "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/a722290d4687d87f4a85ffb0fc42db23ae15dc71.1524564892.git.anatoly.burakov@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/38792/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/38792/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 1E0C62A66;\n\tTue, 24 Apr 2018 12:19:36 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id F0DFA2B92\n\tfor <dev@dpdk.org>; Tue, 24 Apr 2018 12:19:31 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Apr 2018 03:19:30 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga005.jf.intel.com with ESMTP; 24 Apr 2018 03:19:25 -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\tw3OAJPHI001390; Tue, 24 Apr 2018 11:19:25 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w3OAJPdk024936;\n\tTue, 24 Apr 2018 11:19:25 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w3OAJPUR024931;\n\tTue, 24 Apr 2018 11:19:25 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.49,322,1520924400\"; d=\"scan'208\";a=\"218945518\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "reshma.pattan@intel.com",
        "Date": "Tue, 24 Apr 2018 11:19:24 +0100",
        "Message-Id": "<a722290d4687d87f4a85ffb0fc42db23ae15dc71.1524564892.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<c8375f94e07e2ed99090eaefb4f4c4bb657c5206.1524564892.git.anatoly.burakov@intel.com>",
            "<c8375f94e07e2ed99090eaefb4f4c4bb657c5206.1524237907.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<c8375f94e07e2ed99090eaefb4f4c4bb657c5206.1524564892.git.anatoly.burakov@intel.com>",
            "<c8375f94e07e2ed99090eaefb4f4c4bb657c5206.1524237907.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v3 3/3] mem: improve autodetection of hugepage\n\tcounts on 32-bit",
        "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": "For non-legacy mode, we are preallocating space for hugepages, so\nwe know in advance which pages we will be able to allocate, and\nwhich we won't. However, the init procedure was using hugepage\ncounts gathered from sysfs and paid no attention to hugepage\nsizes that were actually available for reservation, and failed\non attempts to reserve unavailable pages.\n\nFix this by limiting total page counts by number of pages\nactually preallocated.\n\nAlso, VA preallocate procedure only looks at mountpoints that are\navailable, and expects pages to exist if a mountpoint exists. That\nmight not necessarily be the case, so also check if there are\nhugepages available for a particular page size on a particular\nNUMA node.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n    v3:\n    - Added a check to see if pages are actually available before\n      reserving VA space for them. Only applies to 32-bit non-legacy.\n\n lib/librte_eal/common/eal_common_memory.c |  4 ++++\n lib/librte_eal/linuxapp/eal/eal_memory.c  | 31 +++++++++++++++++++++++++++++++\n 2 files changed, 35 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex d819abe..991979c 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -329,6 +329,10 @@ memseg_primary_init_32(void)\n \t\t\thpi = &internal_config.hugepage_info[hpi_idx];\n \t\t\thugepage_sz = hpi->hugepage_sz;\n \n+\t\t\t/* check if pages are actually available */\n+\t\t\tif (hpi->num_pages[socket_id] == 0)\n+\t\t\t\tcontinue;\n+\n \t\t\tmax_segs = RTE_MAX_MEMSEG_PER_TYPE;\n \t\t\tmax_pagesz_mem = max_socket_mem - cur_socket_mem;\n \ndiff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c\nindex fadc1de..6f2cdf8 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memory.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c\n@@ -1603,6 +1603,18 @@ eal_legacy_hugepage_init(void)\n \treturn -1;\n }\n \n+static int __rte_unused\n+hugepage_count_walk(const struct rte_memseg_list *msl, void *arg)\n+{\n+\tstruct hugepage_info *hpi = arg;\n+\n+\tif (msl->page_sz != hpi->hugepage_sz)\n+\t\treturn 0;\n+\n+\thpi->num_pages[msl->socket_id] += msl->memseg_arr.len;\n+\treturn 0;\n+}\n+\n static int\n eal_hugepage_init(void)\n {\n@@ -1617,10 +1629,29 @@ eal_hugepage_init(void)\n \tfor (hp_sz_idx = 0;\n \t\t\thp_sz_idx < (int) internal_config.num_hugepage_sizes;\n \t\t\thp_sz_idx++) {\n+#ifndef RTE_ARCH_64\n+\t\tstruct hugepage_info dummy;\n+\t\tunsigned int i;\n+#endif\n \t\t/* also initialize used_hp hugepage sizes in used_hp */\n \t\tstruct hugepage_info *hpi;\n \t\thpi = &internal_config.hugepage_info[hp_sz_idx];\n \t\tused_hp[hp_sz_idx].hugepage_sz = hpi->hugepage_sz;\n+\n+#ifndef RTE_ARCH_64\n+\t\t/* for 32-bit, limit number of pages on socket to whatever we've\n+\t\t * preallocated, as we cannot allocate more.\n+\t\t */\n+\t\tmemset(&dummy, 0, sizeof(dummy));\n+\t\tdummy.hugepage_sz = hpi->hugepage_sz;\n+\t\tif (rte_memseg_list_walk(hugepage_count_walk, &dummy) < 0)\n+\t\t\treturn -1;\n+\n+\t\tfor (i = 0; i < RTE_DIM(dummy.num_pages); i++) {\n+\t\t\thpi->num_pages[i] = RTE_MIN(hpi->num_pages[i],\n+\t\t\t\t\tdummy.num_pages[i]);\n+\t\t}\n+#endif\n \t}\n \n \t/* make a copy of socket_mem, needed for balanced allocation. */\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "3/3"
    ]
}