Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp613050ybz; Fri, 1 May 2020 05:29:19 -0700 (PDT) X-Google-Smtp-Source: APiQypLBwJ/0aJk63G8XYDKbRzrOCXZTvLaJ1QDtUyQBCffq700uzwODZB+XHZu5Z1QEUBngyEdT X-Received: by 2002:a17:906:74c:: with SMTP id z12mr2961364ejb.87.1588336159052; Fri, 01 May 2020 05:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588336159; cv=none; d=google.com; s=arc-20160816; b=NlEAT0ZDDKVA3+CXEIi38PhokjTbqBsmwFia67OX1QPLOvEwC/zJLLwOp3NokFWgUi bvUP0l91Gm7Z/AuF/WS2qZGOSjM3kTJuhKaWh8PNH72i+GdCh5aV8MGVKD/I6GYgy3WK DtDPOWSxdoOApqZezf4DamQw/sVF1FU8XHA0+ikt+vnRv54o5CTwg661E6ugHFNtUJcF UhG7bGHPdeuT6cuYmBqFZmBgmWXs2fpNvnP8454CQ0dfAPmWVXjVhr2F36KKK0L9Fidl JpkMrzKLz1K7/JMGtax6yWDT+AjC/cJU7OP+yPfvfTn3rWp9seyAEa8AeS2M8oHkA+xR uUng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yeu2kLlQ23lsZ803EULEomW60F2CDNhWySXXznjx8dw=; b=IcVweRlXZtfkjpscxJcaV8vUHJGpLvg8jRvM0hvEW8K1BV6V+lvqwdEdRclEYWi9RR QGIhXflltPUY4U4NjmZ1hj0ExDCnc3XhM89l0PiHEN96AXOQlaQJVJSTKjG0BfNfDTa5 R6Hwn81MA/3fzFMUeKpxhgBAUFB9J2zPjBpJwI6XNh3DrgoECt5fFxL4ZrfY7xWX2l1Y Mf5M6BMDqbYixaLdxLmFiaPo50zvLUv/OzgtshigMrFuE0wLgptW/jEHZxUkmvkNR5x0 UXtzIV6dGFCG6wr2zor0B+Ju8aBkM1O+wrGB7O378BdmMW3yph5e6ENHmzjoJdI5q5WN 7L1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dji+CYTL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si1604354edi.315.2020.05.01.05.28.55; Fri, 01 May 2020 05:29:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dji+CYTL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728715AbgEAM05 (ORCPT + 99 others); Fri, 1 May 2020 08:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726131AbgEAM05 (ORCPT ); Fri, 1 May 2020 08:26:57 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DEC1C061A0C for ; Fri, 1 May 2020 05:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yeu2kLlQ23lsZ803EULEomW60F2CDNhWySXXznjx8dw=; b=dji+CYTLHiO5SZ320pGZsMsiuT rz6JBvg9mvXchDKcC4UVqZKvXom+zfd6GBahELnYAG5eLakruJMGiwNgVclv/oPT152cddi254sXr lQa1vmUJqWvvX73PKr4AMjsdvBxwcBw+gTFAslKWR0c2+Wjd0bQ7RJYtjgRD+fvUr2tVMq8mWCbIa HiB7ZNlKzGAHO/WynUu0K5GwBE2vLrgXd6hAJcgYQPzObZiCuBD2i1kjXLRDuditkFy2xyAdnWYmU 9aedb2pieBhH3zCH+Glms41At1qQ0oot4O1RAaXHwJS+96bBk6rFsP8AguFz6gM+CozCbP2fp7XAD iPXFnWDA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUUkp-0003rt-MB; Fri, 01 May 2020 12:26:55 +0000 Date: Fri, 1 May 2020 05:26:55 -0700 From: Christoph Hellwig To: js1304@gmail.com Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vlastimil Babka , Laura Abbott , "Aneesh Kumar K . V" , Mel Gorman , Michal Hocko , Johannes Weiner , Roman Gushchin , Minchan Kim , Rik van Riel , Christian Koenig , Huang Rui , Eric Biederman , "Rafael J . Wysocki" , Pavel Machek , kernel-team@lge.com, Christoph Hellwig , Joonsoo Kim Subject: Re: [PATCH v2 06/10] mm/hugetlb: separate PageHighMem() and PageHighMemZone() use case Message-ID: <20200501122655.GC21897@infradead.org> References: <1588130803-20527-1-git-send-email-iamjoonsoo.kim@lge.com> <1588130803-20527-7-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1588130803-20527-7-git-send-email-iamjoonsoo.kim@lge.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 12:26:39PM +0900, js1304@gmail.com wrote: > From: Joonsoo Kim > > Until now, PageHighMem() is used for two different cases. One is to check > if there is a direct mapping for this page or not. The other is to check > the zone of this page, that is, weather it is the highmem type zone or not. > > Now, we have separate functions, PageHighMem() and PageHighMemZone() for > each cases. Use appropriate one. > > Note that there are some rules to determine the proper macro. > > 1. If PageHighMem() is called for checking if the direct mapping exists > or not, use PageHighMem(). > 2. If PageHighMem() is used to predict the previous gfp_flags for > this page, use PageHighMemZone(). The zone of the page is related to > the gfp_flags. > 3. If purpose of calling PageHighMem() is to count highmem page and > to interact with the system by using this count, use PageHighMemZone(). > This counter is usually used to calculate the available memory for an > kernel allocation and pages on the highmem zone cannot be available > for an kernel allocation. > 4. Otherwise, use PageHighMemZone(). It's safe since it's implementation > is just copy of the previous PageHighMem() implementation and won't > be changed. > > I apply the rule #3 for this patch. > > Acked-by: Roman Gushchin > Signed-off-by: Joonsoo Kim Why do we care about the zone here? This only cares about having kernel direct mapped pages as far as I can tell.