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=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 93EA7C83007 for ; Wed, 29 Apr 2020 03:27:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4E40321569 for ; Wed, 29 Apr 2020 03:27:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WfE/iAfJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E40321569 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 F1FFE8E000F; Tue, 28 Apr 2020 23:27:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECEF08E0001; Tue, 28 Apr 2020 23:27:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE5148E000F; Tue, 28 Apr 2020 23:27:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id C3EE48E0001 for ; Tue, 28 Apr 2020 23:27:51 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 763845832 for ; Wed, 29 Apr 2020 03:27:51 +0000 (UTC) X-FDA: 76759458342.26.snail13_7ec5192c5bc4b X-HE-Tag: snail13_7ec5192c5bc4b X-Filterd-Recvd-Size: 5428 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 03:27:51 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id mq3so218924pjb.1 for ; Tue, 28 Apr 2020 20:27:50 -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=OoRI+cRunKH9WBjhUvLx6xEiTkTtLL8jDLPBXfzqLhY=; b=WfE/iAfJRj709WUE/DqCp3kQvZLDfPqz0Y+GFAuwA7l8LKNp0oWG35rkAoNlwpvZJ3 k4TnWr107Ixi9fhqz1qOaWTc50GGhV/Fx0Wsu3LTmy2DCVroGocU3ISWgKjr25sgMO0L t4OHwf3wKPVybUAboOEHTr9bObXq45dZjQ83L/voxeG8iKFVCFSfejvPKa7H/HtBB4dB mGAPVOBDNUSvC/SS1aLvmeYHQwMFXfancyfK0Q0lR2CzezZeTlrwqJjY0Gy7MWdiGyeg dUbpAxMCl55cyGRTrCHFbfjOtm9eBvlI9upgNDVsTJBQoAC9aqP7F9qcQ3QHtax4NECs Yecg== 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=OoRI+cRunKH9WBjhUvLx6xEiTkTtLL8jDLPBXfzqLhY=; b=hr+wCJzUxb57BTGVs9CnEWFDs23dnnETuVIRCkQdLSg0eJc04wpvVrZGv9mKNAGKV6 xRGxJFV3rV+wR70bdcwH3w+0wHPYGED6gzXUUNa81v6F/MJmpTxIezOhL32RbtVEfhj3 xBzLPSrxjCZkCSK6IjNWGNxNimnU9ZSxpbCx6GIlbohJOyOCUXuaedyCh9A/6z17J234 1d3Y8t0TmG1+U9gccKkx7AOLA/KQULC6XItHtwx9l19DKmDMLkZhE6eySSNJKKazaVjr GIZYJoF0cha+t3vXsAbt/nCplfmA/ddAjt9U88Il9e4fEFIjxgW0Hl1Imxx1MV8ZtEn3 JoYw== X-Gm-Message-State: AGi0PuaQkLJxhJ392rzJ+WNDmI73Rkq7hpMamBirNYK035IWUrBHRH1V UoNFIEEld2AiesVMjRRMFNs= X-Google-Smtp-Source: APiQypJw1FCB1XxqXtN6Ir3II1PN4ozwDO72vOVsNUoYWwEuA3b0siqTDlaFqUHECfk4fYh3xh8fog== X-Received: by 2002:a17:90a:648d:: with SMTP id h13mr778148pjj.12.1588130870123; Tue, 28 Apr 2020 20:27:50 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id q11sm9559796pfl.97.2020.04.28.20.27.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2020 20:27:49 -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 , kernel-team@lge.com, Christoph Hellwig , Joonsoo Kim Subject: [PATCH v2 10/10] mm/page-flags: change the implementation of the PageHighMem() Date: Wed, 29 Apr 2020 12:26:43 +0900 Message-Id: <1588130803-20527-11-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588130803-20527-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1588130803-20527-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. Acked-by: Roman Gushchin 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