On Fri, Dec 10, 2021 at 07:26:11PM +0100, Vlastimil Babka wrote: > > Because SLUB and SLAB sets slab->slab_cache = NULL (to set page->mapping = NULL), > > Hm, now that you mention it, maybe it would be better to do a > "folio->mapping = NULL" instead as we now have a more clearer view where we > operate on struct slab, and where we transition between that and a plain > folio. This is IMHO part of preparing the folio for freeing, not a struct > slab cleanup as struct slab doesn't need this cleanup. Yes, I did that as part of "mm/slub: Convert slab freeing to struct slab" in my original series: - __ClearPageSlabPfmemalloc(page); + __slab_clear_pfmemalloc(slab); __ClearPageSlab(page); - /* In union with page->mapping where page allocator expects NULL */ - page->slab_cache = NULL; + page->mapping = NULL;