Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp902515ybh; Wed, 15 Jul 2020 19:43:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4QV7Z397XvOhcU43XVAgdIfBsMS0wxd7waRUTJow0ztQKgWadv6eqHoPfKs9ZlSF8nu04 X-Received: by 2002:a05:6402:1c11:: with SMTP id ck17mr2346373edb.38.1594867394081; Wed, 15 Jul 2020 19:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594867394; cv=none; d=google.com; s=arc-20160816; b=kW/YXSyHY7gbueYWr2y4CenhLrv2EI0laCOSvx8PFTrQgG99mA+wseyRF1jFIDg1CN /+sWU/F0NlZLuOvlqBkPTvv34dTP0YS3s1mdLxt8GXECZu0nFvfJ1mfUyRq5Y6sgTROb syNfXFVm84aNhUOuw4yEtdXOhGzpVumfHQvmQ4Ukhe2+PN/SLix10y5TmbyoelDNjLON 7vkbDaWyKGh/ZCNRVtG82l638YTEuwFUEuGwHEc17fzs9db1bnmihZ0SJxr0mDjof+B6 OW0ICobap85AoUeAJ5Dhf3ZaZB8ncR8z0AnGCFEDNso/o211em/Vgb6ddPnvTfQsJoJS 67sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=pMUh74u4XYxQ5zeoI5c5z2jLhLTruTnby76J5ljCIEQ=; b=ETvqnmflzmhNWy/vaaCmbRsp3DoKEqcf0Y/zpO/stYcyx8CZgJGYoiVAbPzMVaP8qJ 5anExFIN6sbJBkI+KKXgjptTCzFcDEB3xX1b6+yOALklyIdugUs2GKh+UXiPZkSd5KAI IVGNP/EaM0/SY/FI0K1QDqbNJnbKFFWbDB0B0GiQzm52J+dNqJizvw/02OcWCnJ8yS80 d97iBU3dNwnqixnvwWMfP2m+e7KQ3y/Xy29nMj20PB2HyEuC7Pabk8wP3YiWu5pcN/Fm XGDy6Q7mAGsu01wBDwdH7DHNaid/pYozugO1G5qj+w+4CiWlqK7JBuxETY1hdLSCzIxH iNng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr25si2203707ejb.622.2020.07.15.19.42.51; Wed, 15 Jul 2020 19:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727940AbgGPCml (ORCPT + 99 others); Wed, 15 Jul 2020 22:42:41 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:50720 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727891AbgGPCmi (ORCPT ); Wed, 15 Jul 2020 22:42:38 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=teawaterz@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0U2rTvAn_1594867352; Received: from localhost(mailfrom:teawaterz@linux.alibaba.com fp:SMTPD_---0U2rTvAn_1594867352) by smtp.aliyun-inc.com(127.0.0.1); Thu, 16 Jul 2020 10:42:34 +0800 From: Hui Zhu To: mst@redhat.com, david@redhat.com, jasowang@redhat.com, akpm@linux-foundation.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org Cc: Hui Zhu Subject: [RFC for qemu v4 0/2] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_F_CONT_PAGES Date: Thu, 16 Jul 2020 10:41:53 +0800 Message-Id: <1594867315-8626-4-git-send-email-teawater@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594867315-8626-1-git-send-email-teawater@gmail.com> References: <1594867315-8626-1-git-send-email-teawater@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Code of current version for Linux and qemu is available in [1] and [2]. Update of this version: 1. Report continuous pages will increase the speed. So added deflate continuous pages. 2. According to the comments from David in [3], added 2 new vqs icvq and dcvq to get continuous pages with format 32 bits pfn and 32 bits size. Following is the introduction of the function. Set option cont-pages to on will open flags VIRTIO_BALLOON_F_CONT_PAGES. qemu will get continuous pages from icvq and dcvq and do madvise MADV_WILLNEED and MADV_DONTNEED with the pages. Opening this flag can bring two benefits: 1. Increase the speed of balloon inflate and deflate. 2. Decrease the splitted THPs number in the host. [1] https://github.com/teawater/linux/tree/balloon_conts [2] https://github.com/teawater/qemu/tree/balloon_conts [3] https://lkml.org/lkml/2020/5/13/1211 Hui Zhu (2): virtio_balloon: Add cont-pages and icvq virtio_balloon: Add dcvq to deflate continuous pages hw/virtio/virtio-balloon.c | 92 +++++++++++++++--------- include/hw/virtio/virtio-balloon.h | 2 include/standard-headers/linux/virtio_balloon.h | 1 3 files changed, 63 insertions(+), 32 deletions(-)