From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B3D1C00454 for ; Fri, 13 Dec 2019 21:11:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CF77D246A9 for ; Fri, 13 Dec 2019 21:11:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF77D246A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C1B218E000C; Fri, 13 Dec 2019 11:37:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BCC3B8E0001; Fri, 13 Dec 2019 11:37:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B088E8E000C; Fri, 13 Dec 2019 11:37:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0173.hostedemail.com [216.40.44.173]) by kanga.kvack.org (Postfix) with ESMTP id 964718E0001 for ; Fri, 13 Dec 2019 11:37:04 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id EFD03824999B for ; Fri, 13 Dec 2019 16:37:03 +0000 (UTC) X-FDA: 76260672726.26.frog33_36598280a420 X-HE-Tag: frog33_36598280a420 X-Filterd-Recvd-Size: 4361 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Fri, 13 Dec 2019 16:37:03 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2019 08:37:01 -0800 X-IronPort-AV: E=Sophos;i="5.69,309,1571727600"; d="scan'208";a="216480091" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2019 08:37:01 -0800 Message-ID: Subject: Re: [PATCH v15 6/7] virtio-balloon: Add support for providing free page reports to host From: Alexander Duyck To: David Hildenbrand , Alexander Duyck , kvm@vger.kernel.org, mst@redhat.com, linux-kernel@vger.kernel.org, willy@infradead.org, mhocko@kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, mgorman@techsingularity.net, vbabka@suse.cz Cc: yang.zhang.wz@gmail.com, nitesh@redhat.com, konrad.wilk@oracle.com, pagupta@redhat.com, riel@surriel.com, lcapitulino@redhat.com, dave.hansen@intel.com, wei.w.wang@intel.com, aarcange@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, osalvador@suse.de Date: Fri, 13 Dec 2019 08:37:01 -0800 In-Reply-To: References: <20191205161928.19548.41654.stgit@localhost.localdomain> <20191205162255.19548.63866.stgit@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 2019-12-13 at 11:15 +0100, David Hildenbrand wrote: > On 05.12.19 17:22, Alexander Duyck wrote: > > From: Alexander Duyck > > > > Add support for the page reporting feature provided by virtio-balloon. > > Reporting differs from the regular balloon functionality in that is is > > much less durable than a standard memory balloon. Instead of creating a > > list of pages that cannot be accessed the pages are only inaccessible > > while they are being indicated to the virtio interface. Once the > > interface has acknowledged them they are placed back into their respective > > free lists and are once again accessible by the guest system. > > > > Unlike a standard balloon we don't inflate and deflate the pages. Instead > > we perform the reporting, and once the reporting is completed it is > > assumed that the page has been dropped from the guest and will be faulted > > back in the next time the page is accessed. > > > > For this reason when I had originally introduced the patch set I referred > > to this behavior as a "bubble" instead of a "balloon" since the duration > > is short lived, and when the page is touched the "bubble" is popped and > > the page is faulted back in. > > While an interesting read, I would drop that comment as it isn't really > of value for the code/codebase itself. Okay, I can drop the comment. > [...] > > > + > > + vb->pr_dev_info.report = virtballoon_free_page_report; > > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING)) { > > + unsigned int capacity; > > + > > + capacity = virtqueue_get_vring_size(vb->reporting_vq); > > + if (capacity < PAGE_REPORTING_CAPACITY) { > > + err = -ENOSPC; > > + goto out_unregister_shrinker; > > It's somewhat strange to fail loading the balloon completely here. > Wouldn't it be better to print e.g. a warning but continue without free > page reporting? > > (I guess splitting up the list can be done in an addon patch if ever > really needed for virtio-balloon) That was kind of my thought. Odds are it probably is unlikely to come up. At least with the code I have now I think the virtqueue size is something like 128 and the capacity is only 32 as I wanted to limit the number of pages that were being reported at the time. > Apart from that > > Reviewed-by: David Hildenbrand > > Thanks! > Thanks for the review. - Alex