Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11173511ybi; Thu, 25 Jul 2019 11:14:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyG2s9akHiL2YVrXb3x5umoVMJ61jQTYFDnlqFYycN6B5RrJKwEyGtHWw0AcktsHiaYPSsp X-Received: by 2002:a17:90a:2525:: with SMTP id j34mr96625370pje.11.1564078493693; Thu, 25 Jul 2019 11:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564078493; cv=none; d=google.com; s=arc-20160816; b=Tid+PDVmWcSgByrHL04EAYLiyo5bWIIxNdit9kb+6AvpkpQgPCAs38oqBzXgzr0sIV 9kTE5L6GH76E0ZzbOBFjnGgAv6phGw2+nOudsXfv3A4JuVbO8y5ZK4AP5Q+VQf91vBx2 jOsmqsc96Cmgi6PRhsesVApUkVu6hEBxEgdasfpBIZSVI3EJFVcPQ7amAlgJUbHUG81B LMVmBv/do3DE2zZDoIHXxmuf+hMBYqtMgKaQahdSbADbXR7YR8XAMr3o2Z6f26u2gPA+ 5Fy7CUr8S+1OHAvChZO2IHu6pa2WxdeekzQ/BxNiKh+qMI32Mwfnd2eUtStrHAA3ACf3 kwcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=woJeegttPhl/BrIdINSAcvtDPD0ZMfAjhY6NEqJcXMA=; b=SeoOaMUjo/4p7Vka96uWYDeN6+eR2+EDWb6TN5z8ONqbhdDBUbBVwUePWYjoCYH39I 2EkEdy4RwiumAAtzSz1xoZ54gMJp8+vcgwbt68R9Bb6zaOqPoDyOvkgiFZGoajZhFkbs c7huo1AL0rztmXN2Me9QM8/h0wxgHZUhavmLf1ac7+8rpmIuaQIUv/SgNXoiIvLWkM4R FT5UAtu1CGGKXLXCbu6oC6kl46VQeXuWc245CQrCb3aTyZ4ciijCDPLkN/LXztVCYCCD YGltqRy36kxzKaUX0Ez6TQM/dxnphSfNCqAaS1v+YDGQ7gBac5cEX2silLOuVTbxmhth XSZA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si15562212pjp.71.2019.07.25.11.14.38; Thu, 25 Jul 2019 11:14:53 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729954AbfGYRjv (ORCPT + 99 others); Thu, 25 Jul 2019 13:39:51 -0400 Received: from mga14.intel.com ([192.55.52.115]:57638 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbfGYRjv (ORCPT ); Thu, 25 Jul 2019 13:39:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 10:38:50 -0700 X-IronPort-AV: E=Sophos;i="5.64,307,1559545200"; d="scan'208";a="164251652" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 10:38:49 -0700 Message-ID: Subject: Re: [PATCH v2 4/5] mm: Introduce Hinted pages From: Alexander Duyck To: David Hildenbrand , Alexander Duyck Cc: Nitesh Narayan Lal , kvm list , "Michael S. Tsirkin" , Dave Hansen , LKML , linux-mm , Andrew Morton , Yang Zhang , pagupta@redhat.com, Rik van Riel , Konrad Rzeszutek Wilk , lcapitulino@redhat.com, wei.w.wang@intel.com, Andrea Arcangeli , Paolo Bonzini , dan.j.williams@intel.com, Matthew Wilcox Date: Thu, 25 Jul 2019 10:38:49 -0700 In-Reply-To: References: <20190724165158.6685.87228.stgit@localhost.localdomain> <20190724170259.6685.18028.stgit@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-07-25 at 18:48 +0200, David Hildenbrand wrote: > On 25.07.19 17:59, Alexander Duyck wrote: > > On Thu, Jul 25, 2019 at 1:53 AM David Hildenbrand wrote: > > > On 24.07.19 19:03, Alexander Duyck wrote: > > > > From: Alexander Duyck > > > > > Can't we reuse one of the traditional page flags for that, not used > > > along with buddy pages? E.g., PG_dirty: Pages that were not hinted yet > > > are dirty. > > > > Reusing something like the dirty bit would just be confusing in my > > opinion. In addition it looks like Xen has also re-purposed PG_dirty > > already for another purpose. > > You brought up waste page management. A dirty bit for unprocessed pages > fits perfectly in this context. Regarding XEN, as long as it's not used > along with buddy pages, no issue. I would rather not have to dirty all pages that aren't hinted. That starts to get too invasive. Ideally we only modify pages if we are hinting on them. That is why I said I didn't like the use of a dirty bit. What we want is more of a "guaranteed clean" bit. > FWIW, I don't even thing PG_offline matches to what you are using it > here for. The pages are not logically offline. They were simply buddy > pages that were hinted. (I'd even prefer a separate page type for that > instead - if we cannot simply reuse one of the other flags) > > "Offline pages" that are not actually offline in the context of the > buddy is way more confusing. Right now offline and hinted are essentially the same thing since the effect is identical. There may be cases in the future where that is not the case, but with the current patch set they both result in the pages being evicted from the guest. > > If anything I could probably look at seeing if the PG_private flags > > are available when a page is in the buddy allocator which I suspect > > they probably are since the only users I currently see appear to be > > SLOB and compound pages. Either that or maybe something like PG_head > > might make sense since once we start allocating them we are popping > > the head off of the boundary list. > > Would also be fine with me. Actually I may have found an even better bit if we are going with the "reporting" name. I could probably use "PG_uptodate" since it looks like most of its uses are related to filesystems. I will wait till I hear from Matthew on what bits would be available for use before I update things.