From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 895BB2D8799 for ; Thu, 12 Feb 2026 08:32:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770885147; cv=none; b=ie3UL1BtYlgvhy36WaQpi8TWBkbczhS54rGewCtFiiUHVTnMTJH6sqExtpS/W3Os1sZOiJyhNNlQMMaDpcHTfu03Vc0AGVVpeo1X6G7i5sSyLH0O+jue3sI9ZWgwuoB8rFW6b0pXtZ16z1qb/AU37zPA9l95OU8foIiJRxNBBAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770885147; c=relaxed/simple; bh=OWrJGgRpkgcwQTK2nv0DrDDpxOSvcGRxA+jICSBwnvE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wf3jguMqPLLayPcWT3KqgNfuE30zgW9b99EvMrCgpTehHo+rMNwvcB43Hw1QTKxXfLJ82Ydx9Ju4xzmvtP8SN/RfVPGmkOMLlJumG/gNhXibgLieB6vMgI8/aCYoRqoCNgX5h61RQ8TwBBchzG7Ooa486xvjo9tGEVlk4bxHdoM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fwK27tqk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fwK27tqk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACDF6C4CEF7; Thu, 12 Feb 2026 08:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770885147; bh=OWrJGgRpkgcwQTK2nv0DrDDpxOSvcGRxA+jICSBwnvE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fwK27tqkjGm4NaxvoxTtkIIZyltPbCMSDbaMEH6zmLpzD8Y6TJIfuFxjqCv4i+3zG mHk46FkLOwdWg2BHhKMStXaILJUBV79jwwgXdIGtCyljh/qmjN8JS03AbW1TsPvL1i Xqn6LtB3u0O3tsOGUX7bzvKEC+MY1zV+vt1D+2uoHAx5W4SxT62OHlZlsSXN/2nZhh W3iioJWs5OtwY3qVII0S/rNvCeQsNvGRKscz7q72STpctfIyIHps5ydtQFXIXsPeeV jHuT77U7O4VLmhLFQDOhA+1Ix4t+d+/wG2yDow6ToUwb2ScQnCyA2NEzm3Ne2DtQvX 7WYchcTBKfmTg== Date: Thu, 12 Feb 2026 10:32:18 +0200 From: Mike Rapoport To: "David Hildenbrand (Arm)" Cc: Tianyou Li , Oscar Salvador , Wei Yang , Michal Hocko , linux-mm@kvack.org, Yong Hu , Nanhai Zou , Yuan Liu , Tim Chen , Qiuxu Zhuo , Yu C Chen , Pan Deng , Chen Zhang , linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 2/2] mm/memory hotplug/unplug: Optimize zone->contiguous update when changes pfn range Message-ID: References: <20260130163756.2674225-1-tianyou.li@intel.com> <20260130163756.2674225-3-tianyou.li@intel.com> <3cb317fa-abe0-4946-9f00-da00bade2def@kernel.org> <6ea2dbce-c919-49d6-b2cb-255a565a94e0@kernel.org> <2cb55d76-4da7-4ebe-b23b-0abbc4d963f3@kernel.org> 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: On Wed, Feb 11, 2026 at 01:19:56PM +0100, David Hildenbrand (Arm) wrote: > > > * > > > + * online_pages is pages within the zone that have an online memmap. > > > + * online_pages include present pages and memory holes that have a > > > + * memmap. When spanned_pages == online_pages, pfn_to_page() can be > > > + * performed without further checks on any pfn within the zone span. > > > > Maybe pages_with_memmap? It would stand off from managed, spanned and > > present, but it's clearer than online IMHO. > > offline pages also have a memmap, but that should not be touched as it might > contain garbage. So it's a bit more tricky :) Naming is hard :) But I still think mentioning memmap there is useful :) > Looking at set_zone_contiguous(), __pageblock_pfn_to_page() takes care of a > weird case where the end of a zone falls into the middle of a pageblock. > > I am not even sure if that is possible It's possible if a pageblock crosses node boundary. We also might add VM_BUG_ON(pageblock_crosses_nodes(), "FIX YOUR FIRMWARE!") there ;-) > but we could handle that easily in pageblock_pfn_to_page() by checking > the requested range against the zone spanned range. Agree. > Then the semantics "zone->online_pages" would be less weird and more closely > resemble "pages with online memmap". > > init_unavailable_range() might indeed do the trick! > > @Tianyou, can you explore that direction? I know, your PTO is coming up. > > -- > Cheers, > > David -- Sincerely yours, Mike.