From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CB2519ABD8 for ; Tue, 21 Apr 2026 04:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776744921; cv=none; b=k5f5F8kgjV42UKNN2bXpXZoHDX/a8+CxdXDJjx7jfDkYysl7ZnL6hR4lLc/I5mb+aNLcszNCI+OnLuhwUcQKWHD4hy+cTcXjGKPFAtBVKnyjW9FmJOrr6bCtkirvMkLNZ1uWRoxXpLyL+kHFCOPmAYDC2LlVsdj6g6i4UFcxme8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776744921; c=relaxed/simple; bh=4qyQhpwfs+XU2nyJweiQFgiDnXBixUEJ5CYjjwjJo2I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P4rI5yCaUsG4RxdJfiIv+Kz/aHiW/siYV9+yle8J9Ua/wj60Fu7pyHKRTZ3+lA4igzAXPy4dU0hQfdQuIxrcsx79vEc0J2UG++jRvsAvaMkoMR3vFM7vossOEwmL4Tucc9iYyh6JEsBaObI+lfv/kN4ZZG/hSQuyzK70tWhJK0g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=uS9iGCHG; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=p7mef9cN; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=cpuTQ+E+; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=kOVwBphL; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="uS9iGCHG"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="p7mef9cN"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cpuTQ+E+"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="kOVwBphL" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 081445BCDE; Tue, 21 Apr 2026 04:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1776744918; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uYdfvAwxiyPMyDiaQbfwV8KtgdCe2VZI2NMXSwdaNgE=; b=uS9iGCHGvQBvNjSEu7edu6oNLt8+F8xuB14yELkLOpQXxsadBzPWYhYrLFMWJ5xeP4RXPy 7fK1+lMia3dCqF6jVB1s2fI5UMUZ4ohsPgZkvCopOhhOIWKfQx1tcb/zHmuP0a+DFD3yyP qXGIELXY2L6XxYIpuhKHMEqYU5b2gkg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1776744918; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uYdfvAwxiyPMyDiaQbfwV8KtgdCe2VZI2NMXSwdaNgE=; b=p7mef9cNPGGWOlV5QoGVD8FI4gSIyoIfKK84yBtIOL5JQayGTZOAicEdBbzu9La5ub8ohx jo5vIKxwS5L9X5Cg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=cpuTQ+E+; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=kOVwBphL DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1776744917; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uYdfvAwxiyPMyDiaQbfwV8KtgdCe2VZI2NMXSwdaNgE=; b=cpuTQ+E+r7kTV8su6DV45tSpkDqiqAmOUrQLPENj4/AZz9HS4NLvUWR3OHW35ULaAeCxPE oKRpodFPNyB6j0ipMhOXQ0/Bh61IgyRSZRnHDMqfwsuXp+Gv5FHQve2aC+hX2NAwU7nI9c StPlzoQgu0KV8rWMEml9gGVzcJwxZw4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1776744917; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uYdfvAwxiyPMyDiaQbfwV8KtgdCe2VZI2NMXSwdaNgE=; b=kOVwBphL1mwqz+a1WqHY8SR63zj4AFkCC6JimPdReMUw2CHVWxLTudR1U48kpj8Zu/Dv7g 209xASf4ob/zMYAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3596C593AF; Tue, 21 Apr 2026 04:15:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id XgNfCtT55mlKcQAAD6G6ig (envelope-from ); Tue, 21 Apr 2026 04:15:16 +0000 Date: Tue, 21 Apr 2026 06:15:14 +0200 From: Oscar Salvador To: Muchun Song Cc: Andrew Morton , David Hildenbrand , Muchun Song , 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 Subject: Re: [PATCH v3 4/4] mm/mm_init: Fix pageblock migratetype for ZONE_DEVICE compound pages Message-ID: References: <20260421022044.1217503-1-songmuchun@bytedance.com> <20260421022044.1217503-5-songmuchun@bytedance.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: <20260421022044.1217503-5-songmuchun@bytedance.com> X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[19]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_CC(0.00)[linux-foundation.org,kernel.org,linux.dev,ellerman.id.au,linux.ibm.com,oracle.com,google.com,suse.com,gmail.com,kvack.org,lists.ozlabs.org,vger.kernel.org]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; MISSING_XM_UA(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[bytedance.com:email,suse.de:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,localhost.localdomain:mid] X-Rspamd-Queue-Id: 081445BCDE X-Spam-Flag: NO X-Spam-Score: -4.51 X-Spam-Level: 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. > > 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. > > Fixes: c4386bd8ee3a ("mm/memremap: add ZONE_DEVICE support for compound pages") > Signed-off-by: Muchun Song > Reviewed-by: Mike Rapoport (Microsoft) Would not the call to __init_zone_device_page() from memmap_init_compound() take care of the subsequent pageblocks? -- Oscar Salvador SUSE Labs