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 >