get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 48522,
    "url": "http://patchwork.dpdk.org/api/patches/48522/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/8936c9a4c7afc6671ff89469ba1c406f6b494e67.1543937627.git.anatoly.burakov@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<8936c9a4c7afc6671ff89469ba1c406f6b494e67.1543937627.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/8936c9a4c7afc6671ff89469ba1c406f6b494e67.1543937627.git.anatoly.burakov@intel.com",
    "date": "2018-12-04T15:57:58",
    "name": "[RFC] malloc: fix deadlock when using malloc stats",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "aa1ba07242c14f68f9d661d3563ac65640531ca3",
    "submitter": {
        "id": 4,
        "url": "http://patchwork.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/8936c9a4c7afc6671ff89469ba1c406f6b494e67.1543937627.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 2659,
            "url": "http://patchwork.dpdk.org/api/series/2659/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=2659",
            "date": "2018-12-04T15:57:58",
            "name": "[RFC] malloc: fix deadlock when using malloc stats",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/2659/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/48522/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/48522/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 EAA135F11;\n\tTue,  4 Dec 2018 16:58:02 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 7FA754C74\n\tfor <dev@dpdk.org>; Tue,  4 Dec 2018 16:58:01 +0100 (CET)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Dec 2018 07:58:00 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga008.jf.intel.com with ESMTP; 04 Dec 2018 07:57:59 -0800",
            "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\twB4FvwgF023659; Tue, 4 Dec 2018 15:57:58 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id wB4FvwHT008631;\n\tTue, 4 Dec 2018 15:57:58 GMT",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id wB4FvwCC008627;\n\tTue, 4 Dec 2018 15:57:58 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,314,1539673200\"; d=\"scan'208\";a=\"98567886\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, ferruh.yigit@intel.com",
        "Date": "Tue,  4 Dec 2018 15:57:58 +0000",
        "Message-Id": "<8936c9a4c7afc6671ff89469ba1c406f6b494e67.1543937627.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [RFC] malloc: fix deadlock when using malloc stats",
        "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": "Currently, malloc statistics and external heap creation code\nuse memory hotplug lock as a way to synchronize accesses to\nheaps (as in, locking the hotplug lock to prevent list of heaps\nfrom changing under our feet). At the same time, malloc\nstatistics code will also lock the heap because it needs to\naccess heap data and does not want any other thread to allocate\nanything from that heap.\n\nIn such scheme, it is possible to enter a deadlock with the\nfollowing sequence of events:\n\nthread 1\t\tthread 2\nrte_malloc()\n\t\t\trte_malloc_dump_stats()\ntake heap lock\n\t\t\ttake hotplug lock\nattempt to take\nhotplug lock\n\t\t\tattempt to take heap lock\n\nNeither thread will be able to continue, as both of them are\nwaiting for the other one to drop the lock. This can be\nfixed by adding an additional lock protecting the heap list.\n\nIn addition, to prevent further issues, we must clearly\ndefine what each lock is for, and how to use them. As is\nexplained in the code comments, there are now three locks:\n\n- Heap list lock\n  - This lock guards the changes to heap list. We need it\n    because when we allocate, we might attempt to allocate\n    from more than one heap, and we also have functions that\n    can create or destroy heaps. We need heap list to be\n    consistent for the duration of allocation attempt.\n- Heap lock\n  - This lock protects data inside a specific heap.\n- Memseg list lock\n  - Also known as memory hotplug lock. This lock protects\n    access to our internal page tables - only one thread\n    at a time is allowed to make changes to the page\n    table (be it from dynamic allocation or from creating\n    additional page tables for external heaps).\n\nFor any given operation, not all of these locks may be\nnecessary, but when they are taken out, they are to be\ntaken out in the exact order specified above - heap list\nlock first, then heap lock, then memseg list lock.\n\nFixes: 72cf92b31855 (\"malloc: index heaps using heap ID rather than NUMA node\")\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n    This breaks EAL ABI, hence submitting as RFC as it may not be\n    possible to include this in 19.02.\n\n .../common/include/rte_eal_memconfig.h        | 33 +++++++++++-\n lib/librte_eal/common/malloc_heap.c           | 38 +++++++++----\n lib/librte_eal/common/rte_malloc.c            | 54 +++++++++++--------\n 3 files changed, 92 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h b/lib/librte_eal/common/include/rte_eal_memconfig.h\nindex 84aabe36c..da3310da2 100644\n--- a/lib/librte_eal/common/include/rte_eal_memconfig.h\n+++ b/lib/librte_eal/common/include/rte_eal_memconfig.h\n@@ -41,7 +41,35 @@ struct rte_memseg_list {\n /**\n  * the structure for the memory configuration for the RTE.\n  * Used by the rte_config structure. It is separated out, as for multi-process\n- * support, the memory details should be shared across instances\n+ * support, the memory details should be shared across instances.\n+ *\n+ * For the memory subsystem, there are three locks that will be in use\n+ * throughout the memory code: heap list lock, heap lock, and memseg list lock\n+ * (aka memory hotplug lock).\n+ *\n+ * Each of these locks may not always be necessary, but any time they are used,\n+ * they must *always* be taken out in the above specified order. The purpose of\n+ * each lock is as follows:\n+ *\n+ * Heap list lock protects changes to list of malloc heaps and prevents changes\n+ * in number and/or contents of ``malloc_heaps`` array of structures. For\n+ * example, if we're allocating memory, we need to know to which heap a given\n+ * socket ID belongs to, and we might need this information multiple times (in\n+ * case of SOCKET_ID_ANY), so the heap list must stay as is untill we finish our\n+ * allocation. By convention, this lock also protects the ``next_socket_id``\n+ * value, and so must also be taken out any time this value is accessed (even if\n+ * no changes to heap list are to be expected).\n+ *\n+ * Individual heap lock is part of ``malloc_heap`` structure, and protects\n+ * contents of each individual heap. That is, multiple above described\n+ * allocations may take place concurrently, but only one of them can happen from\n+ * a given heap.\n+ *\n+ * Memseg list lock (aka memory hotplug lock) protects the internal page table\n+ * stored in the ``memsegs`` array of structures. Any time internal page tables\n+ * are to be accessed (such as allocating more memory from the system,\n+ * registering a new external heap, or even simply reading the memory map), this\n+ * lock must be taken out to manage concurrent accesses to page tables.\n  */\n struct rte_mem_config {\n \tvolatile uint32_t magic;   /**< Magic number - Sanity check. */\n@@ -72,6 +100,9 @@ struct rte_mem_config {\n \n \tstruct rte_tailq_head tailq_head[RTE_MAX_TAILQ]; /**< Tailqs for objects */\n \n+\trte_rwlock_t heap_list_lock;\n+\t/**< indicates whether list of heaps is locked */\n+\n \t/* Heaps of Malloc */\n \tstruct malloc_heap malloc_heaps[RTE_MAX_HEAPS];\n \ndiff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c\nindex c6a6d4f6b..0d2fc4025 100644\n--- a/lib/librte_eal/common/malloc_heap.c\n+++ b/lib/librte_eal/common/malloc_heap.c\n@@ -690,6 +690,7 @@ void *\n malloc_heap_alloc(const char *type, size_t size, int socket_arg,\n \t\tunsigned int flags, size_t align, size_t bound, bool contig)\n {\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \tint socket, heap_id, i;\n \tvoid *ret;\n \n@@ -705,16 +706,21 @@ malloc_heap_alloc(const char *type, size_t size, int socket_arg,\n \telse\n \t\tsocket = socket_arg;\n \n+\t/* do not allow any alterations to heaps while we're allocating */\n+\trte_rwlock_read_lock(&mcfg->heap_list_lock);\n+\n \t/* turn socket ID into heap ID */\n \theap_id = malloc_socket_to_heap_id(socket);\n \t/* if heap id is negative, socket ID was invalid */\n-\tif (heap_id < 0)\n-\t\treturn NULL;\n+\tif (heap_id < 0) {\n+\t\tret = NULL;\n+\t\tgoto unlock;\n+\t}\n \n \tret = malloc_heap_alloc_on_heap_id(type, size, heap_id, flags, align,\n \t\t\tbound, contig);\n \tif (ret != NULL || socket_arg != SOCKET_ID_ANY)\n-\t\treturn ret;\n+\t\tgoto unlock;\n \n \t/* try other heaps. we are only iterating through native DPDK sockets,\n \t * so external heaps won't be included.\n@@ -725,9 +731,12 @@ malloc_heap_alloc(const char *type, size_t size, int socket_arg,\n \t\tret = malloc_heap_alloc_on_heap_id(type, size, i, flags, align,\n \t\t\t\tbound, contig);\n \t\tif (ret != NULL)\n-\t\t\treturn ret;\n+\t\t\tgoto unlock;\n \t}\n-\treturn NULL;\n+unlock:\n+\trte_rwlock_read_unlock(&mcfg->heap_list_lock);\n+\n+\treturn ret;\n }\n \n static void *\n@@ -753,6 +762,7 @@ void *\n malloc_heap_alloc_biggest(const char *type, int socket_arg, unsigned int flags,\n \t\tsize_t align, bool contig)\n {\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \tint socket, i, cur_socket, heap_id;\n \tvoid *ret;\n \n@@ -768,16 +778,21 @@ malloc_heap_alloc_biggest(const char *type, int socket_arg, unsigned int flags,\n \telse\n \t\tsocket = socket_arg;\n \n+\t/* do not allow any alterations to heaps while we're allocating */\n+\trte_rwlock_read_lock(&mcfg->heap_list_lock);\n+\n \t/* turn socket ID into heap ID */\n \theap_id = malloc_socket_to_heap_id(socket);\n \t/* if heap id is negative, socket ID was invalid */\n-\tif (heap_id < 0)\n-\t\treturn NULL;\n+\tif (heap_id < 0) {\n+\t\tret = NULL;\n+\t\tgoto unlock;\n+\t}\n \n \tret = heap_alloc_biggest_on_heap_id(type, heap_id, flags, align,\n \t\t\tcontig);\n \tif (ret != NULL || socket_arg != SOCKET_ID_ANY)\n-\t\treturn ret;\n+\t\tgoto unlock;\n \n \t/* try other heaps */\n \tfor (i = 0; i < (int) rte_socket_count(); i++) {\n@@ -787,9 +802,12 @@ malloc_heap_alloc_biggest(const char *type, int socket_arg, unsigned int flags,\n \t\tret = heap_alloc_biggest_on_heap_id(type, i, flags, align,\n \t\t\t\tcontig);\n \t\tif (ret != NULL)\n-\t\t\treturn ret;\n+\t\t\tgoto unlock;\n \t}\n-\treturn NULL;\n+unlock:\n+\trte_rwlock_read_unlock(&mcfg->heap_list_lock);\n+\n+\treturn ret;\n }\n \n /* this function is exposed in malloc_mp.h */\ndiff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c\nindex 0da5ad5e8..8010341b6 100644\n--- a/lib/librte_eal/common/rte_malloc.c\n+++ b/lib/librte_eal/common/rte_malloc.c\n@@ -158,7 +158,7 @@ rte_malloc_get_socket_stats(int socket,\n \tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \tint heap_idx, ret = -1;\n \n-\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_lock(&mcfg->heap_list_lock);\n \n \theap_idx = malloc_socket_to_heap_id(socket);\n \tif (heap_idx < 0)\n@@ -167,7 +167,7 @@ rte_malloc_get_socket_stats(int socket,\n \tret = malloc_heap_get_stats(&mcfg->malloc_heaps[heap_idx],\n \t\t\tsocket_stats);\n unlock:\n-\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_unlock(&mcfg->heap_list_lock);\n \n \treturn ret;\n }\n@@ -181,14 +181,14 @@ rte_malloc_dump_heaps(FILE *f)\n \tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \tunsigned int idx;\n \n-\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_lock(&mcfg->heap_list_lock);\n \n \tfor (idx = 0; idx < RTE_MAX_HEAPS; idx++) {\n \t\tfprintf(f, \"Heap id: %u\\n\", idx);\n \t\tmalloc_heap_dump(&mcfg->malloc_heaps[idx], f);\n \t}\n \n-\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_unlock(&mcfg->heap_list_lock);\n }\n \n int\n@@ -206,7 +206,7 @@ rte_malloc_heap_get_socket(const char *name)\n \t\trte_errno = EINVAL;\n \t\treturn -1;\n \t}\n-\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_lock(&mcfg->heap_list_lock);\n \tfor (idx = 0; idx < RTE_MAX_HEAPS; idx++) {\n \t\tstruct malloc_heap *tmp = &mcfg->malloc_heaps[idx];\n \n@@ -222,7 +222,7 @@ rte_malloc_heap_get_socket(const char *name)\n \t\trte_errno = ENOENT;\n \t\tret = -1;\n \t}\n-\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_unlock(&mcfg->heap_list_lock);\n \n \treturn ret;\n }\n@@ -237,7 +237,7 @@ rte_malloc_heap_socket_is_external(int socket_id)\n \tif (socket_id == SOCKET_ID_ANY)\n \t\treturn 0;\n \n-\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_lock(&mcfg->heap_list_lock);\n \tfor (idx = 0; idx < RTE_MAX_HEAPS; idx++) {\n \t\tstruct malloc_heap *tmp = &mcfg->malloc_heaps[idx];\n \n@@ -247,7 +247,7 @@ rte_malloc_heap_socket_is_external(int socket_id)\n \t\t\tbreak;\n \t\t}\n \t}\n-\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_unlock(&mcfg->heap_list_lock);\n \n \treturn ret;\n }\n@@ -262,7 +262,7 @@ rte_malloc_dump_stats(FILE *f, __rte_unused const char *type)\n \tunsigned int heap_id;\n \tstruct rte_malloc_socket_stats sock_stats;\n \n-\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_lock(&mcfg->heap_list_lock);\n \n \t/* Iterate through all initialised heaps */\n \tfor (heap_id = 0; heap_id < RTE_MAX_HEAPS; heap_id++) {\n@@ -280,7 +280,7 @@ rte_malloc_dump_stats(FILE *f, __rte_unused const char *type)\n \t\tfprintf(f, \"\\tAlloc_count:%u,\\n\",sock_stats.alloc_count);\n \t\tfprintf(f, \"\\tFree_count:%u,\\n\", sock_stats.free_count);\n \t}\n-\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_unlock(&mcfg->heap_list_lock);\n \treturn;\n }\n \n@@ -351,7 +351,7 @@ rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,\n \t\trte_errno = EINVAL;\n \t\treturn -1;\n \t}\n-\trte_rwlock_write_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_lock(&mcfg->heap_list_lock);\n \n \t/* find our heap */\n \theap = find_named_heap(heap_name);\n@@ -373,13 +373,18 @@ rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,\n \t\tgoto unlock;\n \t}\n \n+\t/* see rte_eal_memconfig.h for details on locking */\n \trte_spinlock_lock(&heap->lock);\n+\trte_rwlock_write_lock(&mcfg->memory_hotplug_lock);\n+\n \tret = malloc_heap_add_external_memory(heap, va_addr, iova_addrs, n,\n \t\t\tpage_sz);\n+\n+\trte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);\n \trte_spinlock_unlock(&heap->lock);\n \n unlock:\n-\trte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_unlock(&mcfg->heap_list_lock);\n \n \treturn ret;\n }\n@@ -398,7 +403,7 @@ rte_malloc_heap_memory_remove(const char *heap_name, void *va_addr, size_t len)\n \t\trte_errno = EINVAL;\n \t\treturn -1;\n \t}\n-\trte_rwlock_write_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_lock(&mcfg->heap_list_lock);\n \t/* find our heap */\n \theap = find_named_heap(heap_name);\n \tif (heap == NULL) {\n@@ -413,12 +418,17 @@ rte_malloc_heap_memory_remove(const char *heap_name, void *va_addr, size_t len)\n \t\tgoto unlock;\n \t}\n \n+\t/* see rte_eal_memconfig.h for details on locking */\n \trte_spinlock_lock(&heap->lock);\n+\trte_rwlock_write_lock(&mcfg->memory_hotplug_lock);\n+\n \tret = malloc_heap_remove_external_memory(heap, va_addr, len);\n+\n+\trte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);\n \trte_spinlock_unlock(&heap->lock);\n \n unlock:\n-\trte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_unlock(&mcfg->heap_list_lock);\n \n \treturn ret;\n }\n@@ -489,7 +499,7 @@ sync_memory(const char *heap_name, void *va_addr, size_t len, bool attach)\n \t\trte_errno = EINVAL;\n \t\treturn -1;\n \t}\n-\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_lock(&mcfg->heap_list_lock);\n \n \t/* find our heap */\n \theap = find_named_heap(heap_name);\n@@ -511,8 +521,8 @@ sync_memory(const char *heap_name, void *va_addr, size_t len, bool attach)\n \twa.result = -ENOENT; /* fail unless explicitly told to succeed */\n \twa.attach = attach;\n \n-\t/* we're already holding a read lock */\n-\trte_memseg_list_walk_thread_unsafe(sync_mem_walk, &wa);\n+\t/* we don't need the per-heap lock here */\n+\trte_memseg_list_walk(sync_mem_walk, &wa);\n \n \tif (wa.result < 0) {\n \t\trte_errno = -wa.result;\n@@ -525,7 +535,7 @@ sync_memory(const char *heap_name, void *va_addr, size_t len, bool attach)\n \t\tret = 0;\n \t}\n unlock:\n-\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_unlock(&mcfg->heap_list_lock);\n \treturn ret;\n }\n \n@@ -558,7 +568,7 @@ rte_malloc_heap_create(const char *heap_name)\n \t/* check if there is space in the heap list, or if heap with this name\n \t * already exists.\n \t */\n-\trte_rwlock_write_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_lock(&mcfg->heap_list_lock);\n \n \tfor (i = 0; i < RTE_MAX_HEAPS; i++) {\n \t\tstruct malloc_heap *tmp = &mcfg->malloc_heaps[i];\n@@ -587,7 +597,7 @@ rte_malloc_heap_create(const char *heap_name)\n \t/* we're sure that we can create a new heap, so do it */\n \tret = malloc_heap_create(heap, heap_name);\n unlock:\n-\trte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_unlock(&mcfg->heap_list_lock);\n \n \treturn ret;\n }\n@@ -606,7 +616,7 @@ rte_malloc_heap_destroy(const char *heap_name)\n \t\trte_errno = EINVAL;\n \t\treturn -1;\n \t}\n-\trte_rwlock_write_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_lock(&mcfg->heap_list_lock);\n \n \t/* start from non-socket heaps */\n \theap = find_named_heap(heap_name);\n@@ -630,7 +640,7 @@ rte_malloc_heap_destroy(const char *heap_name)\n \tif (ret < 0)\n \t\trte_spinlock_unlock(&heap->lock);\n unlock:\n-\trte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_unlock(&mcfg->heap_list_lock);\n \n \treturn ret;\n }\n",
    "prefixes": [
        "RFC"
    ]
}