Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp149800ybz; Tue, 28 Apr 2020 20:29:14 -0700 (PDT) X-Google-Smtp-Source: APiQypJGLIHyXjo1Ys0uzBMd2KjDRvADLYYg+O+LCXQMdg2N7Z4p/XJYAXGLgvu75OanNuB5GZqi X-Received: by 2002:a05:6402:129a:: with SMTP id w26mr731400edv.254.1588130954306; Tue, 28 Apr 2020 20:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588130954; cv=none; d=google.com; s=arc-20160816; b=m93EujupX8sg+jaSmWVU5AETLwFXOGdJugyJneXyagLC5UemyBijHv+1V2IjOpByGV VlcFBr5DYT65wLwneTenhHE5gtECxLIf75jFKHBPguGRFcqPvQXWeGl71G5U9HNL50U7 P6j8+HcyPxkebPM9UNrh38vh+2YrYM6EPIcgMS6DHHuSiBDlJ/lEhTM8cKFsNbLJfy8W 4/cqRzqIxv9W78awvwspH5Idq1dmXUUTwZF59q4J0JWe7Z45yUSUUCUvobo6NJMOXX9A XbK3oTpHsuaHfHcxdc/zOh2qJAsoqwGp0AV6wVbKw4SB/+m2xbUf5OmKYQ0vM14uD8f0 YJBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=dDZ1MgpmhJ05Zf8jhPCyAD6OUKmqbz/zL2ik7cD9hVA=; b=islhLmTiwQYmws9nCK9AaZqJYXveOy5iu0voZ83UH4nv6eE3AJMdbJp99gCCaqpGXq L+l2PDT+aNpoJycQTB9Ljc02kJXgYUf8K+CKzX7ZgjcO5/rUbQAOC1pbwgqbm5TR6A4D c5wunnccwbqi2w/fSfseKp6DYvg89kbYJEiM0OrjOU3H0l/ShSoUYJJE4aRYeh2gSrys TL28k4CTrfXigHtEwWSD/IxEPQ4UzETSZjfE4sNv78Vb8hylHkGNrYwnb82S/D2YkNWf oJT/Zr6p8TPQ0H2TdW3BdhO6rMp+ArWuuOdEhl5PSYnwUONKAVASQWNTdJZpF/U7uUNV vrLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XyaUIW/R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec15si3016517ejb.286.2020.04.28.20.28.51; Tue, 28 Apr 2020 20:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XyaUIW/R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbgD2D1Q (ORCPT + 99 others); Tue, 28 Apr 2020 23:27:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726508AbgD2D1P (ORCPT ); Tue, 28 Apr 2020 23:27:15 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B86E5C03C1AC for ; Tue, 28 Apr 2020 20:27:15 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a31so209910pje.1 for ; Tue, 28 Apr 2020 20:27:15 -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=dDZ1MgpmhJ05Zf8jhPCyAD6OUKmqbz/zL2ik7cD9hVA=; b=XyaUIW/R1YgoWjppehedCHz7ersMbBGxynOYTQO4mdAbWylRcXcgm9rAc3l8H9jwTt Q0ZMYyVifmbLC3MrPLvU+d5sYUwjiOJHmD7InEFGJ3bb52c7d+Sz/vop+GDBx2SYmFcz 2b5PlQCKHq2H0QrFfDTDp/9IFPb+Vc/3mi3pvZQ1ouZ18g3z2esZ/UMf84WZphqQIIwG ujJqUEx2InMv4DESByAlMLJ7LVGRql3PDtdOu7dlIzaX4fjMTU+WQkkMJtyKKDRl7J/3 N9T1oTPbCGbF3BKNUcRPZR33JCrGfQyUHCB4AUurlaBxiC+ykJxPTyw2RHsrK7NTk+HW TH/w== 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=dDZ1MgpmhJ05Zf8jhPCyAD6OUKmqbz/zL2ik7cD9hVA=; b=jQnWzxwnJ7DCpB1kVB+w3YNJ4Vqo2aPRxgemCJ9PldRt5N5E9dp1rR1lqb+KykWYeR FBTYVK8sKwTpm+8d2W7N5KouRYMb1vGQMSXP1U0h9orhdzHh9mcVtOzBa5C22N8Mju/D Rkm9G8YRhBW7D9bTnlZbyB6aHyxOJvKPOOnSS8I9XONGXbqVbxVhr8BU6adMpmVKuWj4 5VeaDIkOOASYdGMqR1DpyZdsuUCl2N6FnTWHWSpS11s4UrJt4TJSZZfWr1BR3i0Ja7dg FT5nhZ8TpnArn2qfTYb5woCvpVFBhprbT+CVrP+f1A4IW2knXAT9FYjMxpWbAqviEb2O mBrQ== X-Gm-Message-State: AGi0PubucE6sjoINk//9L6ezsjdOLIFnHSL2GzQCao9YmZEqnmEznb3V 7SYKVKtalcG80ptR4mlb0nU= X-Received: by 2002:a17:90a:cb09:: with SMTP id z9mr754586pjt.120.1588130835256; Tue, 28 Apr 2020 20:27:15 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id q11sm9559796pfl.97.2020.04.28.20.27.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2020 20:27:14 -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 03/10] kexec: separate PageHighMem() and PageHighMemZone() use case Date: Wed, 29 Apr 2020 12:26:36 +0900 Message-Id: <1588130803-20527-4-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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