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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable 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 EA566C10F14 for ; Tue, 9 Apr 2019 02:44:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFD3F21473 for ; Tue, 9 Apr 2019 02:44:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727159AbfDICoc (ORCPT ); Mon, 8 Apr 2019 22:44:32 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:36061 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbfDICob (ORCPT ); Mon, 8 Apr 2019 22:44:31 -0400 Received: by mail-qt1-f196.google.com with SMTP id s15so9707646qtn.3 for ; Mon, 08 Apr 2019 19:44:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=GWVLGd3rRWNvU7sP85NRp5wt10btcwDSd57p3ueaPIg=; b=ef8wNVFWmLC7PtODO44Ya7szGm2e6QIaB/wWB9vBhOBZ5w4rckv4jCIC1ExYE7Ko92 IV8v1Tk5byTUMy+8Xd8OT3Vkr7fpRlydPEKrKeC4IcB/hqZwQq4he773jvEFXTGjglv/ afqe+tvNCLFDg3tparlz9BKToKhkkVZZ1sxRsWvlULwg2qAwC2OyHOYnHCQ6xiPElxyr fGkQ1ThUdilIpSFV4bz84jEOdWi1J4jyvk8Z9aed0H3ajzlOWVbRD/Ez7w6C6IpmJzHz 6eaMZAiRsq5JCop5ceZ1m/Q0hRu5JKRq5BAvSe8XgU4/iKDxJPLdM70cvF/rkKSnnDwj K7OQ== X-Gm-Message-State: APjAAAVLjYqD+PQz6PjN+wYvyXGClCerQE45jQ1MhjS2DFXfOw8it4Wc 6ewuxe3Zwxgpz95ZT99kOVQ0xg== X-Google-Smtp-Source: APXvYqyA+PmYoJsgVkbSjy9sMazqV1hbg1cOyBmP6u5iAlIm/HSoNFnjKe4pAk1znbUJVzee8rnXlw== X-Received: by 2002:ac8:184b:: with SMTP id n11mr28387822qtk.210.1554777868868; Mon, 08 Apr 2019 19:44:28 -0700 (PDT) Received: from redhat.com (pool-173-76-246-42.bstnma.fios.verizon.net. [173.76.246.42]) by smtp.gmail.com with ESMTPSA id n188sm17572320qkb.40.2019.04.08.19.44.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Apr 2019 19:44:27 -0700 (PDT) Date: Mon, 8 Apr 2019 22:44:25 -0400 From: "Michael S. Tsirkin" To: Alexander Duyck Cc: David Hildenbrand , Nitesh Narayan Lal , kvm list , LKML , linux-mm , Paolo Bonzini , lcapitulino@redhat.com, pagupta@redhat.com, wei.w.wang@intel.com, Yang Zhang , Rik van Riel , dodgen@google.com, Konrad Rzeszutek Wilk , dhildenb@redhat.com, Andrea Arcangeli Subject: Re: Thoughts on simple scanner approach for free page hinting Message-ID: <20190408203541-mutt-send-email-mst@kernel.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Apr 05, 2019 at 05:09:45PM -0700, Alexander Duyck wrote: > In addition we will need some way to identify which pages have been > hinted on and which have not. The way I believe easiest to do this > would be to overload the PageType value so that we could essentially > have two values for "Buddy" pages. We would have our standard "Buddy" > pages, and "Buddy" pages that also have the "Offline" value set in the > PageType field. Tracking the Online vs Offline pages this way would > actually allow us to do this with almost no overhead as the mapcount > value is already being reset to clear the "Buddy" flag so adding a > "Offline" flag to this clearing should come at no additional cost. It bothers me a bit that this doesn't scale to multiple hint types if we ever need them. Would it be better to have two free lists: hinted and non-hinted one? -- MST