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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 AA0CFC3A5A2 for ; Tue, 10 Sep 2019 12:23:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E6C120872 for ; Tue, 10 Sep 2019 12:23:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QtgdoHdW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E6C120872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=529joCAMBpRPZ6KVW+eIDkm6s1YnHSZp9+A6yWk3JLU=; b=QtgdoHdWtxyX6T j+l3ZE2au1bIyrJ0QAcBYO0Aq5cBjfJRsl/W/svp2rQFo2Tp+a1aAtSGqO4B6uuh7Xx03qF2ApzUJ 9jkl7ewhUfsgRh19FlhG+uGJ4Jgq1B3C7za+udPGHKgw8Zt+GN3J7mL3BvrdGU1JGBnH2pjQrl4LW OgZLl2hn62XkS1VO0QEaqkglrOk/2QHWtskg8wTZYIxB31Xptv9H/XjkzJ+1MFq6qRpxnQmLA+KQV ylM7WRpeqQOdIo98T0bodn2OyYgnt0NKewBgzXg8uwrWgZ7ZIfCk3zOJRrP5MXXwRnKNF49NRJNpm QQK+FMUHuOblYH/jcxbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i7fB1-0004NB-Qd; Tue, 10 Sep 2019 12:23:19 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i7fAy-0004Mh-2m for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2019 12:23:17 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9A3ACB68B; Tue, 10 Sep 2019 12:23:14 +0000 (UTC) Date: Tue, 10 Sep 2019 14:23:13 +0200 From: Michal Hocko To: Alexander Duyck Subject: Re: [PATCH v9 3/8] mm: Move set/get_pcppage_migratetype to mmzone.h Message-ID: <20190910122313.GW2063@dhcp22.suse.cz> References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190907172528.10910.37051.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190907172528.10910.37051.stgit@localhost.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190910_052316_410059_9AB9FD28 X-CRM114-Status: GOOD ( 22.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.zhang.wz@gmail.com, pagupta@redhat.com, kvm@vger.kernel.org, david@redhat.com, catalin.marinas@arm.com, lcapitulino@redhat.com, linux-mm@kvack.org, alexander.h.duyck@linux.intel.com, will@kernel.org, aarcange@redhat.com, virtio-dev@lists.oasis-open.org, mst@redhat.com, willy@infradead.org, wei.w.wang@intel.com, ying.huang@intel.com, riel@surriel.com, konrad.wilk@oracle.com, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org, osalvador@suse.de, nitesh@redhat.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, pbonzini@redhat.com, akpm@linux-foundation.org, fengguang.wu@intel.com, kirill.shutemov@linux.intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. > Reviewed-by: Dan Williams > Signed-off-by: Alexander Duyck > --- > mm/internal.h | 18 ++++++++++++++++++ > mm/page_alloc.c | 18 ------------------ > 2 files changed, 18 insertions(+), 18 deletions(-) > > diff --git a/mm/internal.h b/mm/internal.h > index 0d5f720c75ab..e4a1a57bbd40 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -549,6 +549,24 @@ static inline bool is_migrate_highatomic_page(struct page *page) > return get_pageblock_migratetype(page) == MIGRATE_HIGHATOMIC; > } > > +/* > + * A cached value of the page's pageblock's migratetype, used when the page is > + * put on a pcplist. Used to avoid the pageblock migratetype lookup when > + * freeing from pcplists in most cases, at the cost of possibly becoming stale. > + * Also the migratetype set in the page does not necessarily match the pcplist > + * index, e.g. page might have MIGRATE_CMA set but be on a pcplist with any > + * other index - this ensures that it will be put on the correct CMA freelist. > + */ > +static inline int get_pcppage_migratetype(struct page *page) > +{ > + return page->index; > +} > + > +static inline void set_pcppage_migratetype(struct page *page, int migratetype) > +{ > + page->index = migratetype; > +} > + > void setup_zone_pageset(struct zone *zone); > extern struct page *alloc_new_node_page(struct page *page, unsigned long node); > #endif /* __MM_INTERNAL_H */ > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 4e4356ba66c7..a791f2baeeeb 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -185,24 +185,6 @@ static int __init early_init_on_free(char *buf) > } > early_param("init_on_free", early_init_on_free); > > -/* > - * A cached value of the page's pageblock's migratetype, used when the page is > - * put on a pcplist. Used to avoid the pageblock migratetype lookup when > - * freeing from pcplists in most cases, at the cost of possibly becoming stale. > - * Also the migratetype set in the page does not necessarily match the pcplist > - * index, e.g. page might have MIGRATE_CMA set but be on a pcplist with any > - * other index - this ensures that it will be put on the correct CMA freelist. > - */ > -static inline int get_pcppage_migratetype(struct page *page) > -{ > - return page->index; > -} > - > -static inline void set_pcppage_migratetype(struct page *page, int migratetype) > -{ > - page->index = migratetype; > -} > - > #ifdef CONFIG_PM_SLEEP > /* > * The following functions are used by the suspend/hibernate code to temporarily -- Michal Hocko SUSE Labs _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel