From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B8FA425CF7 for ; Wed, 19 Aug 2026 14:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787151379; cv=none; b=YKSqvo8ZL3Y1B4xbU5aYvNWHK/mBRzJX9plHXGDKQT97/5J0LGc4o1IQ2jGi9C7Jz+fUoVSdwaRHFGK/LvT8zGrAi9NxRg42i8uMyidcO6K38obZ6H6lGiNplQtQjzNIYxdv72sXyBXw35q3piPtPx+LeDCMZlO/GbKnRrVkPQI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787151379; c=relaxed/simple; bh=jebrlGcsMUTid9nmwMvkOaLAdiBkhrlM5Rf4EJThQFo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fkTUu+Y1x/T/CoDfzC5G8Ok5j2UXFYjXE26MU5rQJjofgUWJ1tSgLhxIXJ49PiW1K46scueOpeqTu477nKltCBRXEou578ygbphp1DTnkoninOIpf2PKAtJn1Dc5umMU3XXyCotu7RkuUEQNv+c6tn9gyxJh7B7f3WF4nlrkAog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H7hu6XAQ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H7hu6XAQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2452E1F00A3E; Wed, 19 Aug 2026 14:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787151372; bh=V8WrC7Cinbzn8XacsRY5ky1hgsA1ofrZsYNCBZdrTR8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=H7hu6XAQlGaj6U8q7BwK835aeItmd4QjmvzClJs2EbZmpwE9+VOsR0G0K14C3ihpj cUFc0mmaAqkyHcaYNiYz4Ymm6Mh1MxFR/CCjlB95TtapACDHNu7OwmZecjZvt9Jkrs RY9jHQc81ffHrRsLZZgjJ0Vc4rORC4DAcmhBCkYK7RG8KmVYZRIXiTnd9pRIajwxYu Yi8oMek2rvWBsM2DNv1++FGUe6Z5Z+R7i38L5wyvGAnhfpwQMw22/ysu/CJQu+2kf6 KN2tFN4NGRC0RVaC6HpgJ1cQ4RdgquTZBOCzQGhSWsXrCBHc+gTPjiWmgRGK2xFP99 cloYBj18z91UA== Date: Wed, 19 Aug 2026 17:56:04 +0300 From: Mike Rapoport To: Yuan Liu Cc: David Hildenbrand , Oscar Salvador , Wei Yang , linux-mm@kvack.org, Nanhai Zou , Chen Zhang , Jason Zeng , Chen Yu , Pan Deng , Tianyou Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 2/2] mm/memory_hotplug: optimize zone contiguous check when changing pfn range Message-ID: References: <20260818085702.3395529-1-yuan1.liu@intel.com> <20260818085702.3395529-3-yuan1.liu@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260818085702.3395529-3-yuan1.liu@intel.com> On Tue, Aug 18, 2026 at 04:57:02AM -0400, Yuan Liu wrote: > When move_pfn_range_to_zone() or remove_pfn_range_from_zone() updates a > zone, set_zone_contiguous() rescans the entire zone pageblock-by-pageblock > to rebuild zone->contiguous. For large zones this is a significant cost > during memory hotplug and hot-unplug. > > Add a new zone member, pages_with_online_memmap, that tracks the > number of pages within the zone span that have an online memory map, > including present pages and memory holes whose memory map has been > initialized and for which pfn_to_online_page() succeeds. > > For early boot memory, pages_with_online_memmap is calculated in > memmap_init_zone_range(). PFNs initialized by memmap_init_range() are > included in pages_with_online_memmap, and hole PFNs for which > pfn_to_online_page() succeeds are also counted in > init_unavailable_range(). In what scenario it is possible that pfn_to_online_page() would fail at that point? -- Sincerely yours, Mike.