get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50468,
    "url": "http://patches.dpdk.org/api/patches/50468/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/0a770fb3968c0a270eb57ff7764d6fba4cf6f76d.1550851998.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": "<0a770fb3968c0a270eb57ff7764d6fba4cf6f76d.1550851998.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/0a770fb3968c0a270eb57ff7764d6fba4cf6f76d.1550851998.git.anatoly.burakov@intel.com",
    "date": "2019-02-22T16:14:03",
    "name": "[3/3] eal: attempt multiple hugepage allocations at init",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7d9b0eb5b8490032e7c0cfafdaaf57f855900b37",
    "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/0a770fb3968c0a270eb57ff7764d6fba4cf6f76d.1550851998.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 3521,
            "url": "http://patches.dpdk.org/api/series/3521/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3521",
            "date": "2019-02-22T16:14:01",
            "name": "[1/3] fbarray: add API to find biggest used or free chunks",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3521/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50468/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50468/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 851C73195;\n\tFri, 22 Feb 2019 17:14:11 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id BDF572C30\n\tfor <dev@dpdk.org>; Fri, 22 Feb 2019 17:14:06 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Feb 2019 08:14:05 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 22 Feb 2019 08:14:04 -0800",
            "from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com\n\t[10.243.17.64])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tx1MGE4Uj000672; Fri, 22 Feb 2019 16:14:04 GMT",
            "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id x1MGE3DM010656;\n\tFri, 22 Feb 2019 16:14:03 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id x1MGE3uf010514;\n\tFri, 22 Feb 2019 16:14:03 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,400,1544515200\"; d=\"scan'208\";a=\"136415801\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.leroy@6wind.com",
        "Date": "Fri, 22 Feb 2019 16:14:03 +0000",
        "Message-Id": "<0a770fb3968c0a270eb57ff7764d6fba4cf6f76d.1550851998.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.com>",
            "<def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.com>",
            "<def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH 3/3] eal: attempt multiple hugepage allocations\n\tat init",
        "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 requesting memory with ``-m`` or ``--socket-mem`` flags,\ncurrently the init will fail if the requested memory amount was\nbigger than any one memseg list, even if total amount of\navailable memory was sufficient.\n\nFix this by making EAL to attempt to allocate pages multiple\ntimes, until we either fulfill our memory requirements, or run\nout of hugepages to allocate.\n\nBugzilla ID: 95\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/linuxapp/eal/eal_memory.c | 47 ++++++++++++++++--------\n 1 file changed, 32 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c\nindex 1b96b576e..361109eb3 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memory.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c\n@@ -1784,30 +1784,47 @@ eal_hugepage_init(void)\n \t\t\tstruct rte_memseg **pages;\n \t\t\tstruct hugepage_info *hpi = &used_hp[hp_sz_idx];\n \t\t\tunsigned int num_pages = hpi->num_pages[socket_id];\n-\t\t\tint num_pages_alloc, i;\n+\t\t\tunsigned int num_pages_alloc;\n \n \t\t\tif (num_pages == 0)\n \t\t\t\tcontinue;\n \n-\t\t\tpages = malloc(sizeof(*pages) * num_pages);\n-\n \t\t\tRTE_LOG(DEBUG, EAL, \"Allocating %u pages of size %\" PRIu64 \"M on socket %i\\n\",\n \t\t\t\tnum_pages, hpi->hugepage_sz >> 20, socket_id);\n \n-\t\t\tnum_pages_alloc = eal_memalloc_alloc_seg_bulk(pages,\n-\t\t\t\t\tnum_pages, hpi->hugepage_sz,\n-\t\t\t\t\tsocket_id, true);\n-\t\t\tif (num_pages_alloc < 0) {\n+\t\t\t/* we may not be able to allocate all pages in one go,\n+\t\t\t * because we break up our memory map into multiple\n+\t\t\t * memseg lists. therefore, try allocating multiple\n+\t\t\t * times and see if we can get the desired number of\n+\t\t\t * pages from multiple allocations.\n+\t\t\t */\n+\n+\t\t\tnum_pages_alloc = 0;\n+\t\t\tdo {\n+\t\t\t\tint i, cur_pages, needed;\n+\n+\t\t\t\tneeded = num_pages - num_pages_alloc;\n+\n+\t\t\t\tpages = malloc(sizeof(*pages) * needed);\n+\n+\t\t\t\t/* do not request exact number of pages */\n+\t\t\t\tcur_pages = eal_memalloc_alloc_seg_bulk(pages,\n+\t\t\t\t\t\tneeded, hpi->hugepage_sz,\n+\t\t\t\t\t\tsocket_id, false);\n+\t\t\t\tif (cur_pages <= 0) {\n+\t\t\t\t\tfree(pages);\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\n+\t\t\t\t/* mark preallocated pages as unfreeable */\n+\t\t\t\tfor (i = 0; i < cur_pages; i++) {\n+\t\t\t\t\tstruct rte_memseg *ms = pages[i];\n+\t\t\t\t\tms->flags |= RTE_MEMSEG_FLAG_DO_NOT_FREE;\n+\t\t\t\t}\n \t\t\t\tfree(pages);\n-\t\t\t\treturn -1;\n-\t\t\t}\n \n-\t\t\t/* mark preallocated pages as unfreeable */\n-\t\t\tfor (i = 0; i < num_pages_alloc; i++) {\n-\t\t\t\tstruct rte_memseg *ms = pages[i];\n-\t\t\t\tms->flags |= RTE_MEMSEG_FLAG_DO_NOT_FREE;\n-\t\t\t}\n-\t\t\tfree(pages);\n+\t\t\t\tnum_pages_alloc += cur_pages;\n+\t\t\t} while (num_pages_alloc != num_pages);\n \t\t}\n \t}\n \t/* if socket limits were specified, set them */\n",
    "prefixes": [
        "3/3"
    ]
}