lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c452d577-a4cc-42aa-b4d9-fe591dc4a315@lucifer.local>
Date: Thu, 28 Aug 2025 15:11:09 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, Zi Yan <ziy@...dia.com>,
        "Mike Rapoport (Microsoft)" <rppt@...nel.org>,
        SeongJae Park <sj@...nel.org>, Huacai Chen <chenhuacai@...nel.org>,
        WANG Xuerui <kernel@...0n.name>,
        Madhavan Srinivasan <maddy@...ux.ibm.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Nicholas Piggin <npiggin@...il.com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
        Alexandre Ghiti <alex@...ti.fr>,
        "David S. Miller" <davem@...emloft.net>,
        Andreas Larsson <andreas@...sler.com>,
        Alexander Potapenko <glider@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Brendan Jackman <jackmanb@...gle.com>,
        Christoph Lameter <cl@...two.org>, Dennis Zhou <dennis@...nel.org>,
        Dmitry Vyukov <dvyukov@...gle.com>, dri-devel@...ts.freedesktop.org,
        intel-gfx@...ts.freedesktop.org, iommu@...ts.linux.dev,
        io-uring@...r.kernel.org, Jason Gunthorpe <jgg@...dia.com>,
        Jens Axboe <axboe@...nel.dk>, Johannes Weiner <hannes@...xchg.org>,
        John Hubbard <jhubbard@...dia.com>, kasan-dev@...glegroups.com,
        kvm@...r.kernel.org, "Liam R. Howlett" <Liam.Howlett@...cle.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-arm-kernel@...s.com, linux-arm-kernel@...ts.infradead.org,
        linux-crypto@...r.kernel.org, linux-ide@...r.kernel.org,
        linux-kselftest@...r.kernel.org, linux-mips@...r.kernel.org,
        linux-mmc@...r.kernel.org, linux-mm@...ck.org,
        linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
        linux-scsi@...r.kernel.org, Marco Elver <elver@...gle.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Michal Hocko <mhocko@...e.com>, Muchun Song <muchun.song@...ux.dev>,
        netdev@...r.kernel.org, Oscar Salvador <osalvador@...e.de>,
        Peter Xu <peterx@...hat.com>, Robin Murphy <robin.murphy@....com>,
        Suren Baghdasaryan <surenb@...gle.com>, Tejun Heo <tj@...nel.org>,
        virtualization@...ts.linux.dev, Vlastimil Babka <vbabka@...e.cz>,
        wireguard@...ts.zx2c4.com, x86@...nel.org
Subject: Re: [PATCH v1 01/36] mm: stop making SPARSEMEM_VMEMMAP
 user-selectable

On Thu, Aug 28, 2025 at 12:01:05AM +0200, David Hildenbrand wrote:
> In an ideal world, we wouldn't have to deal with SPARSEMEM without
> SPARSEMEM_VMEMMAP, but in particular for 32bit SPARSEMEM_VMEMMAP is
> considered too costly and consequently not supported.
>
> However, if an architecture does support SPARSEMEM with
> SPARSEMEM_VMEMMAP, let's forbid the user to disable VMEMMAP: just
> like we already do for arm64, s390 and x86.
>
> So if SPARSEMEM_VMEMMAP is supported, don't allow to use SPARSEMEM without
> SPARSEMEM_VMEMMAP.
>
> This implies that the option to not use SPARSEMEM_VMEMMAP will now be
> gone for loongarch, powerpc, riscv and sparc. All architectures only
> enable SPARSEMEM_VMEMMAP with 64bit support, so there should not really
> be a big downside to using the VMEMMAP (quite the contrary).

Nice!

And I see SPARSEMEM_VMEMMAP_ENABLE is selected by the arches which support it,
as you say 64-bit (or in other words - modern :)

>
> This is a preparation for not supporting
>
> (1) folio sizes that exceed a single memory section
> (2) CMA allocations of non-contiguous page ranges

Nice. This should simplify things... :)

>
> in SPARSEMEM without SPARSEMEM_VMEMMAP configs, whereby we
> want to limit possible impact as much as possible (e.g., gigantic hugetlb
> page allocations suddenly fails).
>
> Acked-by: Zi Yan <ziy@...dia.com>
> Acked-by: Mike Rapoport (Microsoft) <rppt@...nel.org>
> Acked-by: SeongJae Park <sj@...nel.org>
> Cc: Huacai Chen <chenhuacai@...nel.org>
> Cc: WANG Xuerui <kernel@...0n.name>
> Cc: Madhavan Srinivasan <maddy@...ux.ibm.com>
> Cc: Michael Ellerman <mpe@...erman.id.au>
> Cc: Nicholas Piggin <npiggin@...il.com>
> Cc: Christophe Leroy <christophe.leroy@...roup.eu>
> Cc: Paul Walmsley <paul.walmsley@...ive.com>
> Cc: Palmer Dabbelt <palmer@...belt.com>
> Cc: Albert Ou <aou@...s.berkeley.edu>
> Cc: Alexandre Ghiti <alex@...ti.fr>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Andreas Larsson <andreas@...sler.com>
> Signed-off-by: David Hildenbrand <david@...hat.com>

LGTM, so:

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>

> ---
>  mm/Kconfig | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 4108bcd967848..330d0e698ef96 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -439,9 +439,8 @@ config SPARSEMEM_VMEMMAP_ENABLE
>  	bool
>
>  config SPARSEMEM_VMEMMAP
> -	bool "Sparse Memory virtual memmap"
> +	def_bool y
>  	depends on SPARSEMEM && SPARSEMEM_VMEMMAP_ENABLE
> -	default y
>  	help
>  	  SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise
>  	  pfn_to_page and page_to_pfn operations.  This is the most
> --
> 2.50.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ