On Sat, Dec 23, 2023 at 08:11:11AM +0900, Hyeonggon Yoo wrote: > > + folio = folio_alloc_node(flags, order, node); > > folio_alloc_node() > ->__folio_alloc_node() > ->__folio_alloc() > ->page_rmappable_folio() > ->folio_prep_large_rmappable() > > I think it's not intentional to call this? I've been thinking about this, and obviously I got bitten by two of the meanings of folio (both "not a tail page" and "mmapable memory"). And that leads me to thinking about how this will look when we allocate memdescs separately from pages. I don't think we should try to keep memcg_data at the same offset in struct slab and struct folio (once we're out of our current transitional period). So we need to stop casting from folio to slab and vice versa. Which means that slab can't call __lruvec_stat_mod_folio(). I'll try and get something together to support this, both for the current layout and once memdescs are separated from struct page.