Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2225926/?format=api
{ "id": 2225926, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2225926/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260421202110.306051-12-peterx@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260421202110.306051-12-peterx@redhat.com>", "list_archive_url": null, "date": "2026-04-21T20:21:05", "name": "[v2,11/16] migration: Calculate expected downtime on demand", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e25c974a47da0c412cf401d593616b5e94eef7b9", "submitter": { "id": 67717, "url": "http://patchwork.ozlabs.org/api/1.2/people/67717/?format=api", "name": "Peter Xu", "email": "peterx@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260421202110.306051-12-peterx@redhat.com/mbox/", "series": [ { "id": 500889, "url": "http://patchwork.ozlabs.org/api/1.2/series/500889/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500889", "date": "2026-04-21T20:20:55", "name": "migration/vfio: Fix a few issues on API misuse or statistic reports", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/500889/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2225926/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2225926/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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=TRYleeQB;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=eF9oV35c;\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=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists1p.gnu.org (lists1p.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 4g0YgH3CZ9z1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 06:22:19 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wFHbJ-000110-8g; Tue, 21 Apr 2026 16:21:41 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peterx@redhat.com>) id 1wFHbD-0000ye-FZ\n for qemu-devel@nongnu.org; Tue, 21 Apr 2026 16:21:35 -0400", "from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peterx@redhat.com>) id 1wFHbB-0008SG-VV\n for qemu-devel@nongnu.org; Tue, 21 Apr 2026 16:21:35 -0400", "from mail-qv1-f69.google.com (mail-qv1-f69.google.com\n [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-562-yV2umeW8PXSyO-bnNpiLtA-1; Tue, 21 Apr 2026 16:21:32 -0400", "by mail-qv1-f69.google.com with SMTP id\n 6a1803df08f44-8acaea1ffe7so122340746d6.2\n for <qemu-devel@nongnu.org>; Tue, 21 Apr 2026 13:21:32 -0700 (PDT)", "from x1.local ([142.189.10.167]) by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b02ae5c26csm114343556d6.31.2026.04.21.13.21.29\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 21 Apr 2026 13:21:30 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776802893;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=0sY03HVswRoPMa35yJ23Zli6bfmgoUXGAl+akL2zYOk=;\n b=TRYleeQBxzLnxCWByB3ggMkdrrmeh+8DCnP7pKZ08tDIpEhqcAkOw4bOAtqEX8Xdi6p+mX\n NC6j7ewr30EIsFY9OjowMF9wqzXbkHo/q8+2BA0x+f8b1wfHIBSIP5iIt4r/4d2JIE+mDK\n 4h4VJE5azOFLkOZLT301/xdkFlSFkI0=", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1776802891; x=1777407691; 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=0sY03HVswRoPMa35yJ23Zli6bfmgoUXGAl+akL2zYOk=;\n b=eF9oV35ck3/9uFmrp4vUro3sD06Ba1kwQLf4t6WKS3HTug4QKc27inCKC6c8sPBW0h\n kWJZMBAXAUW+tG/1apBMR01hADeNbbCgURCup38Ra4tjpS9ip3LmBI7zE5eEflLPFDFi\n JJ0OGw3BT+cDSUub6Qk+rIDXiEpVeW3kkcki18yfB2auYex+QmjjoxIA1EApO4vn2pVX\n R/e0Tsf7uKeBIszUmxj0LITf38VE+SMVehSic4TLigApcpUPtXU4bjR+vdUsng1fE4sv\n c9M3JHVaeUZT34ILBbzzryRHsnSzswvlgwkTCstAEGyY/BSv80UX863678x+pluDBlHL\n W+Ag==" ], "X-MC-Unique": "yV2umeW8PXSyO-bnNpiLtA-1", "X-Mimecast-MFC-AGG-ID": "yV2umeW8PXSyO-bnNpiLtA_1776802892", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776802891; x=1777407691;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=0sY03HVswRoPMa35yJ23Zli6bfmgoUXGAl+akL2zYOk=;\n b=KDsPKIH4mMsk8KG1IBFhzejILt1G3Cy/P3fCheBfKyFxXkj6bBNinojKFzb7/NSgi6\n zPtN7f3MaLqKqli8GAliS8n/DljUOLRraJPd0S7jZT+7KFF7MS3URMp3Bp3o4tjS2M6G\n 7nV3W2ddXYMWIFK04mVDmNFClLzAuKRCoqBzbgDESSsfcGi3ejrKvA4r4iJ2ZtjnJjd9\n ufh2AQQRs5iRJyAuR2w+V5WwGpNWQeSpAHy0BRrUC+n+Mg/rIRUc5uVdfh5/SPbfCVVa\n d0cqET7upJCz+85gylNtONbOtBE1++2DOnPreCpUc+BINRaRaZIlftWktK26wMzRYUaR\n 5yfw==", "X-Gm-Message-State": "AOJu0Yw+SVrcFEHB5a+l9gA8W7e0/ajmJ+qDAkK2w/5MT+km5M+3juwY\n c73EU98509exDvTI74usQD3TANkngRwloCOdHUwdRvjvK8i8S+ofIBXAiqPcKKyO8Z+c9iQ8xiL\n kvFhjUiIUsqJZvddP6epy0FGjD812R/M0ASNzAK3afx5kll5udmxvQv3rVW/fjWdf+rgJUJ++ua\n jvIYEMCpKGvwRDWFCP5Bc4rQyg64pYKb1aoamq2g==", "X-Gm-Gg": "AeBDieuJUrK4XjEACP3AYMGa6H7nf+c3T2BWaOdu4Yjw26navDs/n3guu2wIlbBu1v/\n zIPIiZ3fpZPo1cJEG22qiOTvfexT0Fzj/pWflliLWqfW84l8TpSigZ14bjETF49cAIi6h3P+LcO\n JsWO9L9FIQnXVn5Qa/sjQLZ/XDIha4Tc54d+Ozc41K4fSvDsIkxkCe90V0z8XF+1NFv2Wmp/EQe\n dyLEnMtpVSQP/mxrCwIxgB9l18kA4w3UBYzrykMGP+8mBcz3HCDnhWCIF2j0mMZYGJCdfj3z24a\n xZXQ9JXcBcgZwrILehFll9+bzdfSHFPWM0yhbPbY5sDU0kArkGzB9fLv6jKcWR27wB35Px4sSj6\n AZn5IEn9zsFringNN/fIOK5dhn6c18VE/t49Y1NUNkq93jP/WFN6k+TTmvA==", "X-Received": [ "by 2002:a05:6214:451a:b0:8aa:a025:78e3 with SMTP id\n 6a1803df08f44-8b027fd1cc8mr339146546d6.6.1776802891291;\n Tue, 21 Apr 2026 13:21:31 -0700 (PDT)", "by 2002:a05:6214:451a:b0:8aa:a025:78e3 with SMTP id\n 6a1803df08f44-8b027fd1cc8mr339145756d6.6.1776802890789;\n Tue, 21 Apr 2026 13:21:30 -0700 (PDT)" ], "From": "Peter Xu <peterx@redhat.com>", "To": "qemu-devel@nongnu.org", "Cc": "Joao Martins <joao.m.martins@oracle.com>,\n Markus Armbruster <armbru@redhat.com>,\n =?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@redhat.com>,\n Avihai Horon <avihaih@nvidia.com>,\n =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= <berrange@redhat.com>,\n Fabiano Rosas <farosas@suse.de>, Prasad Pandit <ppandit@redhat.com>,\n Alex Williamson <alex@shazbot.org>, Kirti Wankhede <kwankhede@nvidia.com>,\n Zhiyi Guo <zhguo@redhat.com>, Peter Xu <peterx@redhat.com>,\n \"Maciej S . Szmigiero\" <mail@maciej.szmigiero.name>,\n Juraj Marcin <jmarcin@redhat.com>", "Subject": "[PATCH v2 11/16] migration: Calculate expected downtime on demand", "Date": "Tue, 21 Apr 2026 16:21:05 -0400", "Message-ID": "<20260421202110.306051-12-peterx@redhat.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260421202110.306051-1-peterx@redhat.com>", "References": "<20260421202110.306051-1-peterx@redhat.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com;\n helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-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 development <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": "This value does not need to be calculated as frequent. Only calculate it\non demand when query-migrate happened. With that we can remove the\nvariable in MigrationState.\n\nThis paves way for fixing this value to include all modules (not only RAM\nbut others too).\n\nReviewed-by: Juraj Marcin <jmarcin@redhat.com>\nSigned-off-by: Peter Xu <peterx@redhat.com>\n---\n migration/migration.h | 2 +-\n migration/migration.c | 25 ++++++++++++-------------\n 2 files changed, 13 insertions(+), 14 deletions(-)", "diff": "diff --git a/migration/migration.h b/migration/migration.h\nindex b6888daced..ba0f9e0f9c 100644\n--- a/migration/migration.h\n+++ b/migration/migration.h\n@@ -359,7 +359,6 @@ struct MigrationState {\n /* Timestamp when VM is down (ms) to migrate the last stuff */\n int64_t downtime_start;\n int64_t downtime;\n- int64_t expected_downtime;\n bool capabilities[MIGRATION_CAPABILITY__MAX];\n int64_t setup_time;\n \n@@ -586,6 +585,7 @@ void migration_cancel(void);\n void migration_populate_vfio_info(MigrationInfo *info);\n void migration_reset_vfio_bytes_transferred(void);\n void postcopy_temp_page_reset(PostcopyTmpPage *tmp_page);\n+int64_t migration_downtime_calc_expected(MigrationState *s);\n \n /*\n * Migration thread waiting for return path thread. Return non-zero if an\ndiff --git a/migration/migration.c b/migration/migration.c\nindex caa1d13130..d4d3534cf1 100644\n--- a/migration/migration.c\n+++ b/migration/migration.c\n@@ -1041,6 +1041,17 @@ static bool migrate_show_downtime(MigrationState *s)\n return (s->state == MIGRATION_STATUS_COMPLETED) || migration_in_postcopy();\n }\n \n+/* Return expected downtime (unit: milliseconds) */\n+int64_t migration_downtime_calc_expected(MigrationState *s)\n+{\n+ if (mig_stats.dirty_sync_count <= 1) {\n+ return migrate_downtime_limit();\n+ }\n+\n+ return mig_stats.dirty_bytes_last_sync /\n+ migration_get_switchover_bw(s) * 1000;\n+}\n+\n static void populate_time_info(MigrationInfo *info, MigrationState *s)\n {\n info->has_status = true;\n@@ -1061,7 +1072,7 @@ static void populate_time_info(MigrationInfo *info, MigrationState *s)\n info->downtime = s->downtime;\n } else {\n info->has_expected_downtime = true;\n- info->expected_downtime = s->expected_downtime;\n+ info->expected_downtime = migration_downtime_calc_expected(s);\n }\n }\n \n@@ -1649,7 +1660,6 @@ int migrate_init(MigrationState *s, Error **errp)\n s->mbps = 0.0;\n s->pages_per_second = 0.0;\n s->downtime = 0;\n- s->expected_downtime = 0;\n s->setup_time = 0;\n s->start_postcopy = false;\n s->migration_thread_running = false;\n@@ -3162,15 +3172,6 @@ static void migration_update_counters(MigrationState *s,\n s->pages_per_second = (double) transferred_pages /\n (((double) time_spent / 1000.0));\n \n- /*\n- * if we haven't sent anything, we don't want to\n- * recalculate. 10000 is a small enough number for our purposes\n- */\n- if (mig_stats.dirty_pages_rate && transferred > 10000) {\n- s->expected_downtime =\n- mig_stats.dirty_bytes_last_sync / switchover_bw_per_ms;\n- }\n-\n migration_rate_reset();\n \n update_iteration_initial_status(s);\n@@ -3825,8 +3826,6 @@ void migration_start_outgoing(MigrationState *s)\n bool resume = (s->state == MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP);\n int ret;\n \n- s->expected_downtime = migrate_downtime_limit();\n-\n if (resume) {\n /* This is a resumed migration */\n rate_limit = migrate_max_postcopy_bandwidth();\n", "prefixes": [ "v2", "11/16" ] }