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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 5D68EC3A5A0 for ; Mon, 20 Apr 2020 08:01:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 10D63206D5 for ; Mon, 20 Apr 2020 08:01:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sgWD3qhh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10D63206D5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B65ED8E000F; Mon, 20 Apr 2020 04:01:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B17328E0003; Mon, 20 Apr 2020 04:01:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B7708E000F; Mon, 20 Apr 2020 04:01:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0245.hostedemail.com [216.40.44.245]) by kanga.kvack.org (Postfix) with ESMTP id 81FA88E0003 for ; Mon, 20 Apr 2020 04:01:11 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 32080824556B for ; Mon, 20 Apr 2020 08:01:11 +0000 (UTC) X-FDA: 76727487942.30.offer75_61a23bbb0ed30 X-HE-Tag: offer75_61a23bbb0ed30 X-Filterd-Recvd-Size: 5318 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 08:01:10 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id o10so1429856pgb.6 for ; Mon, 20 Apr 2020 01:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nsx1nAzu/4IjpERoVyY6SnIjrlRZ5fYE1H4hmGJNrOs=; b=sgWD3qhhnIaTK/UDtnfaErwDaCv5ytr79OtnA304aSdPTCnortVmqPP2YSZU5//FB8 9/nhTTku0eJtrjnB9kz+zIvAtfyIU28pS7y+L0SUVDMTbg6XXkncVhIbrshCmyJJOYjw DnF3tn0ZMhOzZWC33j+UVYAiHSVeDQXO3lWcVytdYBHh20+6ck+Z18OBncg+jt2bTIl2 M10CtSeIb03s9mWkFEl+Ghf/84V0pgN28tG2hOo8btKdSie8Pu/ly4xwKK4kIt3GX9uV ++KM2XjONM+V/wNabJ3BduyGMUHx48Kc3rM03f42yXolhlI7H+NU1VixQ48m5afnN494 Lpjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nsx1nAzu/4IjpERoVyY6SnIjrlRZ5fYE1H4hmGJNrOs=; b=ZDRZh6cHalz8Pk2lYghTDQXlsqb47hjFo9JsH1cJINbxfntm132ezjire05J4R1jw+ x08dEcssdHXzclU3nxI++AY53mu6mV5AdxgO+ri5GI+KU+N49p94eW6FL343der6eHml h6ZaEkgSQc7GZX4iRqZtaaBni4MvIOCg5sqJFY5SGIcovC8vzHsUycO7xEYWRwfOWIaa 5n8qk8XB1aDjq4bKqnHCsbDFfWgAzn76ucoY065lXGP9x2vTLMVXWDX7R8j4QF8xKqGq KERaQOMlZd5XMUJaHZnZaaDcLyF1JcJYkfAokOQ/EliFTuIRJ6onqY5M92c475fNi6IK Nlpw== X-Gm-Message-State: AGi0PuYaBJ9ys7ieN715Yl7XxCHZOHskIO0ye00ktxoEOpqZDbiImXtW 2E3s1Bp/H0wJ8QPmoIJmIak= X-Google-Smtp-Source: APiQypL3+hsYLGvHCOb6pozOVQI7g5jjGwti43W8THeIPnoYzD+h/KwfZ77nfNt8nDrj54CL2Ln5YQ== X-Received: by 2002:a62:7b03:: with SMTP id w3mr9258910pfc.313.1587369670013; Mon, 20 Apr 2020 01:01:10 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id n9sm314947pjt.29.2020.04.20.01.01.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2020 01:01:09 -0700 (PDT) From: js1304@gmail.com X-Google-Original-From: iamjoonsoo.kim@lge.com To: Andrew Morton Cc: 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 , Joonsoo Kim Subject: [PATCH 10/10] mm/page-flags: change the implementation of the PageHighMem() Date: Mon, 20 Apr 2020 16:59:42 +0900 Message-Id: <1587369582-3882-11-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587369582-3882-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1587369582-3882-1-git-send-email-iamjoonsoo.kim@lge.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Previous patches introduce PageHighMemZone() macro and separates both cases strictly. So, now, PageHighMem() is used just for checking if there is a direct mapping for this page or not. In the following patchset, ZONE_MOVABLE which could be considered as the highmem type zone in some configuration could have both types of pages, direct mapped pages and unmapped pages. So, current implementation of PageHighMem() that checks the zone rather than checks the page in order to check if a direct mapping exists will be invalid. This patch prepares that case by implementing PageHighMem() with the max_low_pfn. Signed-off-by: Joonsoo Kim --- include/linux/page-flags.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index fca0cce..7ac5fc8 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -375,6 +375,8 @@ PAGEFLAG(Readahead, reclaim, PF_NO_COMPOUND) TESTCLEARFLAG(Readahead, reclaim, PF_NO_COMPOUND) #ifdef CONFIG_HIGHMEM +extern unsigned long max_low_pfn; + /* * Must use a macro here due to header dependency issues. page_zone() is not * available at this point. @@ -383,7 +385,7 @@ PAGEFLAG(Readahead, reclaim, PF_NO_COMPOUND) * in order to predict previous gfp_flags or to count something for system * memory management. */ -#define PageHighMem(__p) is_highmem_idx(page_zonenum(__p)) +#define PageHighMem(__p) (page_to_pfn(__p) >= max_low_pfn) #define PageHighMemZone(__p) is_highmem_idx(page_zonenum(__p)) #else PAGEFLAG_FALSE(HighMem) -- 2.7.4