Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/49763/?format=api
http://patchwork.dpdk.org/api/patches/49763/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20190111134931.28402-1-findtheonlyway@gmail.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": "<20190111134931.28402-1-findtheonlyway@gmail.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190111134931.28402-1-findtheonlyway@gmail.com", "date": "2019-01-11T13:49:31", "name": "vhost: fix deadlock when vhost unregister.", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4b9fa15f3ab145cfe9b50dd4d8207ff9ddb33c71", "submitter": { "id": 1203, "url": "http://patchwork.dpdk.org/api/people/1203/?format=api", "name": "孙文杰", "email": "findtheonlyway@gmail.com" }, "delegate": { "id": 2642, "url": "http://patchwork.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20190111134931.28402-1-findtheonlyway@gmail.com/mbox/", "series": [ { "id": 3141, "url": "http://patchwork.dpdk.org/api/series/3141/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=3141", "date": "2019-01-11T13:49:31", "name": "vhost: fix deadlock when vhost unregister.", "version": 1, "mbox": "http://patchwork.dpdk.org/series/3141/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/49763/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/49763/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 86F0E1B587;\n\tSat, 12 Jan 2019 23:18:37 +0100 (CET)", "from mail-pf1-f194.google.com (mail-pf1-f194.google.com\n\t[209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 190FE1BC0A\n\tfor <dev@dpdk.org>; Fri, 11 Jan 2019 14:49:42 +0100 (CET)", "by mail-pf1-f194.google.com with SMTP id i12so6984636pfo.7\n\tfor <dev@dpdk.org>; Fri, 11 Jan 2019 05:49:42 -0800 (PST)", "from localhost.localdomain ([203.100.54.194])\n\tby smtp.gmail.com with ESMTPSA id\n\to1sm117244845pgn.63.2019.01.11.05.49.38\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 11 Jan 2019 05:49:39 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=bwXUfZk83KbVZ7POj0xrfMRw4Mgq46wmwwONuJM8cyo=;\n\tb=fXm9rmIVjI8bUEGfoTr1C6NJSHWCfc/8dx2l8xovh5QzGdPNwGLO2SupXpXS1NSBh3\n\tOgdOus7BAnow3VYGZXqQbpbWI41Tk4CteoUW6tYwW9q78hOPdFZy8xIIoIwOyIb3+vBz\n\tgBb1JGL5sJVLCHsydXnugf/cbN0eGZP16EGpA+2FYEH72/lVNYlULM8JGFMnctUayFBE\n\tanBihMky2NWlEcmASDUNqglxzdFQAF/foO8IXnLdSOQPRB42hGWFhlkFfefUf9M9oqjr\n\tmHFgtQKrsxIePIYyZPSdTZF3GEoDmBrsaWzOlJdmzg3e/5ys7rXVIdXsoT06QZaj/1yK\n\tHjEQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=bwXUfZk83KbVZ7POj0xrfMRw4Mgq46wmwwONuJM8cyo=;\n\tb=agL/2QUqwkQOxYXh30wc3lCxegxWlEAY951CPPOfyPdUgJo9GFTDqOW9FWVC83IalR\n\tdQ9jx93OY4u2CT/Ss+219Nj1gc8J3NNqDArrN/tV65eRixIFCHMh9lbjN5tqglZMLP3x\n\tlt6fjwYsKsziGUFY4WY/PwLE7vdmBcRIYlLu3QcNeHY9b+lZmjCxd95w0+LbPJjBka8L\n\tYwQkKbqDoJxXlpSWEvgBVoShzbqCu6Uppgl1F04/kFk7c5vmI6pbudDNmNN6xfynOoHs\n\tjUTl+Y8TruIOO3RXiRpGRfXzsTRr6bZHuRBml2cWn3X9mrtgz2eyPfMVLgia5sFOwN3i\n\tqPxA==", "X-Gm-Message-State": "AJcUukfy7Ds48M0PvZPWphvIzqMjaeSKXHPnQwb+fSHyJNvByVKa0NLE\n\tJtQ3lDdzyt322EU8iJ6UNzkWRlvy", "X-Google-Smtp-Source": "ALg8bN6EV1swWGVVLfeGMVqvPdtTUYXYJBahr20X6/+XF74UjAr6FWPl7yuY7d58hWp5CQEN32+lDQ==", "X-Received": "by 2002:a63:c303:: with SMTP id c3mr3335587pgd.268.1547214580861;\n\tFri, 11 Jan 2019 05:49:40 -0800 (PST)", "From": "sunwenjie <findtheonlyway@gmail.com>", "To": "dev@dpdk.org", "Cc": "sunwenjie <findtheonlyway@gmail.com>", "Date": "Fri, 11 Jan 2019 21:49:31 +0800", "Message-Id": "<20190111134931.28402-1-findtheonlyway@gmail.com>", "X-Mailer": "git-send-email 2.20.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Approved-At": "Sat, 12 Jan 2019 23:18:31 +0100", "Subject": "[dpdk-dev] [PATCH] vhost: fix deadlock when vhost unregister.", "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 rte_vhost_driver_unregister delete the connection fd,\n fdset_try_del will always try and donot release the\n vhostuser.mutex if the fd is busy, but the fdset_event_dispatch\n will set the fd to busy and call vhost_user_msg_handler to get\n vhostuser.mutex, which will cause deadlock. Unlock the\n vhost_user.mutexif fdset_try_del fail and relock it when retry.\n\n Signed-off-by: findtheonlway <findtheonlyway@gmail.com>\n Signed-off-by: sunwenjie <sunwenjie@didichuxing.com>\n---\n lib/librte_vhost/socket.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c\nindex 9cf34ad17..7959c5ece 100644\n--- a/lib/librte_vhost/socket.c\n+++ b/lib/librte_vhost/socket.c\n@@ -961,13 +961,13 @@ rte_vhost_driver_unregister(const char *path)\n \tint count;\n \tstruct vhost_user_connection *conn, *next;\n \n+again:\n \tpthread_mutex_lock(&vhost_user.mutex);\n \n \tfor (i = 0; i < vhost_user.vsocket_cnt; i++) {\n \t\tstruct vhost_user_socket *vsocket = vhost_user.vsockets[i];\n \n \t\tif (!strcmp(vsocket->path, path)) {\n-again:\n \t\t\tpthread_mutex_lock(&vsocket->conn_mutex);\n \t\t\tfor (conn = TAILQ_FIRST(&vsocket->conn_list);\n \t\t\t conn != NULL;\n@@ -981,6 +981,7 @@ rte_vhost_driver_unregister(const char *path)\n \t\t\t\t */\n \t\t\t\tif (fdset_try_del(&vhost_user.fdset,\n \t\t\t\t\t\t conn->connfd) == -1) {\n+\t\t\t\t\tpthread_mutex_unlock(&vhost_user.mutex);\n \t\t\t\t\tpthread_mutex_unlock(\n \t\t\t\t\t\t\t&vsocket->conn_mutex);\n \t\t\t\t\tgoto again;\n", "prefixes": [] }{ "id": 49763, "url": "