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 2A29CC3A5A0 for ; Mon, 20 Apr 2020 08:00:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DDA6221D79 for ; Mon, 20 Apr 2020 08:00:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bkoHMPSl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDA6221D79 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 91B978E0008; Mon, 20 Apr 2020 04:00:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A4EC8E0003; Mon, 20 Apr 2020 04:00:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76D498E0008; Mon, 20 Apr 2020 04:00:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id 5B03C8E0003 for ; Mon, 20 Apr 2020 04:00:41 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0EDF7440B for ; Mon, 20 Apr 2020 08:00:41 +0000 (UTC) X-FDA: 76727486682.19.mice59_5d3a88e83043f X-HE-Tag: mice59_5d3a88e83043f X-Filterd-Recvd-Size: 5278 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 08:00:40 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id g6so4651161pgs.9 for ; Mon, 20 Apr 2020 01:00:40 -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=52791mAUB6suGZo+tXBAHs9ubgU/UiPptwuGuey0HWA=; b=bkoHMPSlvqVW/xIixrvQlW7MbpVixhIaJq0vY5WKIHElzYLLQgSSuswqnD2GJjG37v hDYUKCpT5HMeLWz8SJG2A45HSv7coWTC6M+IqY4iC6YTxlEB1/tcbUJe3BzNGq/NJO3F WQjbjEmK5je2oi5CqvrgQ/jccvxhhyjSbyMPQWnPO1fGogVu6JeMyCdDLyvr/utL1uo5 TNgcZkFGtMq3LcPUL4nowaQLIbG0kYwpGen491ED2+LJL+UxxkI0EDbF15ZPDvb7kY3E YvSZdoFkLpTZGDzxoYQpPX7Y6e34wj33q34RV+fw1iItvM8Gb5jin7SvaU25G75ZhZb7 2ekg== 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=52791mAUB6suGZo+tXBAHs9ubgU/UiPptwuGuey0HWA=; b=GnKTRU9ZInkorxMD9ki3uicAnFZFc9jLydHKACu4im2cMS8aY/3W4VACqhLLGiThCk p5fWZ9kfOwwjxKj68uWoKt9a28LI2Y6X66D13jjLD3/4UmzKAEdm0YMTOe8EwcV5gRTS PS7dtvqKZs+ZCw2W1l+j+Is18gvCiYbtKCE6OoxBZOfHsahxlkDjAV8Hj8ekUTY9LIFr TsohPe/gEFajGnZwsdTYCg1FcJNpIsAg7+nDTq6I0axVCeDfo3P4kWy2Rvr8IyxGooeA XiP4At3kj6FG59XSV9nKD7NKJ7OLRofAM84eBUpfcj3RCqHNC2Qiy+7poVFgXByuknFp YywA== X-Gm-Message-State: AGi0Pub3f2Q0VSMEc5SAeYlG58CSkMzs3yby1C8TZs8KWuoMwy4D8MeV Ss5jvSfJvgJumZ/XZWLdpug= X-Google-Smtp-Source: APiQypKIqxDuVLDfanElVReNdt0lDoBqnFlIavFkF0s5oVkkFlBVHvGOtxlIwVQfMUK3NLD1WhwOwQ== X-Received: by 2002:a62:14a:: with SMTP id 71mr14794311pfb.33.1587369639755; Mon, 20 Apr 2020 01:00:39 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id n9sm314947pjt.29.2020.04.20.01.00.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2020 01:00:39 -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 03/10] mm/migrate: separate PageHighMem() and PageHighMemZone() use case Date: Mon, 20 Apr 2020 16:59:35 +0900 Message-Id: <1587369582-3882-4-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. 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. Signed-off-by: Joonsoo Kim --- include/linux/migrate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 3e546cb..9a57766 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -47,7 +47,7 @@ static inline struct page *new_page_nodemask(struct page *page, order = HPAGE_PMD_ORDER; } - if (PageHighMem(page) || (zone_idx(page_zone(page)) == ZONE_MOVABLE)) + if (PageHighMemZone(page) || zone_idx(page_zone(page)) == ZONE_MOVABLE) gfp_mask |= __GFP_HIGHMEM; new_page = __alloc_pages_nodemask(gfp_mask, order, -- 2.7.4