[{"id":3673567,"web_url":"http://patchwork.ozlabs.org/comment/3673567/","msgid":"<adJk_W5dA5YRcxOA@kernel.org>","date":"2026-04-05T13:34:53","subject":"Re: [PATCH 00/49] mm: Generalize vmemmap optimization for DAX and\n HugeTLB","submitter":{"id":77733,"url":"http://patchwork.ozlabs.org/api/people/77733/","name":"Mike Rapoport","email":"rppt@kernel.org"},"content":"Hi Muchun,\n\nOn Sun, Apr 05, 2026 at 08:51:51PM +0800, Muchun Song wrote:\n> Overview:\n> This patch series generalizes the HugeTLB Vmemmap Optimization (HVO)\n> into a generic vmemmap optimization framework that can be used by both\n> HugeTLB and DAX.\n> \n> Background:\n> Currently, the vmemmap optimization feature is highly coupled with\n> HugeTLB. However, DAX also has similar requirements for optimizing vmemmap\n> pages to save memory. The current implementation has separate vmemmap\n> optimization paths for HugeTLB and DAX, leading to duplicated logic,\n> complex initialization sequences, and architecture-specific flags.\n> \n> Implementation:\n> This series breaks down the optimization into a generic framework:\n> - Patch 1-6: Fix bugs related to sparse vmemmap initialization and DAX.\n> - Patch 7-13: Refactor the existing sparse vmemmap initialization.\n> - Patch 14-26: Decouple the vmemmap optimization from HugeTLB and\n>   introduce generic optimization macros and functions.\n> - Patch 27-39: Switch HugeTLB and DAX to use the generic framework.\n> - Patch 40-49: Clean up the old HVO-specific code and simplify it.\n> \n> Benifit:\n> - When CONFIG_DEFERRED_STRUCT_PAGE_INIT is disabled, all struct pages\n>   utilizing HVO (HugeTLB Vmemmap Optimization) skip initialization in\n>   memmap_init, significantly accelerating boot times.\n> - All architectures supporting HVO benefit from the optimizations \n>   provided by SPARSEMEM_VMEMMAP_PREINIT without requiring \n>   architecture-specific adaptations.\n> - Device DAX struct page savings are further improved, saving an \n>   additional 4KB of struct page memory for every 2MB huge page.\n> - Vmemmap tail pages used for Device DAX shared mappings are changed \n>   from read-write to read-only, enhancing system security.\n> - HugeTLB and Device DAX now share a unified vmemmap optimization \n>   framework, reducing long-term maintenance overhead.\n\nThis looks very interesting ...\n \n>  32 files changed, 513 insertions(+), 1197 deletions(-)\n\n... and nicely cleaning up things.\n\nThis series is high on my TODO list, but most likely I won't have time for\nproper review until after -rc1.","headers":{"Return-Path":"\n <linuxppc-dev+bounces-19380-incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=JsuR22bB;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19380-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)","lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2600:3c04:e001:324:0:1991:8:25\"","lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org","lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=JsuR22bB;\n\tdkim-atps=neutral","lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org;\n envelope-from=rppt@kernel.org; receiver=lists.ozlabs.org)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fpYNr6NGVz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 23:35:07 +1000 (AEST)","from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fpYNq1Bjtz2yd7;\n\tSun, 05 Apr 2026 23:35:07 +1000 (AEST)","from tor.source.kernel.org (tor.source.kernel.org\n [IPv6:2600:3c04:e001:324:0:1991:8:25])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4fpYNn6hv0z2xSG\n\tfor <linuxppc-dev@lists.ozlabs.org>; Sun, 05 Apr 2026 23:35:05 +1000 (AEST)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id B24FF6001A;\n\tSun,  5 Apr 2026 13:35:02 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 01887C116C6;\n\tSun,  5 Apr 2026 13:34:56 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775396107;\n\tcv=none;\n b=f9HL7oCC8W2We+rJinqslAh4kPzk3RpWttbZAjSzudoqap68vwPFa47KyLnhVDDoWlfBC1r+ShnmAD+dyqt1/AkodqZDBn29wpN/CshZIxKQuU5OfIV5KlppeBY+8agbeUmz8NyWTKT+6M5ritFL+EF/B0cdC7Tr1eP1/emyb9ONLEKQwrhIxN8pNWv4IPsZpIaacfAgiGC8j7Zx3ubQVYaiUgf1eWsswx4/GwlgmS2CEgotjUmz0FXxcYH6FatR4HGPC2WA5JvrFkU1fOSClwrjkS+nqN1gdf+Q0ZGNYLQhKk0EC97U9SxIgVuW+lravxvzYc7gbA1JOibRUoRHAw==","ARC-Message-Signature":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775396107; c=relaxed/relaxed;\n\tbh=OZnLqiy0PDzfsPBn4zElMS+mzPT4ewPLQH6Ie9yANQk=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=CAwF3nVRS4Fp2wSMXfRqxzDX3DxMc/oKu8TPc5Uh+zxIZawpVPHIHkbusiKoIZl/+xlPPdFgRwb5DSvF0OSe8Tpabr/XC4Ao2IeuVSvaAg/D1nJswfDf5jaRKcrQU+rkGcXmHVLhM7sBe2LSEW7fdhtMZMLObZo4Fz4Etimm8+wxJCDun0q9159k9/EuhjCHUeXWD0DDnIYnwPKA7eLxYQUfk7j9WOsicpDN0EJHOWX+7wTGiuCHDYw7FHMvbjOf/gwbAVr56ETJhow9vXB4NSvJkMvTumaRey7Em6Mx38Lqe8LIEusnfhKNREzVLCKejMG597y8l4N4BW1usl7t2w==","ARC-Authentication-Results":"i=1; lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=JsuR22bB; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c04:e001:324:0:1991:8:25;\n helo=tor.source.kernel.org; envelope-from=rppt@kernel.org;\n receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775396102;\n\tbh=WWuKH7V5NGGgAcGyGGVsYW3h6302QQpGr0/S5xsirPA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JsuR22bBOjH3ft1M/WUeMEYQAF6hTu5hn2tzOUD3fMIgLiO98o1NHa9qvmyC0jTqW\n\t sbe+mCcRvf+TA5onjzDvEDuf50nLBngm414f0zKX+a8LOQt0ODkU1gsw3Ocz0QRZ7h\n\t 7w3BsUG3WcylXg33DrqbyD0s94LPdvyCHXIsNddWSFPDM8WQqOKwwZBqpd6yI/1pVo\n\t d4Trlon650nrHqNIoA+M9we70iiCUab6u+0TayT8VqdgXNAs33scs5kHK5as06c2CL\n\t eJPPYetGQNp+OsrDK9Q3fQj5DZ7OK2esPexzi1MFaTcenmV438ealYjg5I5AWH9h5M\n\t 7cOqG8pKzar4Q==","Date":"Sun, 5 Apr 2026 16:34:53 +0300","From":"Mike Rapoport <rppt@kernel.org>","To":"Muchun Song <songmuchun@bytedance.com>","Cc":"Andrew Morton <akpm@linux-foundation.org>,\n\tDavid Hildenbrand <david@kernel.org>,\n\tMuchun Song <muchun.song@linux.dev>,\n\tOscar Salvador <osalvador@suse.de>,\n\tMichael Ellerman <mpe@ellerman.id.au>,\n\tMadhavan Srinivasan <maddy@linux.ibm.com>,\n\tLorenzo Stoakes <ljs@kernel.org>,\n\t\"Liam R . Howlett\" <Liam.Howlett@oracle.com>,\n\tVlastimil Babka <vbabka@kernel.org>,\n\tSuren Baghdasaryan <surenb@google.com>,\n\tMichal Hocko <mhocko@suse.com>, Nicholas Piggin <npiggin@gmail.com>,\n\tChristophe Leroy <chleroy@kernel.org>, aneesh.kumar@linux.ibm.com,\n\tjoao.m.martins@oracle.com, linux-mm@kvack.org,\n\tlinuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org","Subject":"Re: [PATCH 00/49] mm: Generalize vmemmap optimization for DAX and\n HugeTLB","Message-ID":"<adJk_W5dA5YRcxOA@kernel.org>","References":"<20260405125240.2558577-1-songmuchun@bytedance.com>","X-Mailing-List":"linuxppc-dev@lists.ozlabs.org","List-Id":"<linuxppc-dev.lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev+help@lists.ozlabs.org>","List-Owner":"<mailto:linuxppc-dev+owner@lists.ozlabs.org>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Archive":"<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Subscribe":"<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>","List-Unsubscribe":"<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>","Precedence":"list","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20260405125240.2558577-1-songmuchun@bytedance.com>","X-Spam-Status":"No, score=-0.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,\n\tDKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS\n\tautolearn=disabled version=4.0.1 OzLabs 8","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"}}]