Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp310918img; Wed, 20 Mar 2019 21:22:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS4yHf9oD7G19tUsk+QeOMCK8kbF6Fu3bwQG7qpvaVFDe+qQJQd6DGw3tEdF6Uc+N39fhJ X-Received: by 2002:a17:902:b416:: with SMTP id x22mr1486784plr.285.1553142161030; Wed, 20 Mar 2019 21:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553142161; cv=none; d=google.com; s=arc-20160816; b=YlAjFIm49naagBXcYQBEKj1qR3oA9oVMJ/T4FYUcgnv5s4BRcFeMS7G5JFXOfguUwn XGKGjFuZjp3vR/1BUbUNVOeM6HBQYgedLgN1JJVK5sLAGMgo5+B/qW6+q94L+YOe9nVu jeDS7O4ePEJDyNxUV9uHyailNnQocrFvN7SnV0ees2gPSkY5gwWuLaIw8zet1sHQe6mZ B+8NHPCOumTB34P9ADBszoqjNQKZilTcS4GfOHl+kA71jHsPgzcS5xt1CqtMtH6AIDPg yeswOkH0bPXaSVlujDODO4FMWCdrwmrp/Bnx3Y5aXUNi0SrfgOo9bV3ieidHnw+gBXt/ dvpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=O0RvRUGXoCaMZyvuMBzOdfeT1a8DbVXJSmeZ0r8lW3s=; b=ZNRGEX8q9azpgBA/bJWZDbUrU0vQWEhHjdcVNhpDuQNyn/f7XnAzW7tUzUV9CZ86/7 qOTIioaQj0imfnXNBPV4JBJ271zV6L5MT4ZyxehxgGIxAMyvRiRei+2/YJ3SBPBHC6N5 XCa08UE9xB7u0Ij3fom0POTgDJQSVclvWoaUht8Sw0HdQmqBWSFodLI1XFua9wxWs2fI 3fwXxmU2km+6+2FJg51pF0n22zr8ey8vc/Ov+IngjRH69S4wz4RPk4A0QAEBFOWTycl0 5Cihd8xNPD3awNG8IeXhCjAQpk5umue3EmTJuHMqxHSuesbK27mdyWrKnV1r8I4jAe/O /ieg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si3220452pgq.173.2019.03.20.21.22.23; Wed, 20 Mar 2019 21:22:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725944AbfCUEVp (ORCPT + 99 others); Thu, 21 Mar 2019 00:21:45 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:40143 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725871AbfCUEVp (ORCPT ); Thu, 21 Mar 2019 00:21:45 -0400 X-UUID: 96c85726c45e4f88b40c6250be55700b-20190321 X-UUID: 96c85726c45e4f88b40c6250be55700b-20190321 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 287673506; Thu, 21 Mar 2019 12:21:35 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 21 Mar 2019 12:21:27 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 21 Mar 2019 12:21:27 +0800 From: Miles Chen To: Catalin Marinas , Will Deacon CC: , , , , Miles Chen Subject: [PATCH] arm64: setup min_low_pfn Date: Thu, 21 Mar 2019 12:21:25 +0800 Message-ID: <1553142085-5800-1-git-send-email-miles.chen@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: CD9AE3611D2CF0FD265D0346848CD0A719A8894E36F1E39196414851D76275DA2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When debugging with CONFIG_PAGE_OWNER, I noticed that the min_low_pfn on arm64 is always zero and the page owner scanning has to start from zero. We have to loop a while before we see the first valid pfn. (see: read_page_owner()) Setup min_low_pfn to save some loops. Before setting min_low_pfn: [ 21.265602] min_low_pfn=0, *ppos=0 Page allocated via order 0, mask 0x100cca(GFP_HIGHUSER_MOVABLE) PFN 262144 type Movable Block 512 type Movable Flags 0x8001e referenced|uptodate|dirty|lru|swapbacked) prep_new_page+0x13c/0x140 get_page_from_freelist+0x254/0x1068 __alloc_pages_nodemask+0xd4/0xcb8 After setting min_low_pfn: [ 11.025787] min_low_pfn=262144, *ppos=0 Page allocated via order 0, mask 0x100cca(GFP_HIGHUSER_MOVABLE) PFN 262144 type Movable Block 512 type Movable Flags 0x8001e referenced|uptodate|dirty|lru|swapbacked) prep_new_page+0x13c/0x140 get_page_from_freelist+0x254/0x1068 __alloc_pages_nodemask+0xd4/0xcb8 shmem_alloc_page+0x7c/0xa0 shmem_alloc_and_acct_page+0x124/0x1e8 shmem_getpage_gfp.isra.7+0x118/0x878 shmem_write_begin+0x38/0x68 Signed-off-by: Miles Chen --- arch/arm64/mm/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 6bc135042f5e..3dbd0c5ce780 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -440,6 +440,7 @@ void __init bootmem_init(void) early_memtest(min << PAGE_SHIFT, max << PAGE_SHIFT); max_pfn = max_low_pfn = max; + min_low_pfn = min; arm64_numa_init(); /* -- 2.18.0