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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 E2C7BC433B4 for ; Wed, 21 Apr 2021 06:51:26 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 5DEAE61424 for ; Wed, 21 Apr 2021 06:51:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DEAE61424 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id ED45A4B4D3; Wed, 21 Apr 2021 02:51:25 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t7-D2oOGPbs3; Wed, 21 Apr 2021 02:51:24 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1DC864B4C3; Wed, 21 Apr 2021 02:51:24 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9EE9B4B47D for ; Wed, 21 Apr 2021 02:51:22 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NB7WzuHPMEQ1 for ; Wed, 21 Apr 2021 02:51:21 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id B79B84B4B7 for ; Wed, 21 Apr 2021 02:51:21 -0400 (EDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E93361428; Wed, 21 Apr 2021 06:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618987880; bh=Qi6LdBTlLuOVuNcp6ddeBrW8xIediedEVTnPkga7Anc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I0HTEbj4cUiKNPef5hTCPqlmjrS7YAj9LhZ8f8oCk6ndpXorjNCYK37yorCoepSae qyoClHG2E59gApHvUP4vvznXZbmEDeAkASHd99j1vhQ3dU5e25pFIdGqnYjPHJb2dA 44oB3QviXTlWO9ozgNIoaySbgZ0xg72v08ealZmOoJiJPfu3VEww+W7Gdi5BK23KQ1 vI29v0YnzqvPdg8OMA5o3sj0oWFvPHGs2FXVPvuCt+M/R+s2s86pDn9FUMMHHWZR4R OW4G/4ZG77zKncLwtkeXwaYXvRNmOm0J+yXvtG8TC+usiLRECUuxTzExcmmmDYWNbg 8AUiSD9dW/6WA== From: Mike Rapoport To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/4] include/linux/mmzone.h: add documentation for pfn_valid() Date: Wed, 21 Apr 2021 09:51:05 +0300 Message-Id: <20210421065108.1987-2-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210421065108.1987-1-rppt@kernel.org> References: <20210421065108.1987-1-rppt@kernel.org> MIME-Version: 1.0 Cc: David Hildenbrand , Catalin Marinas , Anshuman Khandual , linux-kernel@vger.kernel.org, Mike Rapoport , linux-mm@kvack.org, kvmarm@lists.cs.columbia.edu, Marc Zyngier , Andrew Morton , Will Deacon , Mike Rapoport X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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,URIBL_BLOCKED,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 32578C433B4 for ; Wed, 21 Apr 2021 06:53:53 +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 D0E8B6141C for ; Wed, 21 Apr 2021 06:53:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0E8B6141C 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=V7MuJIE2QWHRiHE5801KFfN1U SmYd/IJy1k7fAytzlWH+fM/L0SX92luf2k2wWygprTQLeN9XCOr0rkme8Y5KjrsPl2fpkcLM4le6N a39fdl10OFO45l2+Uuqwr3CyXwoDSjnKFpjiFZMMmg2kGhmrzrexDCFmW1UgHIXE/hI1WTaGTD/Ci cK4hrFWXOlo+nB1iEIQxYIwrazrSJIRieLZpTywYcSMiJsOnovnKKf1z2gUCmAUjv6O/gJHezQWB7 P7GgPjv5+yOUvN3pyRzhg97an8269gss61m9LW7jS3WoNOx4Pt6NjGt9jRLvMOkgn91FSmtcWWTLD RAbOtHisg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZ6i2-00DqjT-Po; Wed, 21 Apr 2021 06:51:39 +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 1lZ6hn-00Dqi9-Lc for linux-arm-kernel@desiato.infradead.org; Wed, 21 Apr 2021 06:51:23 +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=4ai+cfn3YesYamJ/aClcL2unM9 oaW638unCWW6S9hNcNvX+NF89AAsPwTv6/Q71OLzBzf+/e2lNkqlD3b+UiHfdITmaEwa+ky1AP4mf WwLvo5gLqWOQR9na/dmLrJXM6GhbCxSDG3rpkUEzAl6SgSYvdwBiHQSFG5fPvv0eKglf5uTAFTZZb oyktR2sJjRCvbj5mesVBGYgz/P/2SmnVEzZMzveaCCCvcUa2m3Oy3LxX1tjKyCVvCbfwFeovt2h4W rUO0QMJmuw5aT0w8UFjyXtqGJ/RuZc1bidoJj8sigaGkn4OutMrJPfM3oyUkWT1yCJwT8PGxUzzUu Lc8zpPcQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZ6hl-00CeSU-8W for linux-arm-kernel@lists.infradead.org; Wed, 21 Apr 2021 06:51:22 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E93361428; Wed, 21 Apr 2021 06:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618987880; bh=Qi6LdBTlLuOVuNcp6ddeBrW8xIediedEVTnPkga7Anc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I0HTEbj4cUiKNPef5hTCPqlmjrS7YAj9LhZ8f8oCk6ndpXorjNCYK37yorCoepSae qyoClHG2E59gApHvUP4vvznXZbmEDeAkASHd99j1vhQ3dU5e25pFIdGqnYjPHJb2dA 44oB3QviXTlWO9ozgNIoaySbgZ0xg72v08ealZmOoJiJPfu3VEww+W7Gdi5BK23KQ1 vI29v0YnzqvPdg8OMA5o3sj0oWFvPHGs2FXVPvuCt+M/R+s2s86pDn9FUMMHHWZR4R OW4G/4ZG77zKncLwtkeXwaYXvRNmOm0J+yXvtG8TC+usiLRECUuxTzExcmmmDYWNbg 8AUiSD9dW/6WA== From: Mike Rapoport To: linux-arm-kernel@lists.infradead.org Cc: Andrew Morton , 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 v2 1/4] include/linux/mmzone.h: add documentation for pfn_valid() Date: Wed, 21 Apr 2021 09:51:05 +0300 Message-Id: <20210421065108.1987-2-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210421065108.1987-1-rppt@kernel.org> References: <20210421065108.1987-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_235121_342141_E37FD822 X-CRM114-Status: GOOD ( 13.22 ) 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 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 668E0C433B4 for ; Wed, 21 Apr 2021 06:51:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E18F261436 for ; Wed, 21 Apr 2021 06:51:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E18F261436 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7511F6B006E; Wed, 21 Apr 2021 02:51:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 727F16B0070; Wed, 21 Apr 2021 02:51:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CA336B0071; Wed, 21 Apr 2021 02:51:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 42FE76B006E for ; Wed, 21 Apr 2021 02:51:22 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 070AF82499A8 for ; Wed, 21 Apr 2021 06:51:22 +0000 (UTC) X-FDA: 78055452804.32.33F33E0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP id 5B2EEA0003A2 for ; Wed, 21 Apr 2021 06:51:19 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E93361428; Wed, 21 Apr 2021 06:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618987880; bh=Qi6LdBTlLuOVuNcp6ddeBrW8xIediedEVTnPkga7Anc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I0HTEbj4cUiKNPef5hTCPqlmjrS7YAj9LhZ8f8oCk6ndpXorjNCYK37yorCoepSae qyoClHG2E59gApHvUP4vvznXZbmEDeAkASHd99j1vhQ3dU5e25pFIdGqnYjPHJb2dA 44oB3QviXTlWO9ozgNIoaySbgZ0xg72v08ealZmOoJiJPfu3VEww+W7Gdi5BK23KQ1 vI29v0YnzqvPdg8OMA5o3sj0oWFvPHGs2FXVPvuCt+M/R+s2s86pDn9FUMMHHWZR4R OW4G/4ZG77zKncLwtkeXwaYXvRNmOm0J+yXvtG8TC+usiLRECUuxTzExcmmmDYWNbg 8AUiSD9dW/6WA== From: Mike Rapoport To: linux-arm-kernel@lists.infradead.org Cc: Andrew Morton , 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 v2 1/4] include/linux/mmzone.h: add documentation for pfn_valid() Date: Wed, 21 Apr 2021 09:51:05 +0300 Message-Id: <20210421065108.1987-2-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210421065108.1987-1-rppt@kernel.org> References: <20210421065108.1987-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 5B2EEA0003A2 X-Stat-Signature: xxewa658az7m6jm7bfj4r5gcg789ioij Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf15; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618987879-166683 Content-Transfer-Encoding: quoted-printable 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: 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. stru= ct page) for a PFN rather than availability of usable memory backing that PF= N. 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_sec= tion *ms, unsigned long pfn) #endif =20 #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 @p= fn. + * 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; --=20 2.28.0