From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-34.mta0.migadu.com [91.218.175.34]) (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 6B36434B43F for ; Mon, 28 Sep 2026 01:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790560209; cv=none; b=QUPqMQSaXMDta4D23fbVCAZu6ivS6SGGVQPNJ51nhYM9VPzsqfgfwEkaEgr46MFJ2W9JJP7jBoTu/dUsYbZrMUP92+gqxW4Fony81OpQ66rLn2MrWvsm5mesGdg09doJbgylxl2drxG8K/QYOXsmioS0Mm+BJfM2EOXCSd6knxs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790560209; c=relaxed/simple; bh=RAi6LaQaIERnguNa75CIILKwcfJnHB40JrzKtoc+ARQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iJ39G/SIMKjNv1miB9A8vG72qqNbzLeQOZiBxnC0+dgkcEoJncbwpo4ZYwIs0v7PLfTeXSghlt3Uz8HA/BP8NRfAO1BIguD14vFOv5PrtnLBGvV77OSCZf/9mwdNjrUWba9ZkTrX2pENKIokQ8mk6Z9Kl8mq9NR2UWBbbnK3wCg= 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=i642vPZ6; arc=none smtp.client-ip=91.218.175.34 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="i642vPZ6" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=RAi6LaQaIERnguNa75CIILKwcfJnHB40JrzKtoc+ARQ=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1790560205; v=1; x=1791165005; b=i642vPZ6AAFEMsfq6Yf1PfwOeeahFco14EV8Avqv9HTqhooaA2j0gfOA2QJG2ehTPfshwSez DxNTAJZgTXcZiON6+hVgi9VPWLxcNsjHcCenEcJaFQSe9zmWQ2PzWXhqP/mTJqyDyTfZJmFWO7b /zI8ptKsDVXsSm7as7JtU6EA= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id b6a582d4e49657da; Mon, 28 Sep 2026 01:50:02 +0000 X-Mizu-Trace-ID: b6a582d4e49657da X-Migadu-Flow: FLOW_OUT Message-ID: <99cdc0cd-3af1-4d61-af28-47fad8657c62@linux.dev> Date: Mon, 28 Sep 2026 09:49:56 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/6] mm/sparse-vmemmap: support device DAX in common vmemmap path To: Muchun Song , Madhavan Srinivasan , Mike Rapoport , Andrew Morton , David Hildenbrand Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, muchun.song@linux.dev References: <20260924075259.2013039-1-songmuchun@bytedance.com> <20260924075259.2013039-3-songmuchun@bytedance.com> From: Qi Zheng In-Reply-To: <20260924075259.2013039-3-songmuchun@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/24/26 3:52 PM, Muchun Song wrote: > The common vmemmap population path cannot yet handle optimized Device DAX > mappings on its own. It uses pfn_to_zone() to find the shared tail page, > but Device DAX populates its vmemmap at runtime before the ZONE_DEVICE span > is initialized. > > Teach the common path to use device_zone() for runtime optimized vmemmap > population while retaining pfn_to_zone() for early boot. This allows the > same path to support both early boot mappings and Device DAX. > > The backing PFN supplied by the Device DAX-specific population path is no > longer used, allowing the redundant lookup and population code to be > removed later. > > Signed-off-by: Muchun Song > --- > v2: > - Expand comments around slab initialization to explain zone lookup and > page refcounting (suggested by Qi Zheng) > --- > mm/sparse-vmemmap.c | 56 +++++++++++++++++++++++++-------------------- > 1 file changed, 31 insertions(+), 25 deletions(-) Acked-by: Qi Zheng Thanks, Qi