Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6009500ybe; Tue, 10 Sep 2019 12:06:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2eK0r7XzZ5pdVZA4I2UOBMTyzCMDHg8PBRGVseyfLqKxWkUKvo4bPbce2c9belX5OZ9qh X-Received: by 2002:a05:6000:152:: with SMTP id r18mr18444870wrx.153.1568142366023; Tue, 10 Sep 2019 12:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568142366; cv=none; d=google.com; s=arc-20160816; b=t7PWbU5dsuKNMn31SOGKDV5hBeSmI3gd5mIm1U6PtClOaH6IqXAWuDdmqI+b5tEn9K 5IpeWpWdbrpLmorCLj9c3oQTgFNwcP0hnfXwd1+MjRKN80YRKrf8LEuopt4yF/r8M2hR 24Dl2HklwB7f6l6msLL3yDBSdcg8MOVRFIeUCiZ3r1zcE8OzH/Lubvcn0GUFasSUGqZV XYM+eKiOLw8u0Qq1CWHi6nSvBk9umm53JLW5OSUqr5+HBbj02rKtNphacGlGGYVXdTf8 qTsLntVUccE7woJWqndoH1IPkzmGvU3w2RbnEaIcQ377FQsPY/3wj0uO5lrCnjBnonX+ OojA== 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=83TThgQAjkQ0ae/WfN2rozL6NZ6sFqo/tzTJieGwWhY=; b=TQ7PZmZlbeZaadyHQLvUFs54NqezP+1KLpWi8fmWg74dp+N+pnJwJJ8+OnCpfgFvf/ g0s05FHwlNhU4YfNkU4fADYqhdZgi0rX6Ky27+Tw9v6XtBadRN/40vGnMhzgGLkzWuGR prfMqGNQT47Y5JjW8TtdegkoZMVch9u+hbJZynr5v0PHvFwYpyhGiTVJRn3cdNqjz89h D4i84XWzZBcs0cmBRlDJ6asK5bq5wOkP3mqyqOL5+3OVK78ru1ZdRanY15YTkQcslTAw XSlhzC4AC08k9/sL/vAb2S2c/5OO9f8aXsP52iEnJI/atXmK48XvOxaBCLDASHzQ/g+X AcJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bctqj0dI; 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 y54si12553253edb.217.2019.09.10.12.05.42; Tue, 10 Sep 2019 12:06:06 -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=bctqj0dI; 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 S2405440AbfIJOrE (ORCPT + 99 others); Tue, 10 Sep 2019 10:47:04 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:33653 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405395AbfIJOrC (ORCPT ); Tue, 10 Sep 2019 10:47:02 -0400 Received: by mail-io1-f68.google.com with SMTP id m11so38140099ioo.0; Tue, 10 Sep 2019 07:47:01 -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=83TThgQAjkQ0ae/WfN2rozL6NZ6sFqo/tzTJieGwWhY=; b=bctqj0dIEQG02DidTblEEKKmlRq95iuCrJbWTEZEFy6f4ldmknD9AC82Hjp7WtIcUL wdtgqANYPFpfuqN9RWFoV81S+TL4TZWcW/eRB1zbwCnI4axFiqpnKB/4F9Vb1ASsBmwM MoGeD5V7oPXNrI0TLfR8qwBLS/a5rmpBqaVS40yQVLdcqID59aFUJKp3thzSPP4Ym5fo oUxnlGZ+RikUHkghsxU4t9MUOUJM1V923cataTV37iHuaUS8taTW2ilbXf8zuGBL2rrr GFcYtmHJkRVPpjaQYbMNqFd6Z6x57kRfzb33fCPJ6liqZh8sZLRJMVMsx0Mc0ssKXqB7 m1dA== 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=83TThgQAjkQ0ae/WfN2rozL6NZ6sFqo/tzTJieGwWhY=; b=W9N7gezhQNg1WG4oLf0K+lRaR7fEVZLBCpgY6d7YqL7EIUxwwd5lF+yRrnldvMTA6i XaS/bfqnVmrB85wRDp9NRmCrEtT7WuNy0e5vyb0G8eWkkwUgIV5E6TlxnDMRWBaK4XOv pgOmkyAaoudtzyp2v6rXn81jpTS1vNue8vtPwL4JvaICatc5WbsWlgZ+WUogQG6NI2Cl aWf4AfbJ52AVTTKqdFKK6eMJxiqdSGyn4Y8n0e0dMNfCiM+A5P+Xl2W4ZfXHNWyT6H/J unjia/KY650Km/BSdiA0ShdB9J3Sqsugy2NDAwXR6LgM5ti++sgy0ef9dMKGpN2ba4q2 yj0Q== X-Gm-Message-State: APjAAAV3mDU/E7CQnDy/X6dpky4LggsUGMCV29Vir2KS+0cNn1ORT2+y 0iMtS4vSfO+BioA6pX29mZ/tNQpOaK2BovOgkjg= X-Received: by 2002:a5d:8f86:: with SMTP id l6mr20769278iol.270.1568126821359; Tue, 10 Sep 2019 07:47:01 -0700 (PDT) MIME-Version: 1.0 References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190907172528.10910.37051.stgit@localhost.localdomain> <20190910122313.GW2063@dhcp22.suse.cz> In-Reply-To: <20190910122313.GW2063@dhcp22.suse.cz> From: Alexander Duyck Date: Tue, 10 Sep 2019 07:46:50 -0700 Message-ID: Subject: Re: [PATCH v9 3/8] mm: Move set/get_pcppage_migratetype to mmzone.h To: Michal Hocko Cc: virtio-dev@lists.oasis-open.org, kvm list , "Michael S. Tsirkin" , Catalin Marinas , David Hildenbrand , Dave Hansen , LKML , Matthew Wilcox , linux-mm , Andrew Morton , will@kernel.org, linux-arm-kernel@lists.infradead.org, Oscar Salvador , Yang Zhang , Pankaj Gupta , Konrad Rzeszutek Wilk , Nitesh Narayan Lal , Rik van Riel , lcapitulino@redhat.com, "Wang, Wei W" , Andrea Arcangeli , ying.huang@intel.com, Paolo Bonzini , Dan Williams , Fengguang Wu , Alexander Duyck , "Kirill A. Shutemov" 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 Tue, Sep 10, 2019 at 5:23 AM Michal Hocko wrote: > > On Sat 07-09-19 10:25:28, Alexander Duyck wrote: > > From: Alexander Duyck > > > > In order to support page reporting it will be necessary to store and > > retrieve the migratetype of a page. To enable that I am moving the set and > > get operations for pcppage_migratetype into the mm/internal.h header so > > that they can be used outside of the page_alloc.c file. > > Please describe who is the user and why does it needs this interface. > This is really important because migratetype is an MM internal thing and > external users shouldn't really care about it at all. We really do not > want a random code to call those, especially the set_pcppage_migratetype. I was using it to store the migratetype of the page so that I could find the boundary list that contained the reported page as the array is indexed based on page order and migratetype. However on further discussion I am thinking I may just use page->index directly to index into the boundary array. Doing that I should be able to get a very slight improvement in lookup time since I am not having to pull order and migratetype and then compute the index based on that. In addition it becomes much more clear as to what is going on, and if needed I could add debug checks to verify the page is "Reported" and that the "Buddy" page type is set.