Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp728837ybl; Wed, 4 Dec 2019 09:55:09 -0800 (PST) X-Google-Smtp-Source: APXvYqy6NfWVf15FdKID7lGeSaiVgVao4tOkWygaIrTCHL20KyR42l5AjjDHnyTDY18oOFOp5r44 X-Received: by 2002:aca:7583:: with SMTP id q125mr3839624oic.100.1575482108940; Wed, 04 Dec 2019 09:55:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482108; cv=none; d=google.com; s=arc-20160816; b=ZCc49PtMPomBvO5OUHOcilxJPUgCGeh0yyk1tuLuK69+sjiCst8K2pDr0K8Hi2lezR KmtoJb6NEnAGPO2JMvWlfS7LFJ9a+H2rN1zZC7YgEYf9hQiNUm1OS3kcz1nLJf8m2UBD uzh76z0LZULjERzAbysFrIrp40nh1OOmYjSrC07oIcZQSj1pvIbVu0EInWEbs/HadyQS lgZ+8IEV5UshrWW6Jl8Gb++eRikdrenpcsrp0f3WpHOFXevtxW3uoJFM8rb094InUB3Q 9jxY4J4rzhE9ykOmIwVbGJ6oSUwNgkEydW8R/5CEczLBUGifK2xLWdFGO4r0tZNUcCre olJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7Rhu4aVTP3SHJymoOSE6jn6lAKDbkxhTckaz9ubCxMc=; b=F3MOpG2K/+zkACE+I3Wsqni0QVeKnwVl13re6wjq+Rfcroi+kPNWyTElxZ1TUKzG7R f+DcgWi+4KNAAF51Gnqz+vdo4CqRFh48H2ABsFj09BxjvhloeGLJP7nOFEAVb2lMjgfm HskQQHB2syMyIP+NokBaVCVM0BGXiRBBflgukIKf3+pT24JbL7q7v32oDjg7TB+EOLWr JE5BhtsHNqXEJFoCgiGOvY2LjHT6GP4BjLcPLmCHMGpJWGuRlME4C+64uOibz+MG/ZDU E/rhTq8azdNZ91zN38tyGAR9pkaVL4psmClJgyXmILuKN/fhqWgU0HOkyUjhDfsV40EV wytg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eqtUE1no; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8si3669408oto.36.2019.12.04.09.54.56; Wed, 04 Dec 2019 09:55:08 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eqtUE1no; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728242AbfLDRyF (ORCPT + 99 others); Wed, 4 Dec 2019 12:54:05 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:34366 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727852AbfLDRyF (ORCPT ); Wed, 4 Dec 2019 12:54:05 -0500 Received: by mail-io1-f68.google.com with SMTP id z193so584289iof.1; Wed, 04 Dec 2019 09:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7Rhu4aVTP3SHJymoOSE6jn6lAKDbkxhTckaz9ubCxMc=; b=eqtUE1noyuM8BxzbDMxzyqdljYKTzHhyFZRNmOiuWMgZ7/Dr9BJ6CwwpM8gaqipYeg eZNhT3kxzMmcW6y0XsPp0JfxvYLVyKdDag+IjBXVTUmEyZfAjBOnjPPSeaqKmSDx/du7 rD00G0LPwfAnW17G3uCcucTdP61PcA4umlRWKthIIsFoZmOD5zsiELRq2GAZXI5YUrlb 2XSou9VQOQ8JxMxWYgsArcGdXoPUPg8oSJBFSNQsXbxqaQC5Eu62hl1g50owCRU7sQx3 sUPDUX/RP+p86a4V4BKSBgJxAyNOlLFiOSBnmOfwMIYVxKgwqWePihu36s741Lt/ohkO T6+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7Rhu4aVTP3SHJymoOSE6jn6lAKDbkxhTckaz9ubCxMc=; b=NjYzGl5Z6slTX2JIuF+Smgw9Iv97K3uMarvat9P/n0LOeH7OfDeNi2LvY5wHI48UZ8 JtWkWQ/5VJ338s3vf41lA769Iuf92+U4NXTyEMWJ8Es6tlKq6J3LAmSwd+BrUBVHcfJK WC6eXRt639JPLIl2L9kQ+XiGn/oSQFBxgVEkyi6QjWod8S7enL5UtPIkRDrDawyg2grj ksKKCBhNVrxVR0qkt6Tu1949ZHBcoknS/dvuPHhCAuFoOlpOB2Z+r5vsIQeQrhiDfUkb LnYgXqqteSjauhiM1AksLNEZAFIvVqQcIJywuyDFnhQo/lx2HkLsfUOpzVQ7QlIyWMoY Cc7A== X-Gm-Message-State: APjAAAWkKRedlqIpF/X7nblLkKl0aPtn8VQ16e7b16CpyIy0EjXFyLti 3+ZYCJy47zeSQJSAsfLtmI+XFfXcjmG2l4g8Hak= X-Received: by 2002:a02:7f54:: with SMTP id r81mr4224567jac.121.1575482044379; Wed, 04 Dec 2019 09:54:04 -0800 (PST) MIME-Version: 1.0 References: <20191119214454.24996.66289.stgit@localhost.localdomain> <20191119214653.24996.90695.stgit@localhost.localdomain> <65de00cf-5969-ea2e-545b-2228a4c859b0@redhat.com> <20191128115436-mutt-send-email-mst@kernel.org> In-Reply-To: <20191128115436-mutt-send-email-mst@kernel.org> From: Alexander Duyck Date: Wed, 4 Dec 2019 09:53:53 -0800 Message-ID: Subject: Re: [PATCH v14 6/6] virtio-balloon: Add support for providing unused page reports to host To: "Michael S. Tsirkin" Cc: David Hildenbrand , kvm list , LKML , Matthew Wilcox , Michal Hocko , linux-mm , Andrew Morton , Mel Gorman , Vlastimil Babka , Yang Zhang , Nitesh Narayan Lal , Konrad Rzeszutek Wilk , Pankaj Gupta , Rik van Riel , lcapitulino@redhat.com, Dave Hansen , "Wang, Wei W" , Andrea Arcangeli , Paolo Bonzini , Dan Williams , Alexander Duyck , Oscar Salvador Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 28, 2019 at 9:00 AM Michael S. Tsirkin wrote: > > On Thu, Nov 28, 2019 at 04:25:54PM +0100, David Hildenbrand wrote: > > On 19.11.19 22:46, 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. > > > > Maybe add something like "In contrast to ordinary balloon > > inflation/deflation, the guest can reuse all reported pages immediately > > after reporting has finished, without having to notify the hypervisor > > about it (e.g., VIRTIO_BALLOON_F_MUST_TELL_HOST does not apply)." > > Maybe we can make apply. The effect of reporting a page is effectively > putting it in a balloon then immediately taking it out. Maybe without > VIRTIO_BALLOON_F_MUST_TELL_HOST the pages can be reused before host > marked buffers used? > > We didn't teach existing page hinting to behave like this, but maybe we > should, and maybe it's not too late, not a long time passed > since it was merged, and the whole shrinker based thing > seems to have been broken ... The problem is the existing hinting implementation relies on pushing the memory to the point of OOM in order to avoid having to re-hint on pages. What it is looking for is a snapshot rather than a running tally. The page reporting bit approach would only work for the first migration. The problem is the bit is persistent and would leave unused pages flagged as reported if another migration starts so it wouldn't re-report those pages. > BTW generally UAPI patches will have to be sent to virtio-dev > mailing list before they are merged. Do you need just the QEMU patches submitted to virtio-dev or both the virtio kernel patches and the QEMU patches? One piece of feedback I got was that it was annoying that I was including virtio-dev since it requires a subscription to send to it. If you would like I could apply it on the QEMU patches which would make the changes more visible at least. Thanks. - Alex