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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 13D2CC43331 for ; Fri, 6 Sep 2019 15:25:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D90522178F for ; Fri, 6 Sep 2019 15:25:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bgqPFZOd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394823AbfIFPZ4 (ORCPT ); Fri, 6 Sep 2019 11:25:56 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:37653 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731738AbfIFPZz (ORCPT ); Fri, 6 Sep 2019 11:25:55 -0400 Received: by mail-io1-f67.google.com with SMTP id r4so13599839iop.4; Fri, 06 Sep 2019 08:25:55 -0700 (PDT) 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=N3FQEUSrBcDUfBeBfn5iCz+oSEqlloCS/pOKCoa2Zr0=; b=bgqPFZOdreq6PKuwjn62NrUjiulsqs09d/Gb8LjLNEs9G7HSU/RYbrcusE7+j93bbt ZNsiZhnSpiVn4xshXGTOP41Zhh95aNeL6YoFa4FzsIe4j81n7vD4tXH/11gzKEMpbsWG sODjHkkbKsQhVeBDNX0+hFtrjw8zAjfPhVHcKf0zbVkHuqfr+UUXFofddBouEiQhNFQc h5lD1fsFu5fy1FMAXTqksih7B3M/LRJrZKA8nyi2MKYfIY0EF76p3ur4BAidhBzLdOfN qMUoNboAFq7Ftys58HMDjwz72VDg0e7C72Gs5afM6ENseG/z+X5YA6JPCfMSOoUDsoE0 z0Og== 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=N3FQEUSrBcDUfBeBfn5iCz+oSEqlloCS/pOKCoa2Zr0=; b=r5L/6Mj3FWx+mx7zy6A2dZLTX2wkV3xcO2cUs7si/9Zowm+45L0QvsxXlRejzsLKFH azEEWRJDuKB4zwCtE/3lurtEZJdP61ZMXuJCNrHGje86WNEVVQtvAlA8oNc4/QwpbiYr K5IGNSeeG+WSSvp9WqytG8qyocR2GSGlZSDjstNR+bT1YIC3l+M7rAEjabCRTh7AtXoY YNI/GPxLpEQOZ6aA2jEm6ULeYyFEtPA6wKFPF9B7dTU3CyzYhjCvnhIFzSMAnAe9JMf+ 2isXLYcuT9SZCHjDCJkCkmJEXEYkjCBqFBe8gtGWFhmWNO3bexd8pKP6WXHS3wnYPJtK JqEQ== X-Gm-Message-State: APjAAAVG2p3v/lkhS1kXHRA5DNm3CiV+xgPepDXNSOGlIW9ia9g3Z+bg +s02r4r9gGiVlvtixNhZn4RZtnUq389o/Aki2ZJdcA== X-Google-Smtp-Source: APXvYqwcGzRHOiIe83l2KSz9xAxgf3rf+jrakAFe9L11I466Xd43WAGC5SKvXq6IpFJAS6PXb2pvUJF/d3rtHSR26Kw= X-Received: by 2002:a5d:8908:: with SMTP id b8mr11171098ion.237.1567783554482; Fri, 06 Sep 2019 08:25:54 -0700 (PDT) MIME-Version: 1.0 References: <20190906145213.32552.30160.stgit@localhost.localdomain> <20190906112155-mutt-send-email-mst@kernel.org> In-Reply-To: <20190906112155-mutt-send-email-mst@kernel.org> From: Alexander Duyck Date: Fri, 6 Sep 2019 08:25:43 -0700 Message-ID: Subject: Re: [PATCH v8 0/7] mm / virtio: Provide support for unused page reporting To: "Michael S. Tsirkin" Cc: Nitesh Narayan Lal , kvm list , David Hildenbrand , Dave Hansen , LKML , Matthew Wilcox , Michal Hocko , linux-mm , Andrew Morton , virtio-dev@lists.oasis-open.org, Oscar Salvador , Yang Zhang , Pankaj Gupta , Rik van Riel , Konrad Rzeszutek Wilk , lcapitulino@redhat.com, "Wang, Wei W" , Andrea Arcangeli , Paolo Bonzini , Dan Williams , Alexander Duyck 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 Fri, Sep 6, 2019 at 8:23 AM Michael S. Tsirkin wrote: > > On Fri, Sep 06, 2019 at 07:53:21AM -0700, Alexander Duyck wrote: > > This series provides an asynchronous means of reporting to a hypervisor > > that a guest page is no longer in use and can have the data associated > > with it dropped. To do this I have implemented functionality that allows > > for what I am referring to as unused page reporting > > > > The functionality for this is fairly simple. When enabled it will allocate > > statistics to track the number of reported pages in a given free area. > > When the number of free pages exceeds this value plus a high water value, > > currently 32, it will begin performing page reporting which consists of > > pulling pages off of free list and placing them into a scatter list. The > > scatterlist is then given to the page reporting device and it will perform > > the required action to make the pages "reported", in the case of > > virtio-balloon this results in the pages being madvised as MADV_DONTNEED > > and as such they are forced out of the guest. After this they are placed > > back on the free list, and an additional bit is added if they are not > > merged indicating that they are a reported buddy page instead of a > > standard buddy page. The cycle then repeats with additional non-reported > > pages being pulled until the free areas all consist of reported pages. > > > > I am leaving a number of things hard-coded such as limiting the lowest > > order processed to PAGEBLOCK_ORDER, and have left it up to the guest to > > determine what the limit is on how many pages it wants to allocate to > > process the hints. The upper limit for this is based on the size of the > > queue used to store the scattergather list. > > I queued this so this gets tested on linux-next but the mm core changes > need acks from appropriate people. Thanks. I will see what I can do to get some more mm people reviewing these changes. - Alex