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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 2AE98C433B4 for ; Tue, 11 May 2021 10:22:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9EC1610C9 for ; Tue, 11 May 2021 10:22:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231407AbhEKKYC (ORCPT ); Tue, 11 May 2021 06:24:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:59034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231177AbhEKKYB (ORCPT ); Tue, 11 May 2021 06:24:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 458246192C for ; Tue, 11 May 2021 10:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620728575; bh=8K5/RKVsB4hbF+2S3xYY+Sls7rLDAQAlNlhNK+wAOxM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kfmrEf4UUPFdXmN4bONIkgTnNm+NvLIuA5PwA2CwaYTxb1dDjpb/EJj7jzf3G1lQD nIb8iuIIEgctX84nf+w+HM4ez8mJ8I2el3imHgPUbBrVOHBIYCSrUucrRCUYBIl5sR oj7JeBjGYixV3xnxSGHcew4MdO2AoktCyJG9i3pn4u1nluL9dFAELEUbHsASk0gW3n NYTY2RE4iLWxmPJ9fLRQxFO5luOuFnQa0bVAyXfp9XdxBSCMB/iragnXUtE0mnpeGU RnKVF8Y9kKxgCuDKNkB/rFZ2rYHoOR7Bniz1tPOY9GSnS5n+Of6gvZc4a0k4tcauPY lK2AvxnMfA6Sg== Received: by mail-oi1-f179.google.com with SMTP id n184so18532849oia.12 for ; Tue, 11 May 2021 03:22:55 -0700 (PDT) X-Gm-Message-State: AOAM53275VwEGF5YJmDRPXScG44F4fop/rGa7bqJ1Q1v879JZJISX8zX ZcbM/7+peAGkwMWPQalgjbM83vwB58txdC8msvA= X-Google-Smtp-Source: ABdhPJz3X7/zsLxW0acYDilZnZffpfuhhEzj9r12Onr6R0a3ZrPbcEC3CSWgseEdH8CiwuI/0vKICdQkV3hdFyMavwI= X-Received: by 2002:aca:4056:: with SMTP id n83mr2975600oia.47.1620728574417; Tue, 11 May 2021 03:22:54 -0700 (PDT) MIME-Version: 1.0 References: <20210511100550.28178-1-rppt@kernel.org> <20210511100550.28178-2-rppt@kernel.org> In-Reply-To: <20210511100550.28178-2-rppt@kernel.org> From: Ard Biesheuvel Date: Tue, 11 May 2021 12:22:43 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/4] include/linux/mmzone.h: add documentation for pfn_valid() To: Mike Rapoport Cc: Andrew Morton , Anshuman Khandual , Catalin Marinas , David Hildenbrand , Marc Zyngier , Mark Rutland , Mike Rapoport , Will Deacon , kvmarm , Linux ARM , Linux Kernel Mailing List , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 May 2021 at 12:06, Mike Rapoport wrote: > > 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 > Reviewed-by: Anshuman Khandual Acked-by: Ard Biesheuvel > --- > include/linux/mmzone.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..e5945ca24df7 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -1427,6 +1427,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 > 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8551CC433ED for ; Tue, 11 May 2021 10:22:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E83A961932 for ; Tue, 11 May 2021 10:22:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E83A961932 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 53D126B006E; Tue, 11 May 2021 06:22:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 514926B0071; Tue, 11 May 2021 06:22:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B4F46B0072; Tue, 11 May 2021 06:22:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 20FC36B006E for ; Tue, 11 May 2021 06:22:57 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CE7E99998 for ; Tue, 11 May 2021 10:22:56 +0000 (UTC) X-FDA: 78128561952.11.CE39924 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf13.hostedemail.com (Postfix) with ESMTP id 09010E00013B for ; Tue, 11 May 2021 10:22:40 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 47CE161936 for ; Tue, 11 May 2021 10:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620728575; bh=8K5/RKVsB4hbF+2S3xYY+Sls7rLDAQAlNlhNK+wAOxM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kfmrEf4UUPFdXmN4bONIkgTnNm+NvLIuA5PwA2CwaYTxb1dDjpb/EJj7jzf3G1lQD nIb8iuIIEgctX84nf+w+HM4ez8mJ8I2el3imHgPUbBrVOHBIYCSrUucrRCUYBIl5sR oj7JeBjGYixV3xnxSGHcew4MdO2AoktCyJG9i3pn4u1nluL9dFAELEUbHsASk0gW3n NYTY2RE4iLWxmPJ9fLRQxFO5luOuFnQa0bVAyXfp9XdxBSCMB/iragnXUtE0mnpeGU RnKVF8Y9kKxgCuDKNkB/rFZ2rYHoOR7Bniz1tPOY9GSnS5n+Of6gvZc4a0k4tcauPY lK2AvxnMfA6Sg== Received: by mail-oi1-f179.google.com with SMTP id k25so18588243oic.4 for ; Tue, 11 May 2021 03:22:55 -0700 (PDT) X-Gm-Message-State: AOAM533qwOI0qLFOG+EyQt2Ud4CKi0JObnOhlUlRb+I4xe6ZtNj/k0Jg MNCnConukpwB8CN3Y2ZzZeYwB20gga7Qc2Yo++0= X-Google-Smtp-Source: ABdhPJz3X7/zsLxW0acYDilZnZffpfuhhEzj9r12Onr6R0a3ZrPbcEC3CSWgseEdH8CiwuI/0vKICdQkV3hdFyMavwI= X-Received: by 2002:aca:4056:: with SMTP id n83mr2975600oia.47.1620728574417; Tue, 11 May 2021 03:22:54 -0700 (PDT) MIME-Version: 1.0 References: <20210511100550.28178-1-rppt@kernel.org> <20210511100550.28178-2-rppt@kernel.org> In-Reply-To: <20210511100550.28178-2-rppt@kernel.org> From: Ard Biesheuvel Date: Tue, 11 May 2021 12:22:43 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/4] include/linux/mmzone.h: add documentation for pfn_valid() To: Mike Rapoport Cc: Andrew Morton , Anshuman Khandual , Catalin Marinas , David Hildenbrand , Marc Zyngier , Mark Rutland , Mike Rapoport , Will Deacon , kvmarm , Linux ARM , Linux Kernel Mailing List , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 09010E00013B Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=kfmrEf4U; spf=pass (imf13.hostedemail.com: domain of ardb@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=ardb@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam04 X-Stat-Signature: ypbq3busrmh49hn1qsse4df5ur98b85r Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf13; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620728560-281021 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: On Tue, 11 May 2021 at 12:06, Mike Rapoport wrote: > > 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 > Reviewed-by: Anshuman Khandual Acked-by: Ard Biesheuvel > --- > include/linux/mmzone.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..e5945ca24df7 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -1427,6 +1427,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 > 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=-13.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 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 30495C433ED for ; Tue, 11 May 2021 10:23:05 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 7A56D61925 for ; Tue, 11 May 2021 10:23:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A56D61925 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 E48CC4B4BA; Tue, 11 May 2021 06:23:01 -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 6VT1g-+ztApf; Tue, 11 May 2021 06:22:59 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 5470B4B4B4; Tue, 11 May 2021 06:22:59 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E83374B499 for ; Tue, 11 May 2021 06:22:57 -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 Jgu2UWVI5-RS for ; Tue, 11 May 2021 06:22:56 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 9BB134B495 for ; Tue, 11 May 2021 06:22:56 -0400 (EDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id 3DB9C61932 for ; Tue, 11 May 2021 10:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620728575; bh=8K5/RKVsB4hbF+2S3xYY+Sls7rLDAQAlNlhNK+wAOxM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kfmrEf4UUPFdXmN4bONIkgTnNm+NvLIuA5PwA2CwaYTxb1dDjpb/EJj7jzf3G1lQD nIb8iuIIEgctX84nf+w+HM4ez8mJ8I2el3imHgPUbBrVOHBIYCSrUucrRCUYBIl5sR oj7JeBjGYixV3xnxSGHcew4MdO2AoktCyJG9i3pn4u1nluL9dFAELEUbHsASk0gW3n NYTY2RE4iLWxmPJ9fLRQxFO5luOuFnQa0bVAyXfp9XdxBSCMB/iragnXUtE0mnpeGU RnKVF8Y9kKxgCuDKNkB/rFZ2rYHoOR7Bniz1tPOY9GSnS5n+Of6gvZc4a0k4tcauPY lK2AvxnMfA6Sg== Received: by mail-oi1-f174.google.com with SMTP id l6so18607069oii.1 for ; Tue, 11 May 2021 03:22:55 -0700 (PDT) X-Gm-Message-State: AOAM531fzw9TmiiTC8MnsK9jiqexOhbyivS+63roDdGZrj1L7cwOCx50 3TzjnOrYk6Kgxa5wfOZInFdi5nrZne4XkdQ9qY4= X-Google-Smtp-Source: ABdhPJz3X7/zsLxW0acYDilZnZffpfuhhEzj9r12Onr6R0a3ZrPbcEC3CSWgseEdH8CiwuI/0vKICdQkV3hdFyMavwI= X-Received: by 2002:aca:4056:: with SMTP id n83mr2975600oia.47.1620728574417; Tue, 11 May 2021 03:22:54 -0700 (PDT) MIME-Version: 1.0 References: <20210511100550.28178-1-rppt@kernel.org> <20210511100550.28178-2-rppt@kernel.org> In-Reply-To: <20210511100550.28178-2-rppt@kernel.org> From: Ard Biesheuvel Date: Tue, 11 May 2021 12:22:43 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/4] include/linux/mmzone.h: add documentation for pfn_valid() To: Mike Rapoport Cc: David Hildenbrand , Catalin Marinas , Anshuman Khandual , Linux Kernel Mailing List , Mike Rapoport , Linux Memory Management List , Marc Zyngier , Andrew Morton , Will Deacon , kvmarm , Linux ARM 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 On Tue, 11 May 2021 at 12:06, Mike Rapoport wrote: > > 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 > Reviewed-by: Anshuman Khandual Acked-by: Ard Biesheuvel > --- > include/linux/mmzone.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..e5945ca24df7 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -1427,6 +1427,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=-14.7 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 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 DD42FC433B4 for ; Tue, 11 May 2021 12:54:01 +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 355AD61920 for ; Tue, 11 May 2021 12:54:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 355AD61920 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=46+0s23DIrnd7wx5LFUhNGWu8meu+y7bH5CNRF78nCE=; b=DS4Kw5A6RhhtAyVpkpynZsurl 4Mxa4hkoUtIZofhRY7Fxz+rksLKihGJpU9uXfAGrpjQuxBEhMMOAgrnJHbmj5f73bnPWwFU+arSSG iE57x3hZkbHJyMMM14VOksu4/KtXb7GtKj3LaUqSlBqsk0X/rbLBUG7gA+xhm/Q17Gohq/MqRZkDH VPBWHZdgl/1LM1abq8T95YD5c5wWSXLUTPb8eJY83irzG7R56KlFOri5Q93NA/Llj24MPt/6stzIk I6yX+4/mz1e8COsuKAILxim+BVgEz2qghqA3RLQ0kH52q+teWf4nVFOzcyyTgkG3dJOA3fBsGW3t9 SgcypfLJg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgRs1-00HUxB-T9; Tue, 11 May 2021 12:52:18 +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 1lgPXX-00GuDT-Ip for linux-arm-kernel@desiato.infradead.org; Tue, 11 May 2021 10:22:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cKDSd1U87bRZlDoYprb9BfZAYYOT+54epYQhxtfLHKM=; b=094llQ1Vj9fFXaYncB4FlFAA73 zeLLpx4dFXJ9QCRyhtjJrOTYQAqooa4k61TEFgmrmWNZ6Gn9USsnS6d1loXLWFwc/9FFQ+nR1BxK3 V8C3UbP7elL8Iy5Zyp9/h9s8WXveGtzGe4tDv8X+2Kf5JeoM1/afyPRgWyxBEG3iGnHUUYlr02V1a IN+EA9EcQ+Ay7EuR0cqSBise6NhtE0H7lC0YLY8XItyrG86BbRyf2aj0UFiHckHR6+SN5LukwexG1 6BSAYlFcPmpZLKhY/0gDRbaqKIq23kFG5XI2lw/tLYabhFKteQjsUXBzjDLsCMN9NwULyEtgkR3Xi pVd8gEmg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgPXU-009T74-RQ for linux-arm-kernel@lists.infradead.org; Tue, 11 May 2021 10:22:58 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4B39561938 for ; Tue, 11 May 2021 10:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620728575; bh=8K5/RKVsB4hbF+2S3xYY+Sls7rLDAQAlNlhNK+wAOxM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kfmrEf4UUPFdXmN4bONIkgTnNm+NvLIuA5PwA2CwaYTxb1dDjpb/EJj7jzf3G1lQD nIb8iuIIEgctX84nf+w+HM4ez8mJ8I2el3imHgPUbBrVOHBIYCSrUucrRCUYBIl5sR oj7JeBjGYixV3xnxSGHcew4MdO2AoktCyJG9i3pn4u1nluL9dFAELEUbHsASk0gW3n NYTY2RE4iLWxmPJ9fLRQxFO5luOuFnQa0bVAyXfp9XdxBSCMB/iragnXUtE0mnpeGU RnKVF8Y9kKxgCuDKNkB/rFZ2rYHoOR7Bniz1tPOY9GSnS5n+Of6gvZc4a0k4tcauPY lK2AvxnMfA6Sg== Received: by mail-oi1-f169.google.com with SMTP id z3so17346093oib.5 for ; Tue, 11 May 2021 03:22:55 -0700 (PDT) X-Gm-Message-State: AOAM531nfpWvuCTSDqeCV7k7N5/CfVYH4F4tXPjwkyfNabXiPFMsULvC xBs9usSuhrgqcy5LVhD2B45tvIVviTAMsv6sKTw= X-Google-Smtp-Source: ABdhPJz3X7/zsLxW0acYDilZnZffpfuhhEzj9r12Onr6R0a3ZrPbcEC3CSWgseEdH8CiwuI/0vKICdQkV3hdFyMavwI= X-Received: by 2002:aca:4056:: with SMTP id n83mr2975600oia.47.1620728574417; Tue, 11 May 2021 03:22:54 -0700 (PDT) MIME-Version: 1.0 References: <20210511100550.28178-1-rppt@kernel.org> <20210511100550.28178-2-rppt@kernel.org> In-Reply-To: <20210511100550.28178-2-rppt@kernel.org> From: Ard Biesheuvel Date: Tue, 11 May 2021 12:22:43 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/4] include/linux/mmzone.h: add documentation for pfn_valid() To: Mike Rapoport Cc: Andrew Morton , Anshuman Khandual , Catalin Marinas , David Hildenbrand , Marc Zyngier , Mark Rutland , Mike Rapoport , Will Deacon , kvmarm , Linux ARM , Linux Kernel Mailing List , Linux Memory Management List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210511_032256_987224_BB065DA7 X-CRM114-Status: GOOD ( 21.50 ) 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 On Tue, 11 May 2021 at 12:06, Mike Rapoport wrote: > > 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 > Reviewed-by: Anshuman Khandual Acked-by: Ard Biesheuvel > --- > include/linux/mmzone.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..e5945ca24df7 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -1427,6 +1427,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