From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55E20C79FA0 for ; Tue, 8 Sep 2026 07:48:19 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4hfGJd6LbZz2xqp; Tue, 08 Sep 2026 17:48:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2001:41d0:1004:224b::62" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1788853697; cv=none; b=gYzPFkd7zSOxrmURE5BKgcS8/IsAUkDO+os3XKV+v6Tfg1w/w/+FnR722X7ZAVHxJAM7olMV49k5i/NCAI6dQmPPeqPPD/oSggHEcs/ivc329YyaQa//frzx7O81Q4RUtkp6P3yfBbv8wRp/OkhEcnTBP7xlXavuO8YRxRtc/bSpe0WiuAd41MAS6S52RStWS8XDwpbEEzZFWATWQv3z+IujaVY5UyrtTVM2ZV8tz5+8mwWTe2nrvUNj12PiFMMYuSh0An70XDJX+nHpTNTjxyQDsyhSRYITWttAWePK8StcAX+QLjOlAMDrr2qz1alQvcfo7nZPwPRbmpdldqj6lg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1788853697; c=relaxed/relaxed; bh=sYYxiXN+Hb8rQ6JwFenQMkWjeUMFgmbC7eP4OQjvJIM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RS//4bZlrj3FWbw37/3c0ztgt8ZBEl0GQVGM84ApuXXfmtWet5/db58WsijdhcifID3isf64Q7FaO9OEhZiJ3Nnv3ZkBARYAComZ9JCr4DAuPndTlouow8nurHj+ee1B6lf26LCK1Z/aUuy9Be+fqhwpsVLl5QuK5m02DAs5RBWLqFc+taCR8aw6XnatAenoZ+YGqEoSSGf7FrkBpOwxHmv7H/B5SbBZoLX4tmYdurth0Dh84vaMyveAi5IOXy3+urgxYB7jCCkY+Lwmy+JvRG/ijEzK7aAc1kILuOrYRjJ/60RkvzSOTQi78a7suk652P5WMHjsJe//fslaLJdvfw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.dev; dkim=pass (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=iTVG8KC8; dkim-atps=neutral; spf=pass (client-ip=2001:41d0:1004:224b::62; helo=mta0.migadu.com; envelope-from=qi.zheng@linux.dev; receiver=lists.ozlabs.org) smtp.mailfrom=linux.dev Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=iTVG8KC8; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.dev (client-ip=2001:41d0:1004:224b::62; helo=mta0.migadu.com; envelope-from=qi.zheng@linux.dev; receiver=lists.ozlabs.org) Received: from mta0.migadu.com (out-98.mta0.migadu.com [IPv6:2001:41d0:1004:224b::62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4hfGJT6T6yz2xlJ for ; Tue, 08 Sep 2026 17:48:07 +1000 (AEST) X-Envelope-To: linuxppc-dev@lists.ozlabs.org DKIM-Signature: a=rsa-sha256; bh=ixBAYP3Du6CsKocLljvRGfCjKPRhF0PCatiq8iaNJ/Q=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1788853669; v=1; x=1789458469; b=iTVG8KC8ALl1oRcC03gQibtb/Lg81FKvdtUtdo48mZPJqKsaCtQjIgW0UhNkm18ux58HM24H 1Tm/Tpm9TiWn7GIb1mb6SBY4/9/LrEEDlV/iXy1Gb4mqy+6oY+ogMzoBFK30uRz5GFSpdgy9PIy QqFnK7NXKxB7Cs7CJBaOlZ+A= X-Envelope-To: linuxppc-dev@lists.ozlabs.org Received: by smtp.migadu.com with ESMTPS id 539c04568d93ce89; Tue, 08 Sep 2026 07:46:17 +0000 X-Mizu-Trace-ID: 539c04568d93ce89 X-Migadu-Flow: FLOW_OUT Message-ID: <1fc41803-a0b3-48ca-84a6-caf965fb11f9@linux.dev> Date: Tue, 8 Sep 2026 15:46:08 +0800 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 06/11] mm/sparse-vmemmap: switch device DAX to shared tail vmemmap pages To: Muchun Song , Andrew Morton , David Hildenbrand , Oscar Salvador , Madhavan Srinivasan , Michael Ellerman , Jonathan Corbet Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org, Muchun Song , Lorenzo Stoakes , Mike Rapoport , Nicholas Piggin , Christophe Leroy , Randy Dunlap References: <20260908030335.96549-1-songmuchun@bytedance.com> <20260908030335.96549-7-songmuchun@bytedance.com> From: Qi Zheng In-Reply-To: <20260908030335.96549-7-songmuchun@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/8/26 11:03 AM, Muchun Song wrote: > HugeTLB vmemmap optimization now uses per-zone shared tail vmemmap pages. > Device DAX has not been switched to that mechanism yet. > > Switch device DAX to vmemmap_shared_tail_page() as well. This aligns DAX > with HugeTLB by using the common per-zone shared tail vmemmap page. > > The optimization is enabled only for DEV-DAX through pgmap->vmemmap_shift, > which is assigned when a DEV-DAX device is initialized. Unlike FS-DAX, > DEV-DAX does not modify tail struct pages, so sharing them is safe. Got it — adding this description makes things significantly clearer. > > Since the shared tail page can now back ZONE_DEVICE vmemmap mappings, > initialize its entries with PG_reserved for device zones. Also skip > poisoning vmemmap-optimizable sections while their struct pages may be > shared. > > Signed-off-by: Muchun Song > --- > v2: > - Explain why sharing tail vmemmap pages is safe for DEV-DAX > (suggested by Qi Zheng) > --- > include/linux/mmzone.h | 10 +++++++++ > mm/memory_hotplug.c | 5 +++-- > mm/sparse-vmemmap.c | 47 ++++++++++++++---------------------------- > 3 files changed, 28 insertions(+), 34 deletions(-) > Acked-by: Qi Zheng Thanks, Qi