Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3376224pxj; Tue, 11 May 2021 03:08:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDBX85WpT7AsNCxDmrMv/fIwvgk4TfZ6b72ritmwt5St7TSRHFi+okwq7BvhnmNz7t9DSC X-Received: by 2002:a5d:88cf:: with SMTP id i15mr21601317iol.45.1620727730149; Tue, 11 May 2021 03:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620727730; cv=none; d=google.com; s=arc-20160816; b=A0K3NVDSz+cHu+4TRy7garrNe3jvyzndcG5bigJuhBx8vyRyXOSfupjmjHk0wm3K8d TPmsgVFomg78SfuwLuRA5LBmeGZrrQpR77UEvGfnTxM1oMQ/SI1tHIbAMSChnGEgjjIE yCmNDTIPF9VEUahn/fY1IXKA29JABHczbaN2uscmJiK6fHxaVnOj4jdmYOT6fdRgfal1 x/bSTAd7SHtrckOxQ6D9W/5A9WKHhdGrzZFpeEUzvrSGZdpl5UW+MoQpJ8XPyP2J/4d8 dzopnMHPMn1IW2ueCm3y6f76lncGS0ux5+rMcH6b64ZHqwAiMsH6EaSF4KH9xFr86fTn ANNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zVKMKvJZ0srnrS/mk0oq/K90yhoBWciw2tzvUyfpgSg=; b=OPe/R1oh8WgM2anKRbqmJ+HAoeAkmdDUAj3oQcKcKeQa8wwDdfCSc23nu6jmtgQR7j BvGgsspb8sm0FwPwE2XvI95/BSRChHdGcFpqnOMsWUAzpd6ggKilX+44r91OA3hl2fFn tG7VxoQPEaLrdk0iNbwIkDuGf2Ut6oAcANHlQFPD5z733YNgO/p6D/Nz0LuDr7JzXC/5 YdAQ3Os0M+ivwZL+IfZ4i1lOIKmnVGLZ/suRBBXx+PhP0wj0vPBeB0bJOJn38lcZAbkd DtlWUmzQMP5ZDUJhmOzdW4HOsHtiee8EvIzm7fHUbPrAua8zB1ICIu2XKBJatYAyHEQ6 +eLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HYDF4IQV; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j188si16173518jac.58.2021.05.11.03.08.38; Tue, 11 May 2021 03:08:50 -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=@kernel.org header.s=k20201202 header.b=HYDF4IQV; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231465AbhEKKH1 (ORCPT + 99 others); Tue, 11 May 2021 06:07:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:42376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231432AbhEKKHV (ORCPT ); Tue, 11 May 2021 06:07:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F138E61939; Tue, 11 May 2021 10:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620727575; bh=SlugFhiHPFE6544Op5mwYlOkGJajxXxh97whxO6/BpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HYDF4IQVMwKctvrPMNf95/Pi4DLD45vn6Bg51bGOwMZencaGiwj43fkKPQm08bIwu DW9MDtK5hN9JDa0rWQ4zWqCsuTlu+Wl7qkZwUObbIm+xN9ndU6m3MiOMBDRowd5d6S 1k/2vv/YoYPPXlm2tyD6M2BU4/wVFX7FOfcb9nU9G4F3berrlBwG0srn9nJ6Wc9AQK WZiOsUaUxrSlRrqmQvV2ieZsfBfn5FxYmLPBoAsLStxaRckXJR7h7yUFFU3K28jFWe c1+klc10Szz9z2s/c0OcwmBRJkQQKgKUR+dVkXDmqrq2kPmqZKUDXTSNMgnIkcUpjc X5xLsM/+3/ZVg== From: Mike Rapoport To: Andrew Morton Cc: Anshuman Khandual , Ard Biesheuvel , Catalin Marinas , David Hildenbrand , Marc Zyngier , Mark Rutland , Mike Rapoport , Mike Rapoport , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v4 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid() Date: Tue, 11 May 2021 13:05:50 +0300 Message-Id: <20210511100550.28178-5-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210511100550.28178-1-rppt@kernel.org> References: <20210511100550.28178-1-rppt@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Rapoport The arm64's version of pfn_valid() differs from the generic because of two reasons: * Parts of the memory map are freed during boot. This makes it necessary to verify that there is actual physical memory that corresponds to a pfn which is done by querying memblock. * There are NOMAP memory regions. These regions are not mapped in the linear map and until the previous commit the struct pages representing these areas had default values. As the consequence of absence of the special treatment of NOMAP regions in the memory map it was necessary to use memblock_is_map_memory() in pfn_valid() and to have pfn_valid_within() aliased to pfn_valid() so that generic mm functionality would not treat a NOMAP page as a normal page. Since the NOMAP regions are now marked as PageReserved(), pfn walkers and the rest of core mm will treat them as unusable memory and thus pfn_valid_within() is no longer required at all and can be disabled by removing CONFIG_HOLES_IN_ZONE on arm64. pfn_valid() can be slightly simplified by replacing memblock_is_map_memory() with memblock_is_memory(). Signed-off-by: Mike Rapoport Acked-by: David Hildenbrand --- arch/arm64/Kconfig | 3 --- arch/arm64/mm/init.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 9f1d8566bbf9..d7dc8698cf8e 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1052,9 +1052,6 @@ config NEED_PER_CPU_EMBED_FIRST_CHUNK def_bool y depends on NUMA -config HOLES_IN_ZONE - def_bool y - source "kernel/Kconfig.hz" config ARCH_SPARSEMEM_ENABLE diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 798f74f501d5..fb07218da2c0 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -251,7 +251,7 @@ int pfn_valid(unsigned long pfn) if (!early_section(ms)) return pfn_section_valid(ms, pfn); - return memblock_is_map_memory(addr); + return memblock_is_memory(addr); } EXPORT_SYMBOL(pfn_valid); -- 2.28.0