[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64e62982-6d0e-f742-be5c-15390d8e7c2b@intel.com>
Date: Fri, 15 Sep 2023 14:49:52 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Kees Cook <keescook@...omium.org>,
Matteo Rizzo <matteorizzo@...gle.com>
Cc: cl@...ux.com, penberg@...nel.org, rientjes@...gle.com,
iamjoonsoo.kim@....com, akpm@...ux-foundation.org, vbabka@...e.cz,
roman.gushchin@...ux.dev, 42.hyeyoo@...il.com,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-mm@...ck.org, linux-hardening@...r.kernel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
corbet@....net, luto@...nel.org, peterz@...radead.org,
jannh@...gle.com, evn@...gle.com, poprdi@...gle.com,
jordyzomer@...gle.com, ardb@...gle.com
Subject: Re: [RFC PATCH 10/14] x86: Create virtual memory region for SLUB
On 9/15/23 14:13, Kees Cook wrote:
> On Fri, Sep 15, 2023 at 10:59:29AM +0000, Matteo Rizzo wrote:
>> From: Jann Horn <jannh@...gle.com>
>>
>> SLAB_VIRTUAL reserves 512 GiB of virtual memory and uses them for both
>> struct slab and the actual slab memory. The pointers returned by
>> kmem_cache_alloc will point to this range of memory.
>
> I think the 512 GiB limit may be worth mentioning in the Kconfig help
> text.
Yes, please.
> And in the "640K is enough for everything" devil's advocacy, why is 512
> GiB enough here? Is there any greater risk of a pathological allocation
> pattern breaking a system any more (or less) than is currently possible?
I have the feeling folks just grabbed the first big-ish chunk they saw
free in the memory map and stole that one. Not a horrible approach,
mind you, but I have the feeling it didn't go through the most rigorous
sizing procedure. :)
My laptop memory is ~6% consumed by slab, 90% of which is reclaimable.
If a 64TB system had the same ratio, it would bump into this 512GB
limit. But it _should_ just reclaim thing earlier rather than falling over.
That said, we still have gobs of actual vmalloc() space. It's ~30TiB in
size and I'm not aware of anyone consuming anywhere near that much. If
the 512GB fills up somehow, there are other places to steal the space.
One minor concern is that the virtual area is the same size on 4 and
5-level paging systems. It might be a good idea to pick one of the
holes that actually gets bigger on 5-level systems.
Powered by blists - more mailing lists