Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11164484ybi; Thu, 25 Jul 2019 11:06:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZZzFd7h1eFUYUMSNC0El7+KmDeajJDMVREIG3XQ5U3gySL9itvaUiJMKyHIZqSzL2eGja X-Received: by 2002:a63:1d2:: with SMTP id 201mr52921973pgb.307.1564077978795; Thu, 25 Jul 2019 11:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564077978; cv=none; d=google.com; s=arc-20160816; b=l6fp31AIrqVbVyqX3pDDeyGV0LaZpiUYCp82jlXEroFNgoTabbetNluGR+cqRtAawG B6kIGsNQaJb9ESdk9YvviEx/OA8XHEyiVyBybHmx/WU5/j8wm1Mx+vgA2ggRpbysuOxZ LrOV2ypiPQO6O+/C5eQe+uBdjDhcoNTIJvO6UtTot9FxPWxxLsrwwseKvFYkkJoT/TxX O7zcwDEXZ/2udH3PzC93qAytWgSXUguAGuuIBpsmoQhNcQ0RqowtsyXUY4ip0eM1/zwW L2ZJuL1uQldBlVduMx+LR8vGyvYvQPF6vX4PC/oR4etN09sEl9HyHCyWND5zFqGMrEvw 8ugA== 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=qK60BCTTRu0Ys+kw65S0SEpX7dQ3Yakjf+W+ppKoJMM=; b=i4cJ+9g7gkiZ4bLhxOTr5/mLwLS9uAM1YFmAYZBnPCH8iGvt3aCoBhF/x1sdN7vJ8W RhnUvUXGkJ08C2QvqpIaUoMFawtZGIg+6ovxcxN8vwAKTO8c7nVHiTm62/S05m5739k3 CTqfgPexPQYPmhvbMfrO+QoOClWxgzJeMkmHelSMxUik37jpB0sAgomBQAl+Yc4wglao z2xoY8O2OZa2HOop1pBpJKY2VHsyKtGSqr4V6ZJgPxrSELvOZEkO4604fmQgUGJopnBS VgH8O31K8bgqeJU1L+hxXqJhUVNAqnw7Go5xgkR1AwAO4H2kj2dGiDAYOM5qGPpzbxMI HK1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oqCfu2vZ; 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 g5si15562212pjp.71.2019.07.25.11.06.04; Thu, 25 Jul 2019 11:06:18 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oqCfu2vZ; 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 S2389683AbfGYP7a (ORCPT + 99 others); Thu, 25 Jul 2019 11:59:30 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:45093 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389660AbfGYP73 (ORCPT ); Thu, 25 Jul 2019 11:59:29 -0400 Received: by mail-io1-f65.google.com with SMTP id g20so98292318ioc.12; Thu, 25 Jul 2019 08:59:29 -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=qK60BCTTRu0Ys+kw65S0SEpX7dQ3Yakjf+W+ppKoJMM=; b=oqCfu2vZEmKMr8jRkoBDSP/46uQ6yqxt8toi+TVwd67qyXZK0EBxRVYSpECs1dwMez IcJIExjgCycm93oaDl70T2DnEn7kMwO14tnS8UtAuIfAxD0Ln5ChwW4wMj7sr+cqrW43 yqY55w0i6b+GOWyP7gKwmC458qQHUeDS97+wQoA3lDOdm/pWF1L93CK72iojAHynec/9 USk3f/L5BqSWz3PuRVIgj6ptLf1A1c1Acf4Il4Li+zceMw4N8A0Ba+Y37CdXImGl4IQJ ZI5OmwkoV2oZAFYErftwgUqwAR1e1gcfGZxglhUJGt6g/ZSQJdEo/2T29phDR2gqyXky nXCA== 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=qK60BCTTRu0Ys+kw65S0SEpX7dQ3Yakjf+W+ppKoJMM=; b=J6uHgrbQLFbuEKGkO+w5vjWgPPDyj0W3U4ZfPvwq7FgqQyuCSPB86MzYOxDslX1goj 9BxOD99r2s0SGFyackYtCxSS7sF6QhNwPjZOqvECOs1hxVXTIoP5FD2Nw1jUduTiHxkM w5a4y4VBONMRrPg1C/os1NW6dsimQtMuMIIBSYTVxYA/YE8J8DiSwv12pprArw9QWH7L kY81nPIhk+6VYef1NxFtoXlTfoRdYe4dQvdLwq+4FfsE2Hpcn2/VzIKtxt4ueFyvtS9y eUY0rLxrHwR/+uNPN0SQl9hUDXIMSRCJs2ZKjHQ6NT5x5FvePMTOAvn7qVfyydoNvL9W ogyA== X-Gm-Message-State: APjAAAWs01ddsLYEeIXV7kQnyQY2hYFjmbeqeX9q0bM6IyRLnpcdY1sE R04Zy4Kyn16LORLPLAyJCA6wK7tAHiFBPzIuAAU= X-Received: by 2002:a5e:8c11:: with SMTP id n17mr15281210ioj.64.1564070368966; Thu, 25 Jul 2019 08:59:28 -0700 (PDT) MIME-Version: 1.0 References: <20190724165158.6685.87228.stgit@localhost.localdomain> <20190724170259.6685.18028.stgit@localhost.localdomain> In-Reply-To: From: Alexander Duyck Date: Thu, 25 Jul 2019 08:59:17 -0700 Message-ID: Subject: Re: [PATCH v2 4/5] mm: Introduce Hinted pages To: David Hildenbrand 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 , 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 Thu, Jul 25, 2019 at 1:53 AM David Hildenbrand wrote: > > On 24.07.19 19:03, Alexander Duyck wrote: > > From: Alexander Duyck > > /* > > + * PageHinted() is an alias for Offline, however it is not meant to be an > > + * exclusive value. It should be combined with PageBuddy() when seen as it > > + * is meant to indicate that the page has been scrubbed while waiting in > > + * the buddy system. > > + */ > > +PAGE_TYPE_OPS(Hinted, offline) > > > CCing Matthew > > I am still not sure if I like the idea of having two page types at a time. > > 1. Once we run out of page type bits (which can happen easily looking at > it getting more and more user - e.g., maybe for vmmap pages soon), we > might want to convert again back to a value-based, not bit-based type > detection. This will certainly make this switch harder. Shouldn't we wait to cross that bridge until we get there? It wouldn't take much to look at either defining the buddy as 2 types for such a case, or if needed we could then look at the option of moving over to another bit. > 2. It will complicate the kexec/kdump handling. I assume it can be fixed > some way - e.g., making the elf interface aware of the exact notion of > page type bits compared to mapcount values we have right now (e.g., > PAGE_BUDDY_MAPCOUNT_VALUE). Not addressed in this series yet. It does, but not by much. We were already exposing both the buddy and offline values. The cahnge could probably be in the executable that are accessing the interface to allow the combination of buddy and offline. That is one of the advantages of using the "offline" value to also mean hinted since then "hinted" is just a combination of the two known values. > 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. 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.