get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 125754,
    "url": "http://patches.dpdk.org/api/patches/125754/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230404124840.1898-3-david.marchand@redhat.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": "<20230404124840.1898-3-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230404124840.1898-3-david.marchand@redhat.com",
    "date": "2023-04-04T12:48:26",
    "name": "[v3,02/16] mem: rework malloc heap init",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a7f1bbe4b8ce2870b51028bd019acfcf24b124e2",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.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/20230404124840.1898-3-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 27617,
            "url": "http://patches.dpdk.org/api/series/27617/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27617",
            "date": "2023-04-04T12:48:24",
            "name": "Enable lock annotations on most libraries and drivers",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/27617/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/125754/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/125754/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 925A7428CD;\n\tTue,  4 Apr 2023 14:49:07 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8091E42B71;\n\tTue,  4 Apr 2023 14:49:07 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 6E39242B7E\n for <dev@dpdk.org>; Tue,  4 Apr 2023 14:49:06 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-160-CaDGn5-8NbiK2q5Padce8g-1; Tue, 04 Apr 2023 08:49:00 -0400",
            "from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com\n [10.11.54.9])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 860D72807D6E;\n Tue,  4 Apr 2023 12:48:59 +0000 (UTC)",
            "from dmarchan.redhat.com (unknown [10.45.225.38])\n by smtp.corp.redhat.com (Postfix) with ESMTP id F138F492C13;\n Tue,  4 Apr 2023 12:48:57 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1680612546;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=SZJ7ulxFx35Sp5nqIxL3N/qdf1XC23Q5HQIhtCFL3uQ=;\n b=PawD7f1aCrhmj21HhuMMFciKvC4TH8UJqcEOez6TO6P5RmDgaQ7zRtEDMfSzUD1fyu5lOF\n AgmWmCt7LnG1/CVKV69Oqq8Bj97QBzlJbxjH7i9re0p3fvKdMK+nasI7mm3ptr4cq6qy+z\n Dhi7civJ5OEuZGi2cvbZ8OMl/lOkAbw=",
        "X-MC-Unique": "CaDGn5-8NbiK2q5Padce8g-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, Anatoly Burakov <anatoly.burakov@intel.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>",
        "Subject": "[PATCH v3 02/16] mem: rework malloc heap init",
        "Date": "Tue,  4 Apr 2023 14:48:26 +0200",
        "Message-Id": "<20230404124840.1898-3-david.marchand@redhat.com>",
        "In-Reply-To": "<20230404124840.1898-1-david.marchand@redhat.com>",
        "References": "<20230224081642.2566619-1-david.marchand@redhat.com>\n <20230404124840.1898-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.9",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "rte_eal_memory_init() and rte_eal_malloc_heap_init() must be called in\na common section taking rte_mcfg_mem_read_lock().\nSplit rte_eal_malloc_heap_init() in two so that the mem lock is taken\nin rte_eal_init() making lock checks trivial (once annotated in the next\npatch).\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n lib/eal/common/eal_common_memory.c | 10 +---------\n lib/eal/common/malloc_heap.c       | 10 ++++++----\n lib/eal/common/malloc_heap.h       |  3 +++\n lib/eal/freebsd/eal.c              | 13 +++++++++++++\n lib/eal/linux/eal.c                | 13 +++++++++++++\n lib/eal/windows/eal.c              | 13 +++++++++++++\n 6 files changed, 49 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c\nindex c2a4c8f9e7..e21fc7cfae 100644\n--- a/lib/eal/common/eal_common_memory.c\n+++ b/lib/eal/common/eal_common_memory.c\n@@ -1078,18 +1078,11 @@ rte_eal_memory_detach(void)\n int\n rte_eal_memory_init(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \tconst struct internal_config *internal_conf =\n \t\teal_get_internal_configuration();\n-\n \tint retval;\n-\tRTE_LOG(DEBUG, EAL, \"Setting up physically contiguous memory...\\n\");\n-\n-\tif (!mcfg)\n-\t\treturn -1;\n \n-\t/* lock mem hotplug here, to prevent races while we init */\n-\trte_mcfg_mem_read_lock();\n+\tRTE_LOG(DEBUG, EAL, \"Setting up physically contiguous memory...\\n\");\n \n \tif (rte_eal_memseg_init() < 0)\n \t\tgoto fail;\n@@ -1108,7 +1101,6 @@ rte_eal_memory_init(void)\n \n \treturn 0;\n fail:\n-\trte_mcfg_mem_read_unlock();\n \treturn -1;\n }\n \ndiff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c\nindex d3c474d79c..d25bdc98f9 100644\n--- a/lib/eal/common/malloc_heap.c\n+++ b/lib/eal/common/malloc_heap.c\n@@ -1421,18 +1421,20 @@ rte_eal_malloc_heap_init(void)\n \t\t}\n \t}\n \n-\n \tif (register_mp_requests()) {\n \t\tRTE_LOG(ERR, EAL, \"Couldn't register malloc multiprocess actions\\n\");\n-\t\trte_mcfg_mem_read_unlock();\n \t\treturn -1;\n \t}\n \n-\t/* unlock mem hotplug here. it's safe for primary as no requests can\n+\treturn 0;\n+}\n+\n+int rte_eal_malloc_heap_populate(void)\n+{\n+\t/* mem hotplug is unlocked here. it's safe for primary as no requests can\n \t * even come before primary itself is fully initialized, and secondaries\n \t * do not need to initialize the heap.\n \t */\n-\trte_mcfg_mem_read_unlock();\n \n \t/* secondary process does not need to initialize anything */\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\ndiff --git a/lib/eal/common/malloc_heap.h b/lib/eal/common/malloc_heap.h\nindex 3b2fbc0aa0..8f3ab57154 100644\n--- a/lib/eal/common/malloc_heap.h\n+++ b/lib/eal/common/malloc_heap.h\n@@ -85,6 +85,9 @@ malloc_socket_to_heap_id(unsigned int socket_id);\n int\n rte_eal_malloc_heap_init(void);\n \n+int\n+rte_eal_malloc_heap_populate(void);\n+\n void\n rte_eal_malloc_heap_cleanup(void);\n \ndiff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c\nindex 7db4239c51..7daf22e314 100644\n--- a/lib/eal/freebsd/eal.c\n+++ b/lib/eal/freebsd/eal.c\n@@ -26,6 +26,7 @@\n #include <rte_memory.h>\n #include <rte_launch.h>\n #include <rte_eal.h>\n+#include <rte_eal_memconfig.h>\n #include <rte_errno.h>\n #include <rte_per_lcore.h>\n #include <rte_lcore.h>\n@@ -754,13 +755,25 @@ rte_eal_init(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n+\trte_mcfg_mem_read_lock();\n+\n \tif (rte_eal_memory_init() < 0) {\n+\t\trte_mcfg_mem_read_unlock();\n \t\trte_eal_init_alert(\"Cannot init memory\");\n \t\trte_errno = ENOMEM;\n \t\treturn -1;\n \t}\n \n \tif (rte_eal_malloc_heap_init() < 0) {\n+\t\trte_mcfg_mem_read_unlock();\n+\t\trte_eal_init_alert(\"Cannot init malloc heap\");\n+\t\trte_errno = ENODEV;\n+\t\treturn -1;\n+\t}\n+\n+\trte_mcfg_mem_read_unlock();\n+\n+\tif (rte_eal_malloc_heap_populate() < 0) {\n \t\trte_eal_init_alert(\"Cannot init malloc heap\");\n \t\trte_errno = ENODEV;\n \t\treturn -1;\ndiff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c\nindex c37868b7f0..ae323cd492 100644\n--- a/lib/eal/linux/eal.c\n+++ b/lib/eal/linux/eal.c\n@@ -30,6 +30,7 @@\n #include <rte_memory.h>\n #include <rte_launch.h>\n #include <rte_eal.h>\n+#include <rte_eal_memconfig.h>\n #include <rte_errno.h>\n #include <rte_lcore.h>\n #include <rte_service_component.h>\n@@ -1193,7 +1194,10 @@ rte_eal_init(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n+\trte_mcfg_mem_read_lock();\n+\n \tif (rte_eal_memory_init() < 0) {\n+\t\trte_mcfg_mem_read_unlock();\n \t\trte_eal_init_alert(\"Cannot init memory\");\n \t\trte_errno = ENOMEM;\n \t\treturn -1;\n@@ -1203,6 +1207,15 @@ rte_eal_init(int argc, char **argv)\n \teal_hugedirs_unlock();\n \n \tif (rte_eal_malloc_heap_init() < 0) {\n+\t\trte_mcfg_mem_read_unlock();\n+\t\trte_eal_init_alert(\"Cannot init malloc heap\");\n+\t\trte_errno = ENODEV;\n+\t\treturn -1;\n+\t}\n+\n+\trte_mcfg_mem_read_unlock();\n+\n+\tif (rte_eal_malloc_heap_populate() < 0) {\n \t\trte_eal_init_alert(\"Cannot init malloc heap\");\n \t\trte_errno = ENODEV;\n \t\treturn -1;\ndiff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c\nindex e7d405b91c..033825c14c 100644\n--- a/lib/eal/windows/eal.c\n+++ b/lib/eal/windows/eal.c\n@@ -12,6 +12,7 @@\n #include <rte_debug.h>\n #include <rte_bus.h>\n #include <rte_eal.h>\n+#include <rte_eal_memconfig.h>\n #include <eal_memcfg.h>\n #include <rte_errno.h>\n #include <rte_lcore.h>\n@@ -387,13 +388,25 @@ rte_eal_init(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n+\trte_mcfg_mem_read_lock();\n+\n \tif (rte_eal_memory_init() < 0) {\n+\t\trte_mcfg_mem_read_unlock();\n \t\trte_eal_init_alert(\"Cannot init memory\");\n \t\trte_errno = ENOMEM;\n \t\treturn -1;\n \t}\n \n \tif (rte_eal_malloc_heap_init() < 0) {\n+\t\trte_mcfg_mem_read_unlock();\n+\t\trte_eal_init_alert(\"Cannot init malloc heap\");\n+\t\trte_errno = ENODEV;\n+\t\treturn -1;\n+\t}\n+\n+\trte_mcfg_mem_read_unlock();\n+\n+\tif (rte_eal_malloc_heap_populate() < 0) {\n \t\trte_eal_init_alert(\"Cannot init malloc heap\");\n \t\trte_errno = ENODEV;\n \t\treturn -1;\n",
    "prefixes": [
        "v3",
        "02/16"
    ]
}