Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2026277/?format=api
{ "id": 2026277, "url": "http://patchwork.ozlabs.org/api/patches/2026277/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20241220104220.2007786-3-npiggin@gmail.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20241220104220.2007786-3-npiggin@gmail.com>", "list_archive_url": null, "date": "2024-12-20T10:42:04", "name": "[02/17] replay: Fix migration replay_mutex locking", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e02a63228832c67ed58e2388df0c8f9b7142af1d", "submitter": { "id": 69518, "url": "http://patchwork.ozlabs.org/api/people/69518/?format=api", "name": "Nicholas Piggin", "email": "npiggin@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20241220104220.2007786-3-npiggin@gmail.com/mbox/", "series": [ { "id": 437728, "url": "http://patchwork.ozlabs.org/api/series/437728/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=437728", "date": "2024-12-20T10:42:02", "name": "replay: Fixes and avocado test updates", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/437728/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2026277/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2026277/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=H30Fdw7d;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4YF3ss73p3z1ySC\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 20 Dec 2024 21:43:13 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1tOaTI-00020s-Ro; Fri, 20 Dec 2024 05:43:06 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <npiggin@gmail.com>)\n id 1tOaT6-0001s3-JJ; Fri, 20 Dec 2024 05:42:52 -0500", "from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <npiggin@gmail.com>)\n id 1tOaT4-0005Cp-5H; Fri, 20 Dec 2024 05:42:51 -0500", "by mail-pl1-x633.google.com with SMTP id\n d9443c01a7336-2161eb94cceso11761945ad.2;\n Fri, 20 Dec 2024 02:42:49 -0800 (PST)", "from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130])\n by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.42.40\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 20 Dec 2024 02:42:47 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1734691368; x=1735296168; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=HYauowC6m1dSqSOOvIXZEtWuC27GaY5hc1iCZUJ/IDY=;\n b=H30Fdw7dF6wscp97B8ckdyV/pR2uvnEhVarRxbUUD/jrxPWyT5OD0yYrbjiNj2KymO\n oXMbjnI6sa7GdUsrx0cdwkDO+oXIn2OqRxc9jOI/tuAZ4gBIvg4cfrKA04yyJf1QIzD5\n KdrChpf7vVj40X+Xd4Y7nJvIiJ8qLzufbb7bn7+KR1p19C4NzVmhzYnO08/rw6yOLxwV\n x/7gi8fq1ozAv33fsrnyaUFtSrBl0snTHOVEqOkjRhcql5jSuPg4Qq5fl+4UoEHZzcKX\n vNGQ/i7qUnJ/4dQTAqe24g1HcZ9zq2Tgw6fUM8rbMOF5bX/uQsA0It+8qOLEEL9Nr6SF\n 4cTA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1734691368; x=1735296168;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=HYauowC6m1dSqSOOvIXZEtWuC27GaY5hc1iCZUJ/IDY=;\n b=DJ+l+buaVjNQBpe7DXnrJ2ouuHhgAq5rk8W+VMe4MEwKSDB/ZN5CbwA6ThO6SfZHdQ\n i7n3jnJbvV2tIcoTM+CwACx8UddntKl7iqqtmGXPmrvR3BizDErPap7CLK5K/SopZ6Gt\n B67WOS0djGvmnGkig4Mibq13uU5axJCweo/7AJYopz16gY7RPNA3LJx1AuE9REJy1npF\n 2d6aRwPByMG9DjbTPDPJh6Dyy0jYFttUF5P6vKZIEIX784+YNqKHVXmeSfPquH1DVOq8\n wJaqxRteb/hRcrV+A6S8IN1oh+ZNI2P7g/hXQ1I7KSMc19j8pLGD/uhGZ3mHb3S+v9rX\n tQ3Q==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCVdAGYFpEYg0KexkJfYYtq7SqNk7wfhBG7hUWmQkg/GSHq6hwMtIq7EVq8zIr9whCXuPk8SXIdxjvcm@nongnu.org", "X-Gm-Message-State": "AOJu0Yyd3WN38Z2q0EvD7A48/XA4eDS4V8GQflVBPEaWxB5VOerbDGJC\n 1Hi8QKuj8gF+vCRFb5p9tEv0e0xY+XG5uHFtzjP46IOCAQUs8PDqSU3qtw==", "X-Gm-Gg": "ASbGncuxzVzNdqK9KQnkelLlS86udb+N1fwgUDHghb0LAv2c5qnlTwaP5OquW9OlxQg\n C5lzDO1UmOP7cLcQQH/D1KZNIPMUce2YZ5YQrIJRRVIXaTU13D602fIFEkPTWTBm6aF9GJuU8+C\n qmZjPNLCnrBYngiMwLaF4BN/hMKQr8tVmqL0rqTlawFtYaYaBFlNgoqPZ92S1Pq71vIYeEKJnjX\n oADUwSBUG9GprQ4vsDD6P+hy374Ot44kKPOdr9LXsaS7AKGvqy2aByTvNSak7UDNfeSR/7jzUMH\n RwifB7wYow==", "X-Google-Smtp-Source": "\n AGHT+IG1LubnhyxHCMdczXSH/fXeerTfPXvXsmGZLINQD0+k2LGCX5KTQV6fRZoo9KcSXow1AgaTQw==", "X-Received": "by 2002:a17:90a:c2c8:b0:2ee:ead6:6213 with SMTP id\n 98e67ed59e1d1-2f452e4c536mr3868057a91.19.1734691368253;\n Fri, 20 Dec 2024 02:42:48 -0800 (PST)", "From": "Nicholas Piggin <npiggin@gmail.com>", "To": "qemu-devel@nongnu.org", "Cc": "Nicholas Piggin <npiggin@gmail.com>, qemu-block@nongnu.org, =?utf-8?q?Al?=\n\t=?utf-8?q?ex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,\n Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>,\n Paolo Bonzini <pbonzini@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>,\n Fam Zheng <fam@euphon.net>, Ronnie Sahlberg <ronniesahlberg@gmail.com>,\n John Snow <jsnow@redhat.com>, \"Michael S. Tsirkin\" <mst@redhat.com>,\n Jason Wang <jasowang@redhat.com>,\n Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,\n Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,\n \"Dr. David Alan Gilbert\" <dave@treblig.org>,\n Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>,\n Wainer dos Santos Moschetta <wainersm@redhat.com>", "Subject": "[PATCH 02/17] replay: Fix migration replay_mutex locking", "Date": "Fri, 20 Dec 2024 20:42:04 +1000", "Message-ID": "<20241220104220.2007786-3-npiggin@gmail.com>", "X-Mailer": "git-send-email 2.45.2", "In-Reply-To": "<20241220104220.2007786-1-npiggin@gmail.com>", "References": "<20241220104220.2007786-1-npiggin@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2607:f8b0:4864:20::633;\n envelope-from=npiggin@gmail.com; helo=mail-pl1-x633.google.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Migration causes a number of events that need to go in the replay\ntrace, such as vm state transitions. The replay_mutex lock needs to\nbe held for these.\n\nThe simplest approach seems to be just take it up-front when taking\nthe bql.\n\nSigned-off-by: Nicholas Piggin <npiggin@gmail.com>\n---\n migration/migration.c | 9 +++++++++\n 1 file changed, 9 insertions(+)", "diff": "diff --git a/migration/migration.c b/migration/migration.c\nindex 2eb9e50a263..277fca954c1 100644\n--- a/migration/migration.c\n+++ b/migration/migration.c\n@@ -24,6 +24,7 @@\n #include \"socket.h\"\n #include \"sysemu/runstate.h\"\n #include \"sysemu/sysemu.h\"\n+#include \"sysemu/replay.h\"\n #include \"sysemu/cpu-throttle.h\"\n #include \"rdma.h\"\n #include \"ram.h\"\n@@ -2518,6 +2519,7 @@ static int postcopy_start(MigrationState *ms, Error **errp)\n }\n \n trace_postcopy_start();\n+ replay_mutex_lock();\n bql_lock();\n trace_postcopy_start_set_run();\n \n@@ -2629,6 +2631,7 @@ static int postcopy_start(MigrationState *ms, Error **errp)\n migration_downtime_end(ms);\n \n bql_unlock();\n+ replay_mutex_unlock();\n \n if (migrate_postcopy_ram()) {\n /*\n@@ -2670,6 +2673,7 @@ fail:\n }\n migration_call_notifiers(ms, MIG_EVENT_PRECOPY_FAILED, NULL);\n bql_unlock();\n+ replay_mutex_unlock();\n return -1;\n }\n \n@@ -2721,6 +2725,7 @@ static int migration_completion_precopy(MigrationState *s,\n {\n int ret;\n \n+ replay_mutex_lock();\n bql_lock();\n \n if (!migrate_mode_is_cpr(s)) {\n@@ -2746,6 +2751,7 @@ static int migration_completion_precopy(MigrationState *s,\n s->block_inactive);\n out_unlock:\n bql_unlock();\n+ replay_mutex_unlock();\n return ret;\n }\n \n@@ -3633,6 +3639,7 @@ static void *bg_migration_thread(void *opaque)\n \n trace_migration_thread_setup_complete();\n \n+ replay_mutex_lock();\n bql_lock();\n \n if (migration_stop_vm(s, RUN_STATE_PAUSED)) {\n@@ -3666,6 +3673,7 @@ static void *bg_migration_thread(void *opaque)\n */\n migration_bh_schedule(bg_migration_vm_start_bh, s);\n bql_unlock();\n+ replay_mutex_unlock();\n \n while (migration_is_active()) {\n MigIterateState iter_state = bg_migration_iteration_run(s);\n@@ -3695,6 +3703,7 @@ fail:\n migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE,\n MIGRATION_STATUS_FAILED);\n bql_unlock();\n+ replay_mutex_unlock();\n }\n \n fail_setup:\n", "prefixes": [ "02/17" ] }