Re: [RFC PATCH 04/14] mm: use virt_to_slab instead of folio_slab

From: Kees Cook
Date: Fri Sep 15 2023 - 17:02:24 EST


On Fri, Sep 15, 2023 at 10:59:23AM +0000, Matteo Rizzo wrote:
> From: Jann Horn <jannh@xxxxxxxxxx>
>
> This is refactoring in preparation for the introduction of SLAB_VIRTUAL
> which does not implement folio_slab.
>
> With SLAB_VIRTUAL there is no longer a 1:1 correspondence between slabs
> and pages of physical memory used by the slab allocator. There is no way
> to look up the slab which corresponds to a specific page of physical
> memory without iterating over all slabs or over the page tables. Instead
> of doing that, we can look up the slab starting from its virtual address
> which can still be performed cheaply with both SLAB_VIRTUAL enabled and
> disabled.
>
> Signed-off-by: Jann Horn <jannh@xxxxxxxxxx>

Refactoring continues to track.

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

--
Kees Cook