Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2634683imm; Fri, 20 Jul 2018 02:03:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSSMvJUZOJDmEPpyihOia06dkB6Yh3p+ijhPeCVe8Rl881LDvM0zlyj82fpU6LOKvqdXOg X-Received: by 2002:a63:c60:: with SMTP id 32-v6mr1250654pgm.155.1532077407874; Fri, 20 Jul 2018 02:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532077407; cv=none; d=google.com; s=arc-20160816; b=qSAFE723N+uh+LE9VCxAigkjOREUhjxeQKT5UKiteDe0j82iCtE9muG8xkpIPzJDJh d+or6uHP/VlOfrYbbvgwJr3lAK9a/SftR17ZecrW+UN4ybRy+vltV4m5QsB94Xuq7+O7 1mmbpSxqR8EPFLcPe23yagpjXVAyrzlLeSy9HJk6Bv/wbaof0O81ublLaxcqSkD3v1+l kCeAS6lNedPtyRimVojHndYOjsGXi33NSKVXD2n/aAFcxSFCtIWMe98wnzcv6qe+8y5d P6ap2v8GkDmpzXk13VrReFLaKdeR/p2ZlsFKwz4nZFO2DPEGv+V1Hu55sVFuETk6JWnh Cc9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=mbUs4drGNZTzzutfn4njKMn8O10dNexfxDRUeAb4FCg=; b=EIA+gJHXZHNUH7maRCs+mfcrkT+JcuwVkFK4v+Q0qZqD2wGvwVp9GplFfyY4HGzAZ8 /7PJQN3cP2Yl1CVaxF0ydebMVPuOQFuicE22WqAaPArgSEykK1qZ4dQBfseqwbvA2HtW y63CbF7pJw6aRfDP9KgH4iAeEBP293bY4EHX3ejWcy+hRPQwUPH6wcdiF9844y778g+U 2vOsvO+3SKpZsOOFhvM5MaOWyjQgzfyQJpvk3W7RnXbi2AQo9WlElMAEjSTS3tvUkdvX gjYK4foHHtEFXe3ZXkECIIQs7wW6Q7elmfPwqr321u8gq8zBhuBTNPRMcrlQkWw2gwG5 UweA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s23-v6si1444631pga.563.2018.07.20.02.03.13; Fri, 20 Jul 2018 02:03:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727352AbeGTJry (ORCPT + 99 others); Fri, 20 Jul 2018 05:47:54 -0400 Received: from mga12.intel.com ([192.55.52.136]:18470 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727167AbeGTJry (ORCPT ); Fri, 20 Jul 2018 05:47:54 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2018 02:00:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,378,1526367600"; d="scan'208";a="66141351" Received: from devel-ww.sh.intel.com ([10.239.48.110]) by FMSMGA003.fm.intel.com with ESMTP; 20 Jul 2018 02:00:18 -0700 From: Wei Wang To: virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-mm@kvack.org, mst@redhat.com, mhocko@kernel.org, akpm@linux-foundation.org, torvalds@linux-foundation.org Cc: pbonzini@redhat.com, wei.w.wang@intel.com, liliang.opensource@gmail.com, yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com, riel@redhat.com, peterx@redhat.com Subject: [PATCH v36 0/5] Virtio-balloon: support free page reporting Date: Fri, 20 Jul 2018 16:33:00 +0800 Message-Id: <1532075585-39067-1-git-send-email-wei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series is separated from the previous "Virtio-balloon Enhancement" series. The new feature, VIRTIO_BALLOON_F_FREE_PAGE_HINT, implemented by this series enables the virtio-balloon driver to report hints of guest free pages to the host. It can be used to accelerate live migration of VMs. Here is an introduction of this usage: Live migration needs to transfer the VM's memory from the source machine to the destination round by round. For the 1st round, all the VM's memory is transferred. From the 2nd round, only the pieces of memory that were written by the guest (after the 1st round) are transferred. One method that is popularly used by the hypervisor to track which part of memory is written is to write-protect all the guest memory. This feature enables the optimization by skipping the transfer of guest free pages during VM live migration. It is not concerned that the memory pages are used after they are given to the hypervisor as a hint of the free pages, because they will be tracked by the hypervisor and transferred in the subsequent round if they are used and written. * Tests - Test Environment Host: Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz Guest: 8G RAM, 4 vCPU Migration setup: migrate_set_speed 100G, migrate_set_downtime 2 second - Test Results - Idle Guest Live Migration Time (results are averaged over 10 runs): - Optimization v.s. Legacy = 409ms vs 1757ms --> ~77% reduction (setting page poisoning zero and enabling ksm don't affect the comparison result) - Guest with Linux Compilation Workload (make bzImage -j4): - Live Migration Time (average) Optimization v.s. Legacy = 1407ms v.s. 2528ms --> ~44% reduction - Linux Compilation Time Optimization v.s. Legacy = 5min4s v.s. 5min12s --> no obvious difference ChangeLog: v35->v36: - remove the mm patch, as Linus has a suggestion to get free page addresses via allocation, instead of reading from the free page list. - virtio-balloon: - replace oom notifier with shrinker; - the guest to host communication interface remains the same as v32. - allocate free page blocks and send to host one by one, and free them after sending all the pages. For ChangeLogs from v22 to v35, please reference https://lwn.net/Articles/759413/ For ChangeLogs before v21, please reference https://lwn.net/Articles/743660/ Wei Wang (5): virtio-balloon: remove BUG() in init_vqs virtio_balloon: replace oom notifier with shrinker virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT mm/page_poison: expose page_poisoning_enabled to kernel modules virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON drivers/virtio/virtio_balloon.c | 456 ++++++++++++++++++++++++++++++------ include/uapi/linux/virtio_balloon.h | 7 + mm/page_poison.c | 6 + 3 files changed, 394 insertions(+), 75 deletions(-) -- 2.7.4