Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3038250pxb; Tue, 12 Jan 2021 05:00:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyadq6wiFeljLK6wx6QOXTvv9OhWDOkMx0WTZ9h+VmcZyCLgOK+GhI6Gu6qlwKpjvHbDMc3 X-Received: by 2002:a17:906:971a:: with SMTP id k26mr3173917ejx.279.1610456449042; Tue, 12 Jan 2021 05:00:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610456449; cv=none; d=google.com; s=arc-20160816; b=wMjm1TgaYADF9nnqBrG03y3nPq+6Dj2NOASm94K0asB3wTW/CgPmZ9756Yssze0V0D mY7ojMLh1iL4KzglCtGOy16oUtEUYu7FTMzrtpPngVnt/KtDbVmw3tXuQ9xbGZ+BG4nf vKGpkXnMAtGKaSF5bBaAbDtt+rlbYU7WlfyLkZuv+oqFV2YCqcseDIPyVB2R4Iu2+UOv EY/woLDrEiu2ngnEejNmVBIRejiuyHrYmNONPIk/v2VpAO3GxmF2Rlko57lwNbqry7Y2 U842YaCi1d5UZRi+hLgPEjg3YAUrCEd8T7g4063vGvNMPr5DtnxO36FDgHy76dwdct7I D6uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KdjpvaY7cHdedjtO5r22fCMOMDStWBNhgD7WF8Y7kiY=; b=doMGgBM7/QjmEcJa5w/tXtroZTOKddUl9ZcvY5eqvoEcQZGLcElsFojNns3wC5Cxyh HEov3fKUF0kxR8jMeFK/v0UJMT84VmEy8IxfGU2an8TTkGjA8boxaxXoj7/2uVpKHZX4 aR/sJsdRus0DHjTnUvN+yycOatN6L1Dt0O9b6ve1raQ1xJN/jJu6pynOhfHy7EwAHtP6 96yxQvS0v+ozP3YQqSokIAsxLP8K6PseBOa1SlLqc8daryUbZwq8lT7D+fk8y+WIP9Zp vqJA0ebTJ+MnwlteODdXwNg7J5BOD04fTnba1k8WGImiuXLfNKBZadSf4UGF96LMV8/6 eaOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si1291057eds.248.2021.01.12.05.00.24; Tue, 12 Jan 2021 05:00:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728224AbhALKtG (ORCPT + 99 others); Tue, 12 Jan 2021 05:49:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:50116 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbhALKtG (ORCPT ); Tue, 12 Jan 2021 05:49:06 -0500 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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