From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta1.migadu.com (mta1.migadu.com [37.59.57.117]) (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 1199D347BAF for ; Tue, 11 Aug 2026 03:40:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.59.57.117 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786419658; cv=none; b=PedYe7c+pnvKgOwjhfvs7dglrIL7VHYuvO/0rn1ygEuESNAqmJRhLwuViCAry7bH5aS1WkufdCdusxcL9OZk6KvYJCrvGY2mZ8GOLfI9AkmEfv4uIWvWLNxJNOVaRl1EMef+YUDS21FBvKNG/Jq3SzoXNBmMOgysw291qVw3Xx8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786419658; c=relaxed/simple; bh=mbRXvcwXHyg61cQb84dG15U90Jf7lPJ0OymSALgh5ZQ=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=svNyKYuBCO02Xk+YdxU7jBnim0XI/0uoEf5MEc6VCyhTi1S78HlLPAnPFmx40BAC3HPKGiQOhjQtCt4N2ANTdvJLQ0FU4G5tDBaWX4Gp00o3lgfiT+Ny8z8pHH8zj8PZE39k1nItudB4KyizfqLmPVkEZi9ErKN5SZsGPdKzO5Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=owwF8cog; arc=none smtp.client-ip=37.59.57.117 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="owwF8cog" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786419654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BTISO9RnoqUtAb9p7G8hDIEEL3dlWgZWk60pW4cP7tY=; b=owwF8cog8cfLuw1hrPJLGKGk11LYGONgrmm2OsRDLqFc6jbkInni2vOgkq1PpKGwO0g1dZ amQD9vOLPJUGQBem7OHcoJfRdCQd/qlyAOT2YBMBTcv3hUpvROW/SVH8i23SHWJ4ghg1xG jQ+spXhgjcBe3B46I154hXG8vLSRe4k= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: [PATCH v3 03/17] mm/mm_init: skip initializing shared vmemmap tail pages X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20260804035535.2846016-4-songmuchun@bytedance.com> Date: Tue, 11 Aug 2026 11:40:35 +0800 Cc: Andrew Morton , Oscar Salvador , David Hildenbrand , Mike Rapoport , Vlastimil Babka , Lorenzo Stoakes , Michal Hocko , David Laight , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: References: <20260804035535.2846016-1-songmuchun@bytedance.com> <20260804035535.2846016-4-songmuchun@bytedance.com> To: Muchun Song X-Migadu-Flow: FLOW_OUT > On Aug 4, 2026, at 11:55, Muchun Song wrote: > > memmap_init_range() initializes every struct page in the target range. > For compound pages with vmemmap optimization, the tail struct pages are > backed by a shared vmemmap page. > > Initializing those tail struct pages would overwrite the shared > vmemmap page contents, requiring users such as HugeTLB to restore the > metadata afterwards. > > Track the compound order for HVO-backed sections and use that metadata > to detect struct pages that fall into the shared tail vmemmap range. > Skip those shared tail pages in memmap_init_range(), then initialize > pageblock migratetypes for the processed range with a helper after the > per-page initialization loop. > > Keep direct mem_section access inside sparse helpers by exposing > pfn_to_section_order() to users that only need the order associated with > a PFN. This lets memmap_init_range() skip shared tail vmemmap pages > without exposing __pfn_to_section() to !SPARSEMEM builds. > > This is a preparatory change for consolidating handling across users of > vmemmap optimization, and it also avoids redundant initialization of > shared tail vmemmap pages during early boot. > > Signed-off-by: Muchun Song Sashiko said there is a missing assignment for the new order field in struct mem_section. This is just an observation, not an issue, because assignment is placed in patch 10. There's no extra action to take for this report. Thanks.