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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 ACE75C433DB for ; Tue, 12 Jan 2021 10:48:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3F80023109 for ; Tue, 12 Jan 2021 10:48:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F80023109 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7A8638D008C; Tue, 12 Jan 2021 05:48:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 756386B0289; Tue, 12 Jan 2021 05:48:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66B4F8D008C; Tue, 12 Jan 2021 05:48:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 4DB616B0288 for ; Tue, 12 Jan 2021 05:48:27 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 196D1824805A for ; Tue, 12 Jan 2021 10:48:27 +0000 (UTC) X-FDA: 77696799054.22.pig78_0f0454b27514 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id F068718038E60 for ; Tue, 12 Jan 2021 10:48:26 +0000 (UTC) X-HE-Tag: pig78_0f0454b27514 X-Filterd-Recvd-Size: 2594 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 10:48:26 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 77524AD18; Tue, 12 Jan 2021 10:48:25 +0000 (UTC) Date: Tue, 12 Jan 2021 11:48:23 +0100 From: Oscar Salvador To: David Hildenbrand Cc: Dan Williams , linux-mm@kvack.org, Qian Cai , Michal Hocko , vishal.l.verma@intel.com, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, Anshuman Khandual Subject: Re: [PATCH v2 2/5] mm: Teach pfn_to_online_page() to consider subsection validity Message-ID: <20210112104817.GA12956@linux> References: <161044407603.1482714.16630477578392768273.stgit@dwillia2-desk3.amr.corp.intel.com> <161044408728.1482714.9086710868634042303.stgit@dwillia2-desk3.amr.corp.intel.com> <0586c562-787c-4872-4132-18a49c3ffc8e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0586c562-787c-4872-4132-18a49c3ffc8e@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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, Jan 12, 2021 at 10:53:17AM +0100, David Hildenbrand wrote: > That's not sufficient for alternative implementations of pfn_valid(). > > You still need some kind of pfn_valid(pfn) for alternative versions of > pfn_valid(). Consider arm64 memory holes in the memmap. See their > current (yet to be fixed/reworked) pfn_valid() implementation. > (pfn_valid_within() is implicitly active on arm64) > > Actually, I think we should add something like the following, to make > this clearer (pfn_valid_within() is confusing) > > #ifdef CONFIG_HAVE_ARCH_PFN_VALID > /* We might have to check for holes inside the memmap. */ > if (!pfn_valid()) > return NULL; > #endif I have to confess that I was a bit confused by pfn_valid_within + HOLES_IN_ZONES + HAVE_ARCH_PFN_VALID. At first I thought that we should stick with pfn_valid_within, as we also depend on HOLES_IN_ZONES, so it could be that if (IS_ENABLED(CONFIG_HAVE_ARCH_PFN_VALID)) ... would to too much work, as if CONFIG_HOLES_IN_ZONES was not set but an arch pfn_valid was provided, we would perform unedeed checks. But on a closer look, CONFIG_HOLES_IN_ZONES is set by default on arm64, and on ia64 when SPARSEMEM is set, so looks fine. -- Oscar Salvador SUSE L3