Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp687200imm; Fri, 15 Jun 2018 04:47:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIE4F3BM2hpTah5iB+Lelw56+eGnOdqUoOdn+DVNIId1wBbkMKil0HHkO2e0LmAO+K5yUv5 X-Received: by 2002:a17:902:264:: with SMTP id 91-v6mr1604615plc.341.1529063257219; Fri, 15 Jun 2018 04:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529063257; cv=none; d=google.com; s=arc-20160816; b=yVYEg6Lw2LdaTQ457rKi84d4rk/bH+V9nZEkP+e15cpy3EsFuo3PNeaNFE0DZJwNf7 3vv9y35gBAeVq7g90qdt4/wDHzd2APfYIs7GfTjT5yGxHWgZq5jA83e9FZ0xuyiA8uSF pkPaR7Eq7952t19LaDAhbgUmWdh6QlJRc6924FQGWqYdczLrdP3VxIl/doeGlvGBuvDT 8twnuniVMCDtin4CO3Q5pf8pjLu9B1NZSdGT6DRKao0bRggSNPgI4JWGcLBYVbweSan7 I6NnEFZwzXqmeROXircmivCI2Gij6l9AcwoiS18BSErYotrhYqgymXAm7usOoC7rhmKk Rl5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=U0liTYr/zb7K63AKLF3Kqj2kbc5dyF2BCAydMT2fCAw=; b=FobJurBj+Z6Ft4Kou3wk2VzdD3Bt/IF095jBj2XdlGJ446iFD/0IgRJCKJTQcQesCD 5kl2rCFUY/KRBID9MFnAE94U6QxDjC9q9VsLMP9WcHufLTDY0ChMwSx9d0ikR4K8NcFp SHVQg1DBCt2LRB7dHhbif5GfYt7SS3vHIo9KzfOpugGkdIRDzymfoThsGAUCIgvFt+aX 0xNcfgVjyjQ8uYJXq+ID1PoF24WDkVodEoA+/VTMSPRQNAA1Zjc0YqgVOnYO3SgQIi+u mrekFQYdCKaSzqYwA1/8776OAKBdYaSux4JCM+eq2Wz/W69v7eAhN7CDG2R4DJIiwtzb U/DQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7-v6si6531140pgd.685.2018.06.15.04.46.52; Fri, 15 Jun 2018 04:47:37 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755930AbeFOLmb (ORCPT + 99 others); Fri, 15 Jun 2018 07:42:31 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35926 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755645AbeFOLma (ORCPT ); Fri, 15 Jun 2018 07:42:30 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE5EBF68AB; Fri, 15 Jun 2018 11:42:29 +0000 (UTC) Received: from redhat.com (ovpn-120-46.rdu2.redhat.com [10.10.120.46]) by smtp.corp.redhat.com (Postfix) with SMTP id 439356351C; Fri, 15 Jun 2018 11:42:23 +0000 (UTC) Date: Fri, 15 Jun 2018 14:42:23 +0300 From: "Michael S. Tsirkin" To: Wei Wang Cc: virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, pbonzini@redhat.com, liliang.opensource@gmail.com, yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com, riel@redhat.com, peterx@redhat.com Subject: Re: [PATCH v33 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT Message-ID: <20180615144000-mutt-send-email-mst@kernel.org> References: <1529037793-35521-1-git-send-email-wei.w.wang@intel.com> <1529037793-35521-3-git-send-email-wei.w.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529037793-35521-3-git-send-email-wei.w.wang@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 15 Jun 2018 11:42:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 15 Jun 2018 11:42:29 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 15, 2018 at 12:43:11PM +0800, Wei Wang wrote: > Negotiation of the VIRTIO_BALLOON_F_FREE_PAGE_HINT feature indicates the > support of reporting hints of guest free pages to host via virtio-balloon. > > Host requests the guest to report free page hints by sending a command > to the guest via setting the VIRTIO_BALLOON_HOST_CMD_FREE_PAGE_HINT bit > of the host_cmd config register. > > As the first step here, virtio-balloon only reports free page hints from > the max order (10) free page list to host. This has generated similar good > results as reporting all free page hints during our tests. > > TODO: > - support reporting free page hints from smaller order free page lists > when there is a need/request from users. > > Signed-off-by: Wei Wang > Signed-off-by: Liang Li > Cc: Michael S. Tsirkin > Cc: Michal Hocko > Cc: Andrew Morton > --- > drivers/virtio/virtio_balloon.c | 187 +++++++++++++++++++++++++++++------- > include/uapi/linux/virtio_balloon.h | 13 +++ > 2 files changed, 163 insertions(+), 37 deletions(-) > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index 6b237e3..582a03b 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -43,6 +43,9 @@ > #define OOM_VBALLOON_DEFAULT_PAGES 256 > #define VIRTBALLOON_OOM_NOTIFY_PRIORITY 80 > > +/* The size of memory in bytes allocated for reporting free page hints */ > +#define FREE_PAGE_HINT_MEM_SIZE (PAGE_SIZE * 16) > + > static int oom_pages = OOM_VBALLOON_DEFAULT_PAGES; > module_param(oom_pages, int, S_IRUSR | S_IWUSR); > MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); Doesn't this limit memory size of the guest we can report? Apparently to several gigabytes ... OTOH huge guests with lots of free memory is exactly where we would gain the most ... -- MST