get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50467,
    "url": "http://patches.dpdk.org/api/patches/50467/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/64201abe22bfa2726cd312b774861b9aba8625c6.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": "<64201abe22bfa2726cd312b774861b9aba8625c6.1550851998.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/64201abe22bfa2726cd312b774861b9aba8625c6.1550851998.git.anatoly.burakov@intel.com",
    "date": "2019-02-22T16:14:02",
    "name": "[2/3] memalloc: improve best-effort allocation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "4c544d7fb4b3483e299366a6723707d25972499c",
    "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/64201abe22bfa2726cd312b774861b9aba8625c6.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/50467/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50467/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 F2F422C60;\n\tFri, 22 Feb 2019 17:14:09 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 368302C2B\n\tfor <dev@dpdk.org>; Fri, 22 Feb 2019 17:14:06 +0100 (CET)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga103.jf.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 fmsmga006.fm.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\tx1MGE3rH000669; Fri, 22 Feb 2019 16:14:03 GMT",
            "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id x1MGE34P010511;\n\tFri, 22 Feb 2019 16:14:03 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id x1MGE3EE010507;\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=\"321257117\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.leroy@6wind.com",
        "Date": "Fri, 22 Feb 2019 16:14:02 +0000",
        "Message-Id": "<64201abe22bfa2726cd312b774861b9aba8625c6.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 2/3] memalloc: improve best-effort allocation",
        "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, when using non-exact allocation, we were requesting\nN pages to be allocated, but allowed the memory subsystem to\nallocate less than requested. However, we were still expecting\nto see N contigous free pages in the memseg list.\n\nThis presents a problem because there is no way to try and\nallocate as many pages as possible, even if there isn't\nenough contiguous free entries in the list.\n\nTo address this, use the new \"find biggest\" fbarray API's when\nallocating non-exact number of pages. This way, we will first\ncheck how many entries in the list are actually available, and\nthen try to allocate up to that number.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/linuxapp/eal/eal_memalloc.c | 33 ++++++++++++++++++----\n 1 file changed, 28 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\nindex b6fb183db..14c3ea838 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n@@ -874,10 +874,32 @@ alloc_seg_walk(const struct rte_memseg_list *msl, void *arg)\n \tneed = wa->n_segs;\n \n \t/* try finding space in memseg list */\n-\tcur_idx = rte_fbarray_find_next_n_free(&cur_msl->memseg_arr, 0, need);\n-\tif (cur_idx < 0)\n-\t\treturn 0;\n-\tstart_idx = cur_idx;\n+\tif (wa->exact) {\n+\t\t/* if we require exact number of pages in a list, find them */\n+\t\tcur_idx = rte_fbarray_find_next_n_free(&cur_msl->memseg_arr, 0,\n+\t\t\t\tneed);\n+\t\tif (cur_idx < 0)\n+\t\t\treturn 0;\n+\t\tstart_idx = cur_idx;\n+\t} else {\n+\t\tint cur_len;\n+\n+\t\t/* we don't require exact number of pages, so we're going to go\n+\t\t * for best-effort allocation. that means finding the biggest\n+\t\t * unused block, and going with that.\n+\t\t */\n+\t\tcur_idx = rte_fbarray_find_biggest_free(&cur_msl->memseg_arr,\n+\t\t\t\t0);\n+\t\tif (cur_idx < 0)\n+\t\t\treturn 0;\n+\t\tstart_idx = cur_idx;\n+\t\t/* adjust the size to possibly be smaller than original\n+\t\t * request, but do not allow it to be bigger.\n+\t\t */\n+\t\tcur_len = rte_fbarray_find_contig_free(&cur_msl->memseg_arr,\n+\t\t\t\tcur_idx);\n+\t\tneed = RTE_MIN(need, (unsigned int)cur_len);\n+\t}\n \n \t/* do not allow any page allocations during the time we're allocating,\n \t * because file creation and locking operations are not atomic,\n@@ -954,7 +976,8 @@ alloc_seg_walk(const struct rte_memseg_list *msl, void *arg)\n \t\tcur_msl->version++;\n \tif (dir_fd >= 0)\n \t\tclose(dir_fd);\n-\treturn 1;\n+\t/* if we didn't allocate any segments, move on to the next list */\n+\treturn i > 0;\n }\n \n struct free_walk_param {\n",
    "prefixes": [
        "2/3"
    ]
}