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 A02C2C54FCC for ; Mon, 20 Apr 2020 08:00:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5ED4521D82 for ; Mon, 20 Apr 2020 08:00:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gvzqiPWE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5ED4521D82 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 DD8B68E0009; Mon, 20 Apr 2020 04:00:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D60148E0003; Mon, 20 Apr 2020 04:00:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C01068E0009; Mon, 20 Apr 2020 04:00:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id A79B98E0003 for ; Mon, 20 Apr 2020 04:00:45 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 54FB2824556B for ; Mon, 20 Apr 2020 08:00:45 +0000 (UTC) X-FDA: 76727486850.24.clam63_5ddc38cb98f0b X-HE-Tag: clam63_5ddc38cb98f0b X-Filterd-Recvd-Size: 5210 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 08:00:44 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id n24so3644744plp.13 for ; Mon, 20 Apr 2020 01:00:44 -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=rjiAZZ5G9Er5K6DiVUvm4RrDcTPBJJbdH0An8HV3WPU=; b=gvzqiPWEaA6Fgy60bF41PNiLgy/POLCSDD+oUs6ipMccf/+BYVsPxFo1T9L82vf8Ex WiXpeN2aywfKiDT43mgK37lstftSsLOH8MHzRbRcwQPgkiVb7UicVVJuv+WKrhSeQyV8 xKPDyXR654sP98fA+HCkmgn6A5mjkbKenQwRPTGAWeIc1PU2pqEGFAzCd7Ac1gQHOH0y jY5Sehb5Vu5T7mOjkngLPKUm2lJWqEeDuKJIlB0YwFyT+Dth43OileJiiOdAgVsj/2E9 UTg2O7sq+mxqwEcOurJrKs3XkXDNpcVlAIo9EwTTon0dVbZgTE0BVt4H0dfbh1xqhvNK xnqA== 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=rjiAZZ5G9Er5K6DiVUvm4RrDcTPBJJbdH0An8HV3WPU=; b=eetnglkZZCS+kIbS0x/TAhbq13KqxK1XqedXylfrx5FFVt2+pRRI5405xBlqRl5p3p dQ9hGUcERKtK0TWMBzd3cJselEDFpl79CUrEObJzXgTZ7dPe6b1FjWGGfl+Y37NQwg5b B/xUqom++lh+4mefgpjXf5EOu9y65iHYKgGsSWoPp4whKRrmcsVWfwI93P486i/TpAma uG9aaknX/2ehLYx5K3UjBMTophLAMnFM4A9fz7YCCG2+XdfRMJ1GSXyP5lFhs+VkhWyD Wr0Rvv7LZJZqvBhiun/+zbjBzJDL9vqWRUUGCG89O8rGaGmdE2xyv4HzJcV/8f/byExR /wvA== X-Gm-Message-State: AGi0PuZmYjYXSU8cHvD+w3xDLxL4ivJIMJgMixoYRtfnH4yBHbDf1GjZ ydGz/6NMlsIpdlkvlevdtfY= X-Google-Smtp-Source: APiQypIvOwWszR77pALzUGPwEo5gChdgiIboqtUTfCay4xpGZgEOfJFRZ2OBWLI7JL9nqKisiVg0jg== X-Received: by 2002:a17:902:8697:: with SMTP id g23mr15390776plo.306.1587369644029; Mon, 20 Apr 2020 01:00:44 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id n9sm314947pjt.29.2020.04.20.01.00.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2020 01:00:43 -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 04/10] kexec: separate PageHighMem() and PageHighMemZone() use case Date: Mon, 20 Apr 2020 16:59:36 +0900 Message-Id: <1587369582-3882-5-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 --- kernel/kexec_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index ba1d91e..33097b7 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -766,7 +766,7 @@ static struct page *kimage_alloc_page(struct kimage *image, * gfp_flags honor the ones passed in. */ if (!(gfp_mask & __GFP_HIGHMEM) && - PageHighMem(old_page)) { + PageHighMemZone(old_page)) { kimage_free_pages(old_page); continue; } -- 2.7.4