From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 38FF313D638 for ; Tue, 21 Apr 2026 06:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776754522; cv=none; b=eZVo9DRBOfeR6V7Z1/eFAB8ou6M1Ne/8RuNu9oHqR2xYdt24lNqCQAAlbhrKfg9ZYTL140hBpD9x1POf2ghAI2oTIYf1ZTwwju5XbJ9pdZcdWyw9LKrN56Yqjzoucb7MjDjs3k8Hq6YqjFma3v49VyPH+k4K6CAGF9ptA0ze31Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776754522; c=relaxed/simple; bh=NxUMcETQuixlF3rMQVkit9JIIkPJRX+G/qfMeu7OkdM=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=U+LFuyKdIlNbrwrIT6Mds2wNUQ1f/je/8KkNyws36wU6F2YjQmC1Yhp1wt6ZiCt/CmJ7DPsjF8awOjiW5N45pHTZ1bh40OzHnNjrSkV9Xkjwqj26AfZESS61sKwQo6/WcxmAeF2R2eNDOZMlLhJWQcXmsRZ1KLaCOE3jsHLtNSM= 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=pk7L4Wn0; arc=none smtp.client-ip=95.215.58.178 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="pk7L4Wn0" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1776754518; 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=NxUMcETQuixlF3rMQVkit9JIIkPJRX+G/qfMeu7OkdM=; b=pk7L4Wn0WxtolMrucH5sGuAJaeIzkBSFPNvgmYguRp0KXfsGDOalpq6EmsLz1HMn16rkdY l0JFXPxWXTYv9tEqYaXY7XCrs0hWc13c9n6czix2oXutSiup0LJg5lsBelcDL3AKWYgmYK +n+6x5MrhJgRcfdkMcXYW1/1Aw1QdpI= 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.500.181\)) Subject: Re: [PATCH v3 4/4] mm/mm_init: Fix pageblock migratetype for ZONE_DEVICE compound pages X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: Date: Tue, 21 Apr 2026 14:54:35 +0800 Cc: Muchun Song , Andrew Morton , David Hildenbrand , Michael Ellerman , Madhavan Srinivasan , Mike Rapoport , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Nicholas Piggin , Christophe Leroy , aneesh.kumar@linux.ibm.com, joao.m.martins@oracle.com, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <9343F329-BCD4-4D64-94CB-A94F0E9E4400@linux.dev> References: <20260421022044.1217503-1-songmuchun@bytedance.com> <20260421022044.1217503-5-songmuchun@bytedance.com> To: Oscar Salvador X-Migadu-Flow: FLOW_OUT > On Apr 21, 2026, at 12:15, Oscar Salvador wrote: >=20 > On Tue, Apr 21, 2026 at 10:20:44AM +0800, Muchun Song wrote: >> The memmap_init_zone_device() function only initializes the = migratetype >> of the first pageblock of a compound page. If the compound page size >> exceeds pageblock_nr_pages (e.g., 1GB hugepages with 2MB pageblocks), >> subsequent pageblocks in the compound page remain uninitialized. >>=20 >> Move the migratetype initialization out of __init_zone_device_page() >> and into a separate pageblock_migratetype_init_range() function. This >> iterates over the entire PFN range of the memory, ensuring that all >> pageblocks are correctly initialized. >>=20 >> Fixes: c4386bd8ee3a ("mm/memremap: add ZONE_DEVICE support for = compound pages") >> Signed-off-by: Muchun Song >> Reviewed-by: Mike Rapoport (Microsoft) >=20 > Would not the call to __init_zone_device_page() from > memmap_init_compound() take care of the subsequent pageblocks? >=20 No, it won't handle them automatically, as the page count from compound_nr_pages doesn't cover the following pageblocks. Thanks. Muchun >=20 > --=20 > Oscar Salvador > SUSE Labs