From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494596371341428.8744300895321; Fri, 12 May 2017 06:39:31 -0700 (PDT) Received: from localhost ([::1]:53863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9An3-0002jT-Px for importer@patchew.org; Fri, 12 May 2017 09:39:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005Nx-Kx for qemu-devel@nongnu.org; Fri, 12 May 2017 09:32:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afd-00071j-L2 for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:26721) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afd-00071C-E7 for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:49 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00J4JDKXK910@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:45 +0100 (BST) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170512133145eucas1p11d03ef27a1b3a559dacf9754b903e034~93w6cUYFF2939829398eucas1p1d; Fri, 12 May 2017 13:31:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 84.72.14140.349B5195; Fri, 12 May 2017 14:31:47 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133144eucas1p288cde3bd6faefb16cbb0d3790885783d~93w5sqIQa0751207512eucas1p2L; Fri, 12 May 2017 13:31:44 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AD.71.20206.069B5195; Fri, 12 May 2017 14:32:16 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:44 +0100 (BST) X-AuditID: cbfec7ef-f796a6d00000373c-56-5915b94394e4 From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:18 +0300 Message-id: <1494595886-30912-2-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCIsWRmVeSWpSXmKPExsWy7djP87rOO0UjDea8V7KYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFgdWjyfXNjN5vN93lc2jb8sqxgDmKC6blNSczLLUIn27BK6M1c2L mAuWsldcPXOWsYHxK2sXIyeHhICJxPuTrcwQtpjEhXvr2boYuTiEBJYxSrTffMgGkhAS+Mwo sfM4UxcjB1jDkj0GcDUrunZANXQzSSxeM5MdpIhNwEBi3z1bkF4RAUmJ312nwRYwC8RKvL1+ DWymsECQxLxlz1lBylkEVCX6Gm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JLiSbnA2MnryTe0MTQ3NLQyNjCwtzISEmcd+qHK+FCAumJJanZ qakFqUUwfUwcnFINjDXOC/e/Lk7iXimz9MOGCm2uT2bbhbqv1YuwqpYEm23UeL+DQajO2c/X 6PBhlQub5CxPeT5f7KCycNXpxzvW2Irs3T+1ijX7j/JtN5svXce+m3DMvPHVbGWIwP/DbjYf 2Q6+P+biuVvgSt6a1Szrnvue2O6ecvSq4Z8XrNvjChXspcS2rjFT5lZiKc5INNRiLipOBADK vvLrZQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133144eucas1p288cde3bd6faefb16cbb0d3790885783d X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133144eucas1p288cde3bd6faefb16cbb0d3790885783d X-RootMTR: 20170512133144eucas1p288cde3bd6faefb16cbb0d3790885783d References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.13 Subject: [Qemu-devel] [PATCH V5 1/9] userfault: add pid into uffd_msg & update UFFD_FEATURE_* X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This commit duplicates header of "userfaultfd: provide pid in userfault msg" into linux kernel. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfa= ultfd.h index 2ed5dc3..e7c8898 100644 --- a/linux-headers/linux/userfaultfd.h +++ b/linux-headers/linux/userfaultfd.h @@ -77,6 +77,9 @@ struct uffd_msg { struct { __u64 flags; __u64 address; + union { + __u32 ptid; + } feat; } pagefault; =20 struct { @@ -158,6 +161,8 @@ struct uffdio_api { #define UFFD_FEATURE_EVENT_MADVDONTNEED (1<<3) #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) #define UFFD_FEATURE_MISSING_SHMEM (1<<5) +#define UFFD_FEATURE_EVENT_UNMAP (1<<6) +#define UFFD_FEATURE_THREAD_ID (1<<7) __u64 features; =20 __u64 ioctls; --=20 1.9.1 From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494596304360181.34725045545565; Fri, 12 May 2017 06:38:24 -0700 (PDT) Received: from localhost ([::1]:53857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Alz-00023v-5g for importer@patchew.org; Fri, 12 May 2017 09:38:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005Nz-OV for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afd-00071r-NT for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:56136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afd-000716-E3 for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:49 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00BRGDKX2U00@mailout4.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:46 +0100 (BST) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133145eucas1p2f7b77d7873a758db67d20666087cccca~93w60tkf71102611026eucas1p2z; Fri, 12 May 2017 13:31:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 43.3D.04729.149B5195; Fri, 12 May 2017 14:31:45 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133144eucas1p25b4275feb4126a21415242c5085382fd~93w6Mx7tF1102711027eucas1p2w; Fri, 12 May 2017 13:31:44 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 6E.71.20206.069B5195; Fri, 12 May 2017 14:32:16 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:44 +0100 (BST) X-AuditID: cbfec7f4-f79806d000001279-97-5915b9413258 From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:19 +0300 Message-id: <1494595886-30912-3-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsWy7djP87qOO0UjDc41ilnMvXuexaJ32z12 iyvtP9kttuz/xm5xvHcHiwOrx5Nrm5k83u+7yubRt2UVYwBzFJdNSmpOZllqkb5dAlfGq30P mQq2yFbcfKzSwLhMvIuRk0NCwETi2NZWFghbTOLCvfVsXYxcHEICSxklfu16zwjhfGaUmPHv OytMx/zNN5kgEssYJXY8nAPV0s0ksXjNTPYuRg4ONgEDiX33bEEaRAQkJX53nWYGsZkFYiXe Xr/GBmILC3QySqz/5gFiswioSixbuYcFpJVXwF1iYXsIxC45iZPHJoPt5RTwkHh89xYryCoJ getsElePTmcCqZcQkJXYdIAZot5FYv2h80wQtrDEq+Nb2CFsGYnLk7tZIHrbGSW6d3ZCDZrA KHFm+l+oKnuJUzevMkEcyicxadt0ZogFvBIdbUIQJR4SDbMeQ+11lNj7VA8kLCQwm1Fi8u/g CYwyCxgZVjGKpJYW56anFpvoFSfmFpfmpesl5+duYgRG5el/x7/sYFx8zOoQowAHoxIPb8V6 0Ugh1sSy4srcQ4wSHMxKIryGW4BCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeblOXYsQEkhPLEnN Tk0tSC2CyTJxcEo1MMrp69fF26dnc5kw6FbaZRve0670+rf7fFBDCu9ZizdBmpw/rE63PhZ3 yTFweuLzasXWpa3OKRZi12ftWhKwzupy5ZZNZ/QOvpFqiVSuFj160PG6+f7vqscd+mYmFVhN eL38m4nt+xduV1gOObb6MH2tzhH2OWzEvWfd16e3OQqY2KecWSifq8RSnJFoqMVcVJwIAHJP /7LGAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrELMWRmVeSWpSXmKPExsVy+t/xy7oJO0UjDZZMM7GYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFgdWjyfXNjN5vN93lc2jb8sqxgDmKDebjNTElNQihdS85PyUzLx0 W6XQEDddCyWFvMTcVFulCF3fkCAlhbLEnFIgz8gADTg4B7gHK+nbJbhlvNr3kKlgi2zFzccq DYzLxLsYOTkkBEwk5m++yQRhi0lcuLeerYuRi0NIYAmjxJ/bk1lAEkICvUwS55aJdjFycLAJ GEjsu2cLEhYRkJT43XWaGcRmFoiVuDThBRuILSzQySix/psHiM0ioCqxbOUeFpBWXgF3iYXt IRCr5CROHpvMCmJzCnhIPL57ixVik7vEtoalbBMYeRcwMqxiFEktLc5Nzy020itOzC0uzUvX S87P3cQIDM9tx35u2cHY9S74EKMAB6MSD2/FetFIIdbEsuLK3EOMEhzMSiK8hluAQrwpiZVV qUX58UWlOanFhxhNgW6ayCwlmpwPjJ28knhDE0NzS0MjYwsLcyMjJXHeqR+uhAsJpCeWpGan phakFsH0MXFwSjUwOiwXWeT7b37Snb23Lr9iM326Qi/GonbTqr9vXRutzweuzT4Ws+znh+1n 7k7Jcvr0yFYx8uwK98nvlf6Ft4g9zdFS4+YVEUgWLDY7zmacuFf07XpDn69TNRIPX/qgZZSY 9XhDm+7K0OVPHy+c8zNCtJGNZfMkuZWt/NJ3Zup47PlTeXWn54z2V0osxRmJhlrMRcWJAGE1 3XFlAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133144eucas1p25b4275feb4126a21415242c5085382fd X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133144eucas1p25b4275feb4126a21415242c5085382fd X-RootMTR: 20170512133144eucas1p25b4275feb4126a21415242c5085382fd References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.14 Subject: [Qemu-devel] [PATCH V5 2/9] migration: pass ptr to MigrationIncomingState into migration ufd_version_check & postcopy_ram_supported_by_host X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by: Alexey Perevalov --- include/migration/postcopy-ram.h | 2 +- migration/migration.c | 2 +- migration/postcopy-ram.c | 10 +++++----- migration/savevm.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/migration/postcopy-ram.h b/include/migration/postcopy-= ram.h index 8e036b9..809f6db 100644 --- a/include/migration/postcopy-ram.h +++ b/include/migration/postcopy-ram.h @@ -14,7 +14,7 @@ #define QEMU_POSTCOPY_RAM_H =20 /* Return true if the host supports everything we need to do postcopy-ram = */ -bool postcopy_ram_supported_by_host(void); +bool postcopy_ram_supported_by_host(MigrationIncomingState *mis); =20 /* * Make all of RAM sensitive to accesses to areas that haven't yet been wr= itten diff --git a/migration/migration.c b/migration/migration.c index 353f272..569a7f6 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -804,7 +804,7 @@ void qmp_migrate_set_capabilities(MigrationCapabilitySt= atusList *params, * special support. */ if (!old_postcopy_cap && runstate_check(RUN_STATE_INMIGRATE) && - !postcopy_ram_supported_by_host()) { + !postcopy_ram_supported_by_host(NULL)) { /* postcopy_ram_supported_by_host will have emitted a more * detailed message */ diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 85fd8d7..4c859b4 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -60,7 +60,7 @@ struct PostcopyDiscardState { #include #include =20 -static bool ufd_version_check(int ufd) +static bool ufd_version_check(int ufd, MigrationIncomingState *mis) { struct uffdio_api api_struct; uint64_t ioctl_mask; @@ -113,7 +113,7 @@ static int test_range_shared(const char *block_name, vo= id *host_addr, * normally fine since if the postcopy succeeds it gets turned back on at = the * end. */ -bool postcopy_ram_supported_by_host(void) +bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) { long pagesize =3D getpagesize(); int ufd =3D -1; @@ -136,7 +136,7 @@ bool postcopy_ram_supported_by_host(void) } =20 /* Version and features check */ - if (!ufd_version_check(ufd)) { + if (!ufd_version_check(ufd, mis)) { goto out; } =20 @@ -513,7 +513,7 @@ int postcopy_ram_enable_notify(MigrationIncomingState *= mis) * Although the host check already tested the API, we need to * do the check again as an ABI handshake on the new fd. */ - if (!ufd_version_check(mis->userfault_fd)) { + if (!ufd_version_check(mis->userfault_fd, mis)) { return -1; } =20 @@ -651,7 +651,7 @@ void *postcopy_get_tmp_page(MigrationIncomingState *mis) =20 #else /* No target OS support, stubs just fail */ -bool postcopy_ram_supported_by_host(void) +bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) { error_report("%s: No OS support", __func__); return false; diff --git a/migration/savevm.c b/migration/savevm.c index a00c1ab..27ab8b2 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1360,7 +1360,7 @@ static int loadvm_postcopy_handle_advise(MigrationInc= omingState *mis) return -1; } =20 - if (!postcopy_ram_supported_by_host()) { + if (!postcopy_ram_supported_by_host(mis)) { postcopy_state_set(POSTCOPY_INCOMING_NONE); return -1; } --=20 1.9.1 From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494596129337767.4592299721305; Fri, 12 May 2017 06:35:29 -0700 (PDT) Received: from localhost ([::1]:53850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Aj8-00084a-TP for importer@patchew.org; Fri, 12 May 2017 09:35:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005O4-UF for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afd-000729-Sf for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:20657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afd-00070o-NZ for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:49 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00GMPDKPLB10@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:46 +0100 (BST) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133145eucas1p2647859580d6f943cbe36a5a6ffb6efba~93w7H3w-s0751307513eucas1p2H; Fri, 12 May 2017 13:31:45 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id E1.C2.17464.149B5195; Fri, 12 May 2017 14:31:45 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133145eucas1p2cad4c4efe46e6f1b757d97dd9d301dbe~93w6iFxVJ0605406054eucas1p2R; Fri, 12 May 2017 13:31:45 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1D.8E.17452.4D9B5195; Fri, 12 May 2017 14:34:12 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:45 +0100 (BST) X-AuditID: cbfec7f2-f797e6d000004438-47-5915b94174e8 From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:20 +0300 Message-id: <1494595886-30912-4-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExs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IX7q1n62Lk4hASWMIocfPdChYIp5dJ4vWEC4wgDWwC BhL77tmCNIgISEr87jrNDGIzC8RKXJrwgg3EFhbwk1j4qoUFxGYRUJWY+PkCE4jNK+Aucebm bWaIZXISJ49NZgWxOQU8JB7fvQVmCwHVbGtYyjaBkXcBI8MqRpHU0uLc9NxiQ73ixNzi0rx0 veT83E2MwBDdduzn5h2MlzYGH2IU4GBU4uFVWCsaKcSaWFZcmXuIUYKDWUmE13ALUIg3JbGy KrUoP76oNCe1+BCjKdBRE5mlRJPzgfGTVxJvaGJobmloZGxhYW5kpCTOW/LhSriQQHpiSWp2 ampBahFMHxMHp1QDY6/AleRJnbfauFcIq14PUpoUn3dh2owpygevaWsaMp433H1n/VphIzH9 s9dDuN8Kpew63HOf/YTbKZYM34Ctk8o540u/aLPzsXwUYr+hfePNfEHtlGwDxgmrflec3PNO s2HN1AN79/55Msk+xvViuerVabESk/lsWH053u8urHl3WTnWKEPaU4mlOCPRUIu5qDgRAInb Q6xnAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133145eucas1p2cad4c4efe46e6f1b757d97dd9d301dbe X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133145eucas1p2cad4c4efe46e6f1b757d97dd9d301dbe X-RootMTR: 20170512133145eucas1p2cad4c4efe46e6f1b757d97dd9d301dbe References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.11 Subject: [Qemu-devel] [PATCH V5 3/9] migration: fix hardcoded function name in error report X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Alexey Perevalov Reviewed-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 4c859b4..0f75700 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -68,7 +68,7 @@ static bool ufd_version_check(int ufd, MigrationIncomingS= tate *mis) api_struct.api =3D UFFD_API; api_struct.features =3D 0; if (ioctl(ufd, UFFDIO_API, &api_struct)) { - error_report("postcopy_ram_supported_by_host: UFFDIO_API failed: %= s", + error_report("%s: UFFDIO_API failed: %s", __func__ strerror(errno)); return false; } --=20 1.9.1 From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494596439478410.8094914146516; Fri, 12 May 2017 06:40:39 -0700 (PDT) Received: from localhost ([::1]:53874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Ao9-0003Qd-Tr for importer@patchew.org; Fri, 12 May 2017 09:40:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005O0-Rz for qemu-devel@nongnu.org; Fri, 12 May 2017 09:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afe-00072K-3e for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:20657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afd-00070o-Ts for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:50 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00GMPDKPLB10@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:47 +0100 (BST) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170512133146eucas1p15c30d46baefd49c6b6a6dbe51e479ff3~93w73KTrT1211312113eucas1p1t; Fri, 12 May 2017 13:31:46 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 7D.51.25577.249B5195; Fri, 12 May 2017 14:31:46 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170512133146eucas1p17df48bb6b5fcefe3717e18cd9afd84b7~93w7Sw4Qy1208612086eucas1p1s; Fri, 12 May 2017 13:31:46 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BF.71.20206.269B5195; Fri, 12 May 2017 14:32:18 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:45 +0100 (BST) X-AuditID: cbfec7f5-f792f6d0000063e9-db-5915b942393f From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:21 +0300 Message-id: <1494595886-30912-5-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsWy7djPc7pOO0UjDaZ2yVrMvXuexaJ32z12 iyvtP9kttuz/xm5xvHcHiwOrx5Nrm5k83u+7yubRt2UVYwBzFJdNSmpOZllqkb5dAlfG/5c3 GQumqVYsnTOTuYHxmnQXIyeHhICJxMMTm5kgbDGJC/fWs4HYQgJLGSXuvVfqYuQCsj8zSnR+ ns0G03D5yBV2iMQyRokzJ66xQjjdTBK/1nwBynBwsAkYSOy7ZwvSICIgKfG76zQziM0sECvx 9vo1sEHCAvESs+7uYgGxWQRUJTZd7AKr4RVwlzjR95IZYpmcxMljk1lBbE4BD4nHd2+B7ZIQ uM4msX3hS0aQXRICshKbDkDVu0g87V/DCmELS7w6voUdwpaRuDy5mwWit51RontnJ9SgCUAf TP8LVWUvcermVSaIS/kkJm2bzgyxgFeio00IosRDYturj1DljhLtyzcxQjw/m1Hi5P2JTBMY ZRYwMqxiFEktLc5NTy021StOzC0uzUvXS87P3cQIjM3T/45/3cG49JjVIUYBDkYlHl6FtaKR QqyJZcWVuYcYJTiYlUR4DbcAhXhTEiurUovy44tKc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@CPGS X-CMS-MailID: 20170512133146eucas1p17df48bb6b5fcefe3717e18cd9afd84b7 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133146eucas1p17df48bb6b5fcefe3717e18cd9afd84b7 X-RootMTR: 20170512133146eucas1p17df48bb6b5fcefe3717e18cd9afd84b7 References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.11 Subject: [Qemu-devel] [PATCH V5 4/9] migration: split ufd_version_check onto receive/request features part X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This modification is necessary for userfault fd features which are required to be requested from userspace. UFFD_FEATURE_THREAD_ID is a one of such "on demand" feature, which will be introduced in the next patch. QEMU need to use separate userfault file descriptor, due to userfault context has internal state, and after first call of ioctl UFFD_API it changes its state to UFFD_STATE_RUNNING (in case of success), but kernel while handling ioctl UFFD_API expects UFFD_STATE_WAIT_API. So only one ioctl with UFFD_API is possible per ufd. Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 82 ++++++++++++++++++++++++++++++++++++++++++--= ---- 1 file changed, 73 insertions(+), 9 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 0f75700..c96d5f5 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -60,32 +60,96 @@ struct PostcopyDiscardState { #include #include =20 -static bool ufd_version_check(int ufd, MigrationIncomingState *mis) + +/* + * Check userfault fd features, to request only supported features in + * future. + * __NR_userfaultfd - should be checked before + * Return obtained features + */ +static bool receive_ufd_features(uint64_t *features) { - struct uffdio_api api_struct; - uint64_t ioctl_mask; + struct uffdio_api api_struct =3D {0}; + int ufd; + bool ret =3D true; + + /* if we are here __NR_userfaultfd should exists */ + ufd =3D syscall(__NR_userfaultfd, O_CLOEXEC); + if (ufd =3D=3D -1) { + return false; + } =20 + /* ask features */ api_struct.api =3D UFFD_API; api_struct.features =3D 0; if (ioctl(ufd, UFFDIO_API, &api_struct)) { - error_report("%s: UFFDIO_API failed: %s", __func__ + error_report("%s: UFFDIO_API failed: %s", __func__, strerror(errno)); + ret =3D false; + goto release_ufd; + } + + *features =3D api_struct.features; + +release_ufd: + close(ufd); + return ret; +} + +static bool request_ufd_features(int ufd, uint64_t features) +{ + struct uffdio_api api_struct =3D {0}; + uint64_t ioctl_mask; + + api_struct.api =3D UFFD_API; + api_struct.features =3D features; + if (ioctl(ufd, UFFDIO_API, &api_struct)) { + error_report("%s failed: UFFDIO_API failed: %s", __func__, + strerror(errno)); return false; } =20 - ioctl_mask =3D (__u64)1 << _UFFDIO_REGISTER | - (__u64)1 << _UFFDIO_UNREGISTER; + ioctl_mask =3D 1 << _UFFDIO_REGISTER | + 1 << _UFFDIO_UNREGISTER; if ((api_struct.ioctls & ioctl_mask) !=3D ioctl_mask) { error_report("Missing userfault features: %" PRIx64, (uint64_t)(~api_struct.ioctls & ioctl_mask)); return false; } =20 + return true; +} + +static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis) +{ + uint64_t asked_features =3D 0; + uint64_t supported_features; + + /* + * it's not possible to + * request UFFD_API twice per one fd + */ + if (!receive_ufd_features(&supported_features)) { + error_report("%s failed", __func__); + return false; + } + + /* + * request features, even if asked_features is 0, due to + * kernel expects UFFD_API before UFFDIO_REGISTER, per + * userfault file descriptor + */ + if (!request_ufd_features(ufd, asked_features)) { + error_report("%s failed: features %" PRIu64, __func__, + asked_features); + return false; + } + if (getpagesize() !=3D ram_pagesize_summary()) { bool have_hp =3D false; /* We've got a huge page */ #ifdef UFFD_FEATURE_MISSING_HUGETLBFS - have_hp =3D api_struct.features & UFFD_FEATURE_MISSING_HUGETLBFS; + have_hp =3D supported_features & UFFD_FEATURE_MISSING_HUGETLBFS; #endif if (!have_hp) { error_report("Userfault on this host does not support huge pag= es"); @@ -136,7 +200,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingSt= ate *mis) } =20 /* Version and features check */ - if (!ufd_version_check(ufd, mis)) { + if (!ufd_check_and_apply(ufd, mis)) { goto out; } =20 @@ -513,7 +577,7 @@ int postcopy_ram_enable_notify(MigrationIncomingState *= mis) * Although the host check already tested the API, we need to * do the check again as an ABI handshake on the new fd. */ - if (!ufd_version_check(mis->userfault_fd, mis)) { + if (!ufd_check_and_apply(mis->userfault_fd, mis)) { return -1; } =20 --=20 1.9.1 From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494596012359513.2518751412747; Fri, 12 May 2017 06:33:32 -0700 (PDT) Received: from localhost ([::1]:53837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9AhG-0006lL-TR for importer@patchew.org; Fri, 12 May 2017 09:33:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005O3-Tl for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afd-000726-SU for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:56136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afd-000716-Nc for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:49 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00BRGDKX2U00@mailout4.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:47 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133147eucas1p28c2a7830c7c88031dc6480ef6c35cbbb~93w8VTK3e0943009430eucas1p2I; Fri, 12 May 2017 13:31:47 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 7B.94.04459.249B5195; Fri, 12 May 2017 14:31:46 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133146eucas1p2ba4841cabf508b66410fae6784952eaa~93w7vwGyL0605406054eucas1p2U; Fri, 12 May 2017 13:31:46 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id ED.8E.17452.5D9B5195; Fri, 12 May 2017 14:34:14 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:46 +0100 (BST) X-AuditID: cbfec7f1-f796e6d00000116b-78-5915b9428344 From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:22 +0300 Message-id: <1494595886-30912-6-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsWy7djP87pOO0UjDWZ/tbaYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFgdWjyfXNjN5vN93lc2jb8sqxgDmKC6blNSczLLUIn27BK6M711v 2QtahSoOnn3C0sD4ga+LkZNDQsBEomHFCSYIW0ziwr31bF2MXBxCAksZJWbf2scC4XxmlNg2 /QNzFyMHWMfWpb4Q8WWMEnsv7mSGcLqZJM6uuMUIUsQmYCCx754tyFQRAUmJ312nmUFsZoFY ibfXr7GB2MICXhL352xnB7FZBFQllnb3gl3BK+Au8erBdVaIi+QkTh6bDGZzCnhIPL57ixVk l4TAdTaJV3tOskAcJCux6QAzRL2LRP/Uh2wQtrDEq+Nb2CFsGYnOjoNMEL3tjBLdOzuhBk1g lDgz/S9Ulb3EqZtXmSAu5ZOYtG061Me8Eh1tQhAlHhKfv/RALXOUmH//LthxQgKzGSUeT6+e wCizgJFhFaNIamlxbnpqsZFecWJucWleul5yfu4mRmBknv53/OMOxvcnrA4xCnAwKvHwKqwV jRRiTSwrrsw9xCjBwawkwmu4BS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A= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133146eucas1p2ba4841cabf508b66410fae6784952eaa X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133146eucas1p2ba4841cabf508b66410fae6784952eaa X-RootMTR: 20170512133146eucas1p2ba4841cabf508b66410fae6784952eaa References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.14 Subject: [Qemu-devel] [PATCH V5 5/9] migration: introduce postcopy-blocktime capability X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Signed-off-by: Alexey Perevalov Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 1 + migration/migration.c | 9 +++++++++ qapi-schema.json | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index ba1a16c..82bbcd8 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -315,6 +315,7 @@ int migrate_compress_level(void); int migrate_compress_threads(void); int migrate_decompress_threads(void); bool migrate_use_events(void); +bool migrate_postcopy_blocktime(void); =20 /* Sending on the return path - generic and then for each message type */ void migrate_send_rp_message(MigrationIncomingState *mis, diff --git a/migration/migration.c b/migration/migration.c index 569a7f6..c0443ce 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1371,6 +1371,15 @@ bool migrate_zero_blocks(void) return s->enabled_capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; } =20 +bool migrate_postcopy_blocktime(void) +{ + MigrationState *s; + + s =3D migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME= ]; +} + bool migrate_use_compression(void) { MigrationState *s; diff --git a/qapi-schema.json b/qapi-schema.json index 01b087f..fde6d63 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -894,11 +894,14 @@ # @release-ram: if enabled, qemu will free the migrated ram pages on the s= ource # during postcopy-ram migration. (since 2.9) # +# @postcopy-blocktime: Calculate downtime for postcopy live migration (sin= ce 2.10) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', - 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] } + 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram', + 'postcopy-blocktime'] } =20 ## # @MigrationCapabilityStatus: --=20 1.9.1 From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 14945962316815.476979660850475; Fri, 12 May 2017 06:37:11 -0700 (PDT) Received: from localhost ([::1]:53854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Ako-0000tK-Ds for importer@patchew.org; Fri, 12 May 2017 09:37:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afj-0005OF-AN for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afe-00072T-AI for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:55 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:20657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afe-00070o-4j for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:50 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00IELDL0FO10@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:48 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170512133148eucas1p1998308b3adc5185aac2044456a392d1b~93w9T1zjR2543425434eucas1p1v; Fri, 12 May 2017 13:31:48 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 4C.94.04459.349B5195; Fri, 12 May 2017 14:31:48 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170512133147eucas1p1aca0281fc864bf6f3beb610e7ce2695b~93w8uoKvM2731527315eucas1p1B; Fri, 12 May 2017 13:31:47 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C0.81.20206.369B5195; Fri, 12 May 2017 14:32:19 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:47 +0100 (BST) X-AuditID: cbfec7f1-f796e6d00000116b-7c-5915b943f4f6 From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:23 +0300 Message-id: <1494595886-30912-7-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsWy7djP87ouO0UjDX5NZbKYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFgdWjyfXNjN5vN93lc2jb8sqxgDmKC6blNSczLLUIn27BK6Ml/NP sBa81qp4OfM2awNjo1IXIyeHhICJxK8zU9kgbDGJC/fWA9lcHEICSxkluvfuZIVwPjNKbO28 ygzT0XBsGQtEYhmjxKcXq6CqupkkNjeeBari4GATMJDYd88WpEFEQFLid9dpsGZmgViJt9ev ga0TFkiReLe4gRXEZhFQlfgxEWQoJwevgLvEs8X9UMvkJE4emwxWwyngIfH47i2wXRICl9kk /nWcZwLZJSEgK7HpAFS9i8SyFZ1MELawxKvjW9ghbBmJy5O7WSB624Fe29kJNWgCo8SZ6X+h quwlTt28ygRxKZ/EpG3TmSEW8Ep0tAlBlHhI3L17gB0i7Cix6m0UxO+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pmHmOYdrEn6t1y6wjt1hfnHO1UqFj+6yt Wpu3bJS1Wtc9ZZuP6cqyql8veC67bX3n4ue2Xn3GmkX3ii1LmJRYijMSDbWYi4oTATsOspNo AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133147eucas1p1aca0281fc864bf6f3beb610e7ce2695b X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133147eucas1p1aca0281fc864bf6f3beb610e7ce2695b X-RootMTR: 20170512133147eucas1p1aca0281fc864bf6f3beb610e7ce2695b References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.11 Subject: [Qemu-devel] [PATCH V5 6/9] migration: add postcopy vcpu blocktime context into MigrationIncomingState X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch adds request to kernel space for UFFD_FEATURE_THREAD_ID, in case when this feature is provided by kernel. PostcopyBlocktimeContext is incapsulated inside postcopy-ram.c, due to it's postcopy only feature. Also it defines PostcopyBlocktimeContext's instance live time. Information from PostcopyBlocktimeContext instance will be provided much after postcopy migration end, instance of PostcopyBlocktimeContext will live till QEMU exit, but part of it (vcpu_addr, page_fault_vcpu_time) used only during calculation, will be released when postcopy ended or failed. To enable postcopy blocktime calculation on destination, need to request proper capabiltiy (Patch for documentation will at the tail of patch set). As an example following command enable that capability, assume qemu was started with -chardev socket,id=3Dcharmonitor,path=3D/var/lib/migrate-vm-monitor.sock option to control it [root@host]#printf "{\"execute\" : \"qmp_capabilities\"}\r\n \ {\"execute\": \"migrate-set-capabilities\" , \"arguments\": { \"capabilities\": [ { \"capability\": \"postcopy-blocktime\", \"state\": true } ] } }" | nc -U /var/lib/migrate-vm-monitor.sock Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 8 +++++ migration/postcopy-ram.c | 76 +++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 84 insertions(+) diff --git a/include/migration/migration.h b/include/migration/migration.h index 82bbcd8..7e69a2d 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -83,6 +83,8 @@ typedef enum { POSTCOPY_INCOMING_END } PostcopyState; =20 +struct PostcopyBlocktimeContext; + /* State for the incoming migration */ struct MigrationIncomingState { QEMUFile *from_src_file; @@ -123,6 +125,12 @@ struct MigrationIncomingState { =20 /* See savevm.c */ LoadStateEntry_Head loadvm_handlers; + + /* + * PostcopyBlocktimeContext to keep information for postcopy + * live migration, to calculate vCPU block time + * */ + struct PostcopyBlocktimeContext *blocktime_ctx; }; =20 MigrationIncomingState *migration_incoming_get_current(void); diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index c96d5f5..a1f1705 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -60,6 +60,73 @@ struct PostcopyDiscardState { #include #include =20 +typedef struct PostcopyBlocktimeContext { + /* time when page fault initiated per vCPU */ + int64_t *page_fault_vcpu_time; + /* page address per vCPU */ + uint64_t *vcpu_addr; + int64_t total_blocktime; + /* blocktime per vCPU */ + int64_t *vcpu_blocktime; + /* point in time when last page fault was initiated */ + int64_t last_begin; + /* number of vCPU are suspended */ + int smp_cpus_down; + + /* + * Handler for exit event, necessary for + * releasing whole blocktime_ctx + */ + Notifier exit_notifier; + /* + * Handler for postcopy event, necessary for + * releasing unnecessary part of blocktime_ctx + */ + Notifier postcopy_notifier; +} PostcopyBlocktimeContext; + +static void destroy_blocktime_context(struct PostcopyBlocktimeContext *ctx) +{ + g_free(ctx->page_fault_vcpu_time); + g_free(ctx->vcpu_addr); + g_free(ctx->vcpu_blocktime); + g_free(ctx); +} + +static void postcopy_migration_cb(Notifier *n, void *data) +{ + PostcopyBlocktimeContext *ctx =3D container_of(n, PostcopyBlocktimeCon= text, + postcopy_notifier); + MigrationState *s =3D data; + if (migration_has_finished(s) || migration_has_failed(s)) { + g_free(ctx->page_fault_vcpu_time); + /* g_free is NULL robust */ + ctx->page_fault_vcpu_time =3D NULL; + g_free(ctx->vcpu_addr); + ctx->vcpu_addr =3D NULL; + } +} + +static void migration_exit_cb(Notifier *n, void *data) +{ + PostcopyBlocktimeContext *ctx =3D container_of(n, PostcopyBlocktimeCon= text, + exit_notifier); + destroy_blocktime_context(ctx); +} + +static struct PostcopyBlocktimeContext *blocktime_context_new(void) +{ + PostcopyBlocktimeContext *ctx =3D g_new0(PostcopyBlocktimeContext, 1); + ctx->page_fault_vcpu_time =3D g_new0(int64_t, smp_cpus); + ctx->vcpu_addr =3D g_new0(uint64_t, smp_cpus); + ctx->vcpu_blocktime =3D g_new0(int64_t, smp_cpus); + + ctx->exit_notifier.notify =3D migration_exit_cb; + ctx->postcopy_notifier.notify =3D postcopy_migration_cb; + qemu_add_exit_notifier(&ctx->exit_notifier); + add_migration_state_change_notifier(&ctx->postcopy_notifier); + return ctx; +} =20 /* * Check userfault fd features, to request only supported features in @@ -134,6 +201,15 @@ static bool ufd_check_and_apply(int ufd, MigrationInco= mingState *mis) return false; } =20 +#ifdef UFFD_FEATURE_THREAD_ID + if (migrate_postcopy_blocktime() && mis && + UFFD_FEATURE_THREAD_ID & supported_features) { + /* kernel supports that feature */ + mis->blocktime_ctx =3D blocktime_context_new(); + asked_features |=3D UFFD_FEATURE_THREAD_ID; + } +#endif + /* * request features, even if asked_features is 0, due to * kernel expects UFFD_API before UFFDIO_REGISTER, per --=20 1.9.1 From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494596017064890.0935748206982; Fri, 12 May 2017 06:33:37 -0700 (PDT) Received: from localhost ([::1]:53838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9AhL-0006nk-On for importer@patchew.org; Fri, 12 May 2017 09:33:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005O2-Ss for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afe-00072Z-GS for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:20657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afe-00070o-BF for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:50 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00GMPDKPLB10@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:49 +0100 (BST) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133148eucas1p26293173919ce8d7edf8179f2c422a42f~93w9nFd4v0943009430eucas1p2K; Fri, 12 May 2017 13:31:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 04.C2.17464.449B5195; Fri, 12 May 2017 14:31:48 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170512133147eucas1p1eaa21aac3a0b9d45be0ef8ea903b6824~93w9BbKKZ2731027310eucas1p1E; Fri, 12 May 2017 13:31:47 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 51.81.20206.369B5195; Fri, 12 May 2017 14:32:19 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:47 +0100 (BST) X-AuditID: cbfec7f2-f797e6d000004438-4e-5915b944dc3d From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:24 +0300 Message-id: <1494595886-30912-8-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsWy7djPc7ouO0UjDS48F7WYe/c8i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zcQgJLGGUWNP/mxXC6WWSOHP5CGMXIwcHm4CB xL57tiANIgKSEr+7TjOD2MwCsRKXJrwAGyQs4C5x7fhFdhCbRUBV4s7nxywgrbxA8c42Dohd chInj01mBbE5BTwkHt+9BWYLAZVsa1jKNoGRdwEjwypGkdTS4tz03GIjveLE3OLSvHS95Pzc TYzAEN127OeWHYxd74IPMQpwMCrx8FasF40UYk0sK67MPcQowcGsJMJruAUoxJuSWFmVWpQf X1Sak1p8iNEU6KaJzFKiyfnA+MkriTc0MTS3NDQytrAwNzJSEued+uFKuJBAemJJanZqakFq EUwfEwenVAOjY1zjp/C3iqf2Naw/XzvbkqOy2iXx18vYrj3/2Q7893m+98+h8JsrE6MrLkY+ WXrI315crOib+4vHL46+l3063fCn2lk+Qd6Iv5p9phbbEqV63XVy+Vp+nyhcZThf4aH3gWVW 5jqf25Ujmv/PLQh1EGdVW7r8a1+3efQDGd3t92dIXz9cyNOoxFKckWioxVxUnAgAQBftc2cC AAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133147eucas1p1eaa21aac3a0b9d45be0ef8ea903b6824 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133147eucas1p1eaa21aac3a0b9d45be0ef8ea903b6824 X-RootMTR: 20170512133147eucas1p1eaa21aac3a0b9d45be0ef8ea903b6824 References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.11 Subject: [Qemu-devel] [PATCH V5 7/9] migration: calculate vCPU blocktime on dst side X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch provides blocktime calculation per vCPU, as a summary and as a overlapped value for all vCPUs. This approach was suggested by Peter Xu, as an improvements of previous approch where QEMU kept tree with faulted page address and cpus bi= tmask in it. Now QEMU is keeping array with faulted page address as value and vCPU as index. It helps to find proper vCPU at UFFD_COPY time. Also it keeps list for blocktime per vCPU (could be traced with page_fault_addr) Blocktime will not calculated if postcopy_blocktime field of MigrationIncomingState wasn't initialized. Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 87 ++++++++++++++++++++++++++++++++++++++++++++= +++- migration/trace-events | 5 ++- 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index a1f1705..e2660ae 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -23,6 +23,7 @@ #include "migration/postcopy-ram.h" #include "sysemu/sysemu.h" #include "sysemu/balloon.h" +#include #include "qemu/error-report.h" #include "trace.h" =20 @@ -542,6 +543,86 @@ static int ram_block_enable_notify(const char *block_n= ame, void *host_addr, return 0; } =20 +static int get_mem_fault_cpu_index(uint32_t pid) +{ + CPUState *cpu_iter; + + CPU_FOREACH(cpu_iter) { + if (cpu_iter->thread_id =3D=3D pid) { + return cpu_iter->cpu_index; + } + } + trace_get_mem_fault_cpu_index(pid); + return -1; +} + +static void mark_postcopy_blocktime_begin(uint64_t addr, int cpu) +{ + MigrationIncomingState *mis =3D migration_incoming_get_current(); + PostcopyBlocktimeContext *dc; + int64_t now_ms; + if (!mis->blocktime_ctx || cpu < 0) { + return; + } + now_ms =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); + dc =3D mis->blocktime_ctx; + if (dc->vcpu_addr[cpu] =3D=3D 0) { + atomic_inc(&dc->smp_cpus_down); + } + + atomic_xchg__nocheck(&dc->vcpu_addr[cpu], addr); + atomic_xchg__nocheck(&dc->last_begin, now_ms); + atomic_xchg__nocheck(&dc->page_fault_vcpu_time[cpu], now_ms); + + trace_mark_postcopy_blocktime_begin(addr, dc, dc->page_fault_vcpu_time= [cpu], + cpu); +} + +static void mark_postcopy_blocktime_end(uint64_t addr) +{ + MigrationIncomingState *mis =3D migration_incoming_get_current(); + PostcopyBlocktimeContext *dc; + int i, affected_cpu =3D 0; + int64_t now_ms; + bool vcpu_total_blocktime =3D false; + + if (!mis->blocktime_ctx) { + return; + } + dc =3D mis->blocktime_ctx; + now_ms =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); + + /* lookup cpu, to clear it, + * that algorithm looks straighforward, but it's not + * optimal, more optimal algorithm is keeping tree or hash + * where key is address value is a list of */ + for (i =3D 0; i < smp_cpus; i++) { + uint64_t vcpu_blocktime =3D 0; + if (atomic_fetch_add(&dc->vcpu_addr[i], 0) !=3D addr) { + continue; + } + atomic_xchg__nocheck(&dc->vcpu_addr[i], 0); + vcpu_blocktime =3D now_ms - + atomic_fetch_add(&dc->page_fault_vcpu_time[i], 0); + affected_cpu +=3D 1; + /* we need to know is that mark_postcopy_end was due to + * faulted page, another possible case it's prefetched + * page and in that case we shouldn't be here */ + if (!vcpu_total_blocktime && + atomic_fetch_add(&dc->smp_cpus_down, 0) =3D=3D smp_cpus) { + vcpu_total_blocktime =3D true; + } + /* continue cycle, due to one page could affect several vCPUs */ + dc->vcpu_blocktime[i] +=3D vcpu_blocktime; + } + + atomic_sub(&dc->smp_cpus_down, affected_cpu); + if (vcpu_total_blocktime) { + dc->total_blocktime +=3D now_ms - atomic_fetch_add(&dc->last_begin= , 0); + } + trace_mark_postcopy_blocktime_end(addr, dc, dc->total_blocktime); +} + /* * Handle faults detected by the USERFAULT markings */ @@ -619,8 +700,11 @@ static void *postcopy_ram_fault_thread(void *opaque) rb_offset &=3D ~(qemu_ram_pagesize(rb) - 1); trace_postcopy_ram_fault_thread_request(msg.arg.pagefault.address, qemu_ram_get_idstr(rb), - rb_offset); + rb_offset, + msg.arg.pagefault.feat.pti= d); =20 + mark_postcopy_blocktime_begin((uintptr_t)(msg.arg.pagefault.addres= s), + get_mem_fault_cpu_index(msg.arg.pagefault.feat.pt= id)); /* * Send the request to the source - we want to request one * of our host page sizes (which is >=3D TPS) @@ -715,6 +799,7 @@ int postcopy_place_page(MigrationIncomingState *mis, vo= id *host, void *from, =20 return -e; } + mark_postcopy_blocktime_end((uint64_t)(uintptr_t)host); =20 trace_postcopy_place_page(host); return 0; diff --git a/migration/trace-events b/migration/trace-events index b8f01a2..9424e3e 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -110,6 +110,8 @@ process_incoming_migration_co_end(int ret, int ps) "ret= =3D%d postcopy-state=3D%d" process_incoming_migration_co_postcopy_end_main(void) "" migration_set_incoming_channel(void *ioc, const char *ioctype) "ioc=3D%p i= octype=3D%s" migration_set_outgoing_channel(void *ioc, const char *ioctype, const char = *hostname) "ioc=3D%p ioctype=3D%s hostname=3D%s" +mark_postcopy_blocktime_begin(uint64_t addr, void *dd, int64_t time, int c= pu) "addr 0x%" PRIx64 " dd %p time %" PRId64 " cpu %d" +mark_postcopy_blocktime_end(uint64_t addr, void *dd, int64_t time) "addr 0= x%" PRIx64 " dd %p time %" PRId64 =20 # migration/rdma.c qemu_rdma_accept_incoming_migration(void) "" @@ -186,7 +188,7 @@ postcopy_ram_enable_notify(void) "" postcopy_ram_fault_thread_entry(void) "" postcopy_ram_fault_thread_exit(void) "" postcopy_ram_fault_thread_quit(void) "" -postcopy_ram_fault_thread_request(uint64_t hostaddr, const char *ramblock,= size_t offset) "Request for HVA=3D%" PRIx64 " rb=3D%s offset=3D%zx" +postcopy_ram_fault_thread_request(uint64_t hostaddr, const char *ramblock,= size_t offset, uint32_t pid) "Request for HVA=3D%" PRIx64 " rb=3D%s offset= =3D%zx %u" postcopy_ram_incoming_cleanup_closeuf(void) "" postcopy_ram_incoming_cleanup_entry(void) "" postcopy_ram_incoming_cleanup_exit(void) "" @@ -195,6 +197,7 @@ save_xbzrle_page_skipping(void) "" save_xbzrle_page_overflow(void) "" ram_save_iterate_big_wait(uint64_t milliconds, int iterations) "big wait: = %" PRIu64 " milliseconds, %d iterations" ram_load_complete(int ret, uint64_t seq_iter) "exit_code %d seq iteration = %" PRIu64 +get_mem_fault_cpu_index(uint32_t pid) "pid %u is not vCPU" =20 # migration/exec.c migration_exec_outgoing(const char *cmd) "cmd=3D%s" --=20 1.9.1 From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494596233033189.7075513156367; Fri, 12 May 2017 06:37:13 -0700 (PDT) Received: from localhost ([::1]:53855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Akp-0000uD-OQ for importer@patchew.org; Fri, 12 May 2017 09:37:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afj-0005OA-6Q for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afe-00072j-NS for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:55 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:20657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afe-00070o-Hm for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:50 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00GMPDKPLB10@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:49 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133149eucas1p25af3720a729202cf751a3109ce4f7429~93w_ArjG80751307513eucas1p2L; Fri, 12 May 2017 13:31:49 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 2D.94.04459.449B5195; Fri, 12 May 2017 14:31:48 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133148eucas1p2c04111d415b1fbd6fb702cfc2a3ed6f9~93w9YZ0Pe0605406054eucas1p2Y; Fri, 12 May 2017 13:31:48 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BF.8E.17452.7D9B5195; Fri, 12 May 2017 14:34:15 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:48 +0100 (BST) X-AuditID: cbfec7f1-f796e6d00000116b-80-5915b944e945 From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:25 +0300 Message-id: <1494595886-30912-9-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsWy7djPc7ouO0UjDa7M0LGYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFgdWjyfXNjN5vN93lc2jb8sqxgDmKC6blNSczLLUIn27BK6MVfcm MhdMdqzoXN7F2MA43biLkZNDQsBEovvxGRYIW0ziwr31bF2MXBxCAksZJS5OOcoE4XxmlNgw 9wdQFQdYx9nDEhDxZYwSh683MIF0Cwl0M0ks+ZgGUsMmYCCx754tSFhEQFLid9dpZhCbWSBW 4u31a2wgtrBAiMTiXS/BFrMIqEp8WvEebAyvgLvEv0cbmSAOkpM4eWwyK4jNKeAh8fjuLVaQ vRIC19kkjhxtZ4S4R1Zi0wFmiHoXiXfzJ7ND2MISr45vgbJlJDo7DjJB9LYzSnTv7IQaNIFR 4sz0v1BV9hKnbl5lgriUT2LStunMEAt4JTrahCBKPCQe7FvJCmE7Stw62MMOCYjZjBJP9r9i nsAos4CRYRWjSGppcW56arGRXnFibnFpXrpecn7uJkZgZJ7+d/zjDsb3J6wOMQpwMCrx8Cqs FY0UYk0sK67MPcQowcGsJMJruAUoxJuSWFmVWpQfX1Sak1p8iFGag0VJnJfr1LUIIYH0xJLU 7NTUgtQimCwTB6dUAyND3/IFx4+l68pkOfV2paYLZJj8dFs+adUGN4tHbivErzP5ydzznsXs ptanX7UvfQ7X3iOOL+rkGs+sU3ZmUNBWKZ6oabq9o975lfZy1gsKb59Jl8y7xPyv+KjtrF99 O7ZZZ+5p6jz8UNwgxsfulDvj1C03b7z4IrWsqPSdiqdxpt67HbvS7iqxFGckGmoxFxUnAgCv t1yMyAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsVy+t/xy7rXd4pGGqzr1LeYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFgdWjyfXNjN5vN93lc2jb8sqxgDmKDebjNTElNQihdS85PyUzLx0 W6XQEDddCyWFvMTcVFulCF3fkCAlhbLEnFIgz8gADTg4B7gHK+nbJbhlrLo3kblgsmNF5/Iu xgbG6cZdjBwcEgImEmcPS3QxcgKZYhIX7q1nA7GFBJYwSrzqze9i5AKye5kkuptnMoPUswkY SOy7ZwtSIyIgKfG76zQziM0sECtxacILsF5hgRCJxbtesoDYLAKqEp9WvGcCsXkF3CX+PdrI BLFLTuLkscmsIDangIfE47u3WCH2uktsa1jKNoGRdwEjwypGkdTS4tz03GJDveLE3OLSvHS9 5PzcTYzAAN127OfmHYyXNgYfYhTgYFTi4VVYKxopxJpYVlyZe4hRgoNZSYTXcAtQiDclsbIq tSg/vqg0J7X4EKMp0FETmaVEk/OB0ZNXEm9oYmhuaWhkbGFhbmSkJM5b8uFKuJBAemJJanZq akFqEUwfEwenVAOjjI3uS8YIRxvzJZX3Nor4MTj27Lv/4tERSYklBuv8F/M0B3ZEHZ5SMeVZ 4eMH33kOO706+uRfX1pc9/Xcs6fTatYsvZqhfJulhe3R87LrXntVUp71aluVHBLUYZg12V1t 0o60oHCXIHaxxJjgNa2iJ67kTgxKn7zhiPJdr3+L2ruyO+YGrnuqxFKckWioxVxUnAgAUxCy A2YCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133148eucas1p2c04111d415b1fbd6fb702cfc2a3ed6f9 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133148eucas1p2c04111d415b1fbd6fb702cfc2a3ed6f9 X-RootMTR: 20170512133148eucas1p2c04111d415b1fbd6fb702cfc2a3ed6f9 References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.11 Subject: [Qemu-devel] [PATCH V5 8/9] migration: add postcopy total blocktime into query-migrate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Postcopy total blocktime is available on destination side only. But query-migrate was possible only for source. This patch adds ability to call query-migrate on destination. To distinguish src/dst, state of the MigrationState is using, query-migrate prepares MigrationInfo for source machine only in case of migration's state is diffe= rent than MIGRATION_STATUS_NONE. To be able to see postcopy blocktime, need to request postcopy-blocktime capability. The query-migrate command will show following sample result: {"return": "postcopy_vcpu_blocktime": [115, 100], "status": "completed", "postcopy_blocktime": 100 }} postcopy_vcpu_blocktime contains list, where the first item is the first vCPU in QEMU. Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 4 +++ migration/migration.c | 47 ++++++++++++++++++++++++++-- migration/postcopy-ram.c | 73 +++++++++++++++++++++++++++++++++++++++= ++++ migration/trace-events | 1 + qapi-schema.json | 6 +++- 5 files changed, 127 insertions(+), 4 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 7e69a2d..aba0535 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -135,6 +135,10 @@ struct MigrationIncomingState { =20 MigrationIncomingState *migration_incoming_get_current(void); void migration_incoming_state_destroy(void); +/* + * Functions to work with blocktime context + */ +void fill_destination_postcopy_migration_info(MigrationInfo *info); =20 struct MigrationState { diff --git a/migration/migration.c b/migration/migration.c index c0443ce..7a4f33f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -666,9 +666,15 @@ static void populate_ram_info(MigrationInfo *info, Mig= rationState *s) } } =20 -MigrationInfo *qmp_query_migrate(Error **errp) +/* TODO improve this assumption */ +static bool is_source_migration(void) +{ + MigrationState *ms =3D migrate_get_current(); + return ms->state !=3D MIGRATION_STATUS_NONE; +} + +static void fill_source_migration_info(MigrationInfo *info) { - MigrationInfo *info =3D g_malloc0(sizeof(*info)); MigrationState *s =3D migrate_get_current(); =20 switch (s->state) { @@ -759,10 +765,45 @@ MigrationInfo *qmp_query_migrate(Error **errp) break; } info->status =3D s->state; +} + +static void fill_destination_migration_info(MigrationInfo *info) +{ + MigrationIncomingState *mis =3D migration_incoming_get_current(); =20 - return info; + switch (mis->state) { + case MIGRATION_STATUS_NONE: + break; + case MIGRATION_STATUS_SETUP: + case MIGRATION_STATUS_CANCELLING: + case MIGRATION_STATUS_CANCELLED: + case MIGRATION_STATUS_ACTIVE: + case MIGRATION_STATUS_POSTCOPY_ACTIVE: + case MIGRATION_STATUS_FAILED: + case MIGRATION_STATUS_COLO: + info->has_status =3D true; + break; + case MIGRATION_STATUS_COMPLETED: + info->has_status =3D true; + fill_destination_postcopy_migration_info(info); + break; + } + info->status =3D mis->state; } =20 +MigrationInfo *qmp_query_migrate(Error **errp) +{ + MigrationInfo *info =3D g_malloc0(sizeof(*info)); + + if (is_source_migration()) { + fill_source_migration_info(info); + } else { + fill_destination_migration_info(info); + } + + return info; + } + void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, Error **errp) { diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index e2660ae..fe047c8 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -129,6 +129,71 @@ static struct PostcopyBlocktimeContext *blocktime_cont= ext_new(void) return ctx; } =20 +static int64List *get_vcpu_blocktime_list(PostcopyBlocktimeContext *ctx) +{ + int64List *list =3D NULL, *entry =3D NULL; + int i; + + for (i =3D smp_cpus - 1; i >=3D 0; i--) { + entry =3D g_new0(int64List, 1); + entry->value =3D ctx->vcpu_blocktime[i]; + entry->next =3D list; + list =3D entry; + } + + return list; +} + +/* + * This function just provide calculated blocktime per cpu and trace it. + * Total blocktime is calculated in mark_postcopy_blocktime_end. + * + * + * Assume we have 3 CPU + * + * S1 E1 S1 E1 + * -----***********------------xxx***************------------------------>= CPU1 + * + * S2 E2 + * ------------****************xxx--------------------------------------->= CPU2 + * + * S3 E3 + * ------------------------****xxx********------------------------------->= CPU3 + * + * We have sequence S1,S2,E1,S3,S1,E2,E3,E1 + * S2,E1 - doesn't match condition due to sequence S1,S2,E1 doesn't includ= e CPU3 + * S3,S1,E2 - sequence includes all CPUs, in this case overlap will be S1,= E2 - + * it's a part of total blocktime. + * S1 - here is last_begin + * Legend of the picture is following: + * * - means blocktime per vCPU + * x - means overlapped blocktime (total blocktime) + */ +void fill_destination_postcopy_migration_info(MigrationInfo *info) +{ + MigrationIncomingState *mis =3D migration_incoming_get_current(); + + if (!mis->blocktime_ctx) { + return; + } + + info->has_postcopy_blocktime =3D true; + info->postcopy_blocktime =3D mis->blocktime_ctx->total_blocktime; + info->has_postcopy_vcpu_blocktime =3D true; + info->postcopy_vcpu_blocktime =3D get_vcpu_blocktime_list(mis->blockti= me_ctx); +} + +static uint64_t get_postcopy_total_blocktime(void) +{ + MigrationIncomingState *mis =3D migration_incoming_get_current(); + + if (!mis->blocktime_ctx) { + return 0; + } + + return mis->blocktime_ctx->total_blocktime; +} + /* * Check userfault fd features, to request only supported features in * future. @@ -462,6 +527,9 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingStat= e *mis) } =20 postcopy_state_set(POSTCOPY_INCOMING_END); + /* here should be blocktime receiving back operation */ + trace_postcopy_ram_incoming_cleanup_blocktime( + get_postcopy_total_blocktime()); migrate_send_rp_shut(mis, qemu_file_get_error(mis->from_src_file) !=3D= 0); =20 if (mis->postcopy_tmp_page) { @@ -876,6 +944,11 @@ void *postcopy_get_tmp_page(MigrationIncomingState *mi= s) =20 #else /* No target OS support, stubs just fail */ +void fill_destination_postcopy_migration_info(MigrationInfo *info) +{ + error_report("%s: No OS support", __func__); +} + bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) { error_report("%s: No OS support", __func__); diff --git a/migration/trace-events b/migration/trace-events index 9424e3e..bdaca1d 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -193,6 +193,7 @@ postcopy_ram_incoming_cleanup_closeuf(void) "" postcopy_ram_incoming_cleanup_entry(void) "" postcopy_ram_incoming_cleanup_exit(void) "" postcopy_ram_incoming_cleanup_join(void) "" +postcopy_ram_incoming_cleanup_blocktime(uint64_t total) "total blocktime %= " PRIu64 save_xbzrle_page_skipping(void) "" save_xbzrle_page_overflow(void) "" ram_save_iterate_big_wait(uint64_t milliconds, int iterations) "big wait: = %" PRIu64 " milliseconds, %d iterations" diff --git a/qapi-schema.json b/qapi-schema.json index fde6d63..e11c5f2 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -712,6 +712,8 @@ # @status is 'failed'. Clients should not attempt to parse the # error strings. (Since 2.7) # +# @postcopy_vcpu_blocktime: list of the postcopy blocktime per vCPU (Since= 2.9) +# # Since: 0.14.0 ## { 'struct': 'MigrationInfo', @@ -723,7 +725,9 @@ '*downtime': 'int', '*setup-time': 'int', '*cpu-throttle-percentage': 'int', - '*error-desc': 'str'} } + '*error-desc': 'str', + '*postcopy_blocktime' : 'int64', + '*postcopy_vcpu_blocktime': ['int64']} } =20 ## # @query-migrate: --=20 1.9.1 From nobody Tue May 7 12:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494596011117513.2315172438399; Fri, 12 May 2017 06:33:31 -0700 (PDT) Received: from localhost ([::1]:53836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9AhE-0006j8-3s for importer@patchew.org; Fri, 12 May 2017 09:33:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005O1-Sd for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afe-00072q-Ta for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:20657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afe-00070o-OI for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:50 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00GMPDKPLB10@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:50 +0100 (BST) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133149eucas1p21cb55ffd89742b57d9873b3ea0f36c62~93w_50bqf0605806058eucas1p26; Fri, 12 May 2017 13:31:49 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 13.82.14140.849B5195; Fri, 12 May 2017 14:31:52 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133149eucas1p2b4c448fe763975cf11cf96801857d42e~93w_VLJgA0942109421eucas1p24; Fri, 12 May 2017 13:31:49 +0000 (GMT) Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 82.81.20206.569B5195; Fri, 12 May 2017 14:32:21 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:48 +0100 (BST) X-AuditID: cbfec7ef-f796a6d00000373c-68-5915b948df08 From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:26 +0300 Message-id: <1494595886-30912-10-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCIsWRmVeSWpSXmKPExsWy7djP87oeO0UjDV40y1nMvXuexaJ32z12 iyvtP9kttuz/xm5xvHcHiwOrx5Nrm5k83u+7yubRt2UVYwBzFJdNSmpOZllqkb5dAlfGmRtL mAp2cVRsv/SfqYGxib2LkZNDQsBE4sPxnywQtpjEhXvr2boYuTiEBJYxShybeYQJwvkM5Jzf xATTMe3WFUa4qiddDYwgCSGBbiaJJR/Tuhg5ONgE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2MHa9Cz7EKMDBqMTDW7FeNFKINbGsuDL3EKMEB7OSCK/hFqAQb0piZVVq UX58UWlOavEhRlOgmyYyS4km5wPjJ68k3tDE0NzS0MjYwsLcyEhJnHfqhyvhQgLpiSWp2amp BalFMH1MHJxSDYy7JpRU36s7u+zft+L62qV7VNdf5V3xSnnx52u9308sEjl03sflKFfiPcMb iklFnooWEqocZS9nuF0OWzJ3jc+cW8l6WtMPv9nls3zOB+1Ze1Y0zloUvuzUB7+qs3r1jzWd IlbPDPSsq8mRW8RbxFC26HBCxRHTlc6v9/5fHb+23/DqxoRrW7MdlViKMxINtZiLihMB10RV J2cCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133149eucas1p2b4c448fe763975cf11cf96801857d42e X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133149eucas1p2b4c448fe763975cf11cf96801857d42e X-RootMTR: 20170512133149eucas1p2b4c448fe763975cf11cf96801857d42e References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.11 Subject: [Qemu-devel] [PATCH V5 9/9] migration: postcopy_blocktime documentation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Alexey Perevalov --- docs/migration.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 1b940a8..d0f5a6d 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -402,6 +402,16 @@ will now cause the transition from precopy to postcopy. It can be issued immediately after migration is started or any time later on. Issuing it after the end of a migration is harmless. =20 +Blocktime it's a postcopy live migration metric, intend to show +when source vCPU was in state interruptable sleep due to pagefault. +This value is calculated on destination side. +To enable postcopy blocktime calculation, enter following command on desti= nation +monitor: + +migrate_set_capability postcopy-blocktime on + +Postcopy blocktime could be retrieved by query-migrate qmp command. + Note: During the postcopy phase, the bandwidth limits set using migrate_set_speed is ignored (to avoid delaying requested pages that the destination is waiting for). --=20 1.9.1