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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, 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 898B0C433ED for ; Tue, 20 Apr 2021 09:16:19 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B320600EF for ; Tue, 20 Apr 2021 09:16:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B320600EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qFL6imJmofiRu8dpKvPLQzM7GEEnQV6z0cIvxgk5OMc=; b=pmaFw2VIdW9Qz9R+MlRUMDgM9 IKiXRa69GuYQmodyYPCav+lr6jqls5dSA5A8X/Z3YVdmH3pcgej6Mv/0zqgpm4HvjCqpgkqiLhgHp eWGul5aFoGMtb2/yThpLJwJzMSltipIiIn8CmHQidEjwWrnhb3W/dv3utWdCPumHb2ThQUKquyexD KbVHMffpZz1CHm5onreeANc1jzZiPyOg42pPchll/m3PVgVs7MONvTVzA0PyA5UcuKY2A97Hjld7Q pZ5W1pHQRmseIv0SncEv4SzIZ+IvqE8tmy+LHVpKidYhKpzbb2u60qc2yq7BeKMDwwn1YvnyUDqCU JZnEuR1dw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYmSk-00Bgx4-Fa; Tue, 20 Apr 2021 09:14:31 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYmSg-00Bgwe-0I for linux-arm-kernel@desiato.infradead.org; Tue, 20 Apr 2021 09:14:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=XSWWmOTRfgFotvxB95NkUczWDfA3ysR6cpY9fmk36dg=; b=ZwdHD33w0w6Yn9MCoGeyJjDHcz 4tk5n0rVnHgSFQ3Bi9FUGC61rhsNZ8/S8WCLucZQUsMB7BghGwc1ATGXA45Q9lYbVr3APP6rxp8I8 nEhf9+a0kl2MV3OVZxYmqPmhQSfHqlZAadooa7mzMfu0fnkhKDhZsN10JRvU0Rbk9JWs1OAoTHIJM 9UEp91RdcCo9VVh2Jodgdcllqq5l57gAxnnCPLa9294tV7Bxc0YeORu6XqY6IHryAxPPRnyfP0P0/ TmICqzJFVb5jU0lo6ZCqKsVPPoHpzlLlWWrddWrFwBDZax33961chJ0s8p0GlnRL/Jgaxr75w6E3k bM7Q2cmw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYmSd-00BxoF-Fz for linux-arm-kernel@lists.infradead.org; Tue, 20 Apr 2021 09:14:24 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D0F46127C; Tue, 20 Apr 2021 09:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618910062; bh=Qi6LdBTlLuOVuNcp6ddeBrW8xIediedEVTnPkga7Anc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NjQaTi2NPjKcqKKvsYV3AmdeFc4aJ06NeVVcgljxzAA2R/71Ieq+kJB+3VpFqwPKI 56nXcvMvXupc1NeXj0amqlT1ZoRu7lIi9OQKbdce/DTJJEJ7xdwKoZEO33dFk4Mmfi LUqs+CwBnRHs8VBsS4xPKSnjyNZciJnwjW8vtTb9xXlxuFq09TRLAe4ThBoK8y/iJ9 zGNmKXgjFG/IA+VQgp21vUTukTLoAsqFnI0JLzHrEUnd0NYzyjK1qx5UpHv5nMLApx LOhQiaP9O3bebjlDSrdgdqkBGukfxYEccuoLGz41r2owMNgQYIOZ2g27IINZuOq+gN DVNxoRtFiXHAA== From: Mike Rapoport To: linux-arm-kernel@lists.infradead.org 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-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v1 1/4] include/linux/mmzone.h: add documentation for pfn_valid() Date: Tue, 20 Apr 2021 12:09:22 +0300 Message-Id: <20210420090925.7457-2-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210420090925.7457-1-rppt@kernel.org> References: <20210420090925.7457-1-rppt@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210420_021423_588571_09EAB065 X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Mike Rapoport Add comment describing the semantics of pfn_valid() that clarifies that pfn_valid() only checks for availability of a memory map entry (i.e. struct page) for a PFN rather than availability of usable memory backing that PFN. The most "generic" version of pfn_valid() used by the configurations with SPARSEMEM enabled resides in include/linux/mmzone.h so this is the most suitable place for documentation about semantics of pfn_valid(). Suggested-by: Anshuman Khandual Signed-off-by: Mike Rapoport --- include/linux/mmzone.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 47946cec7584..961f0eeefb62 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1410,6 +1410,17 @@ static inline int pfn_section_valid(struct mem_section *ms, unsigned long pfn) #endif #ifndef CONFIG_HAVE_ARCH_PFN_VALID +/** + * pfn_valid - check if there is a valid memory map entry for a PFN + * @pfn: the page frame number to check + * + * Check if there is a valid memory map entry aka struct page for the @pfn. + * Note, that availability of the memory map entry does not imply that + * there is actual usable memory at that @pfn. The struct page may + * represent a hole or an unusable page frame. + * + * Return: 1 for PFNs that have memory map entries and 0 otherwise + */ static inline int pfn_valid(unsigned long pfn) { struct mem_section *ms; -- 2.28.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel