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,URIBL_BLOCKED,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 77C44C83006 for ; Wed, 29 Apr 2020 03:27:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 372162068E for ; Wed, 29 Apr 2020 03:27:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sSiiNusd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 372162068E 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 DBF3B8E000A; Tue, 28 Apr 2020 23:27:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D96A38E0001; Tue, 28 Apr 2020 23:27:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CACA78E000A; Tue, 28 Apr 2020 23:27:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id B32618E0001 for ; Tue, 28 Apr 2020 23:27:26 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 750D9583A for ; Wed, 29 Apr 2020 03:27:26 +0000 (UTC) X-FDA: 76759457292.21.bread87_7b2289a875f18 X-HE-Tag: bread87_7b2289a875f18 X-Filterd-Recvd-Size: 5233 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 03:27:26 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id e6so206243pjt.4 for ; Tue, 28 Apr 2020 20:27:25 -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=I0oqOMj56XIKW63HotLmokAMCg2A69VeVE+VeYYlJqg=; b=sSiiNusdHjtGcx9VfYZIVguqdiKCZ0+BasEaW5yOJTOTyDh4u8YL1ORr4G9qIJUxbo nSvYaxGLxDFyxIH53CVrltoeGcYiiFhjaLdfXIVeGSwZQWdfZLfS0j+gwW+wpaInAorF ngzmAjj764tUNH68D5quXiqyAfW6Ynny7Y1Y+IpzwokcK10DYqu/bqupN5W17IDaTwbt sHdGr70UYcd0PEeTiS0B6SotKHEBWri6+HImnnFZCjEOeqR6w7E06axV4L4kg7GSfdac NQcuOGfEm2VmhkaOhhvyc4qmJe89cDPAli+T56cJQ/YL5ODp4K4MePS+6DTZ1jWmfRje Z5Jw== 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=I0oqOMj56XIKW63HotLmokAMCg2A69VeVE+VeYYlJqg=; b=LgE5f+AvaHn93khrz0Xn1jksbpyav6ACE0vnQMXskCVE+h14+Z+awzGLwGE/++uLTH RuQGapcNFGsgNO9wQ4r8VzPEJC3X9Xc8EBNXOuBMe3aBXLa9ODi5l1Ad70S1HSxNCWSj lKwpwG3mt8h+rxDlCHoJUxnSIJi0vgRPN30amjmRsUjnm4xJx8FZjIZh501RVM72Uyi2 J7SSEO3HmZxHDRWahGuhw6SpQMOj1F2CUVa7bopIjq/RzaGem4d6oYBMlqW+E33Z/Mz1 L3FGwSTUBmAb3Y/ceCF7s21GyaR4Ll3diClXFmtY89OkzkSu/lPrOpp/6kNe1N5eWSxr Hszg== X-Gm-Message-State: AGi0PuZva3cAWPcY+nPWs1rcgkLQ+3EChI5ZljVj0jOoSQ6XiQjHCAer 3ecR8Qq1HNW6JEwFbvKNU2U= X-Google-Smtp-Source: APiQypJ4M3fjAxtASvxWVCQ/MQVKg3iL+P6Y3uu3OuaLllA7y3piEPYMI/B3S1mfESsnTnFFOXzVUg== X-Received: by 2002:a17:902:bc86:: with SMTP id bb6mr17376253plb.243.1588130845146; Tue, 28 Apr 2020 20:27:25 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id q11sm9559796pfl.97.2020.04.28.20.27.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2020 20:27:24 -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 05/10] mm/gup: separate PageHighMem() and PageHighMemZone() use case Date: Wed, 29 Apr 2020 12:26:38 +0900 Message-Id: <1588130803-20527-6-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. 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 #2 for this patch. Acked-by: Roman Gushchin Signed-off-by: Joonsoo Kim --- mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/gup.c b/mm/gup.c index 11fda53..9652eed 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1608,7 +1608,7 @@ static struct page *new_non_cma_page(struct page *page, unsigned long private) */ gfp_t gfp_mask = GFP_USER | __GFP_NOWARN; - if (PageHighMem(page)) + if (PageHighMemZone(page)) gfp_mask |= __GFP_HIGHMEM; #ifdef CONFIG_HUGETLB_PAGE -- 2.7.4