Re: [PATCH v4] memcg: add charging of already allocated slab objects
From: Yosry Ahmed <hidden>
Date: 2024-09-09 17:20:58
Also in:
cgroups, linux-mm, lkml
From: Yosry Ahmed <hidden>
Date: 2024-09-09 17:20:58
Also in:
cgroups, linux-mm, lkml
On Mon, Sep 9, 2024 at 12:59 AM Vlastimil Babka [off-list ref] wrote:
On 9/6/24 19:38, Yosry Ahmed wrote:quoted
quoted
But in case of kmalloc() the allocation must have been still attempted with __GFP_ACCOUNT so a kmalloc-cg cache is used even if the charging fails.It is still possible that the initial allocation did not have __GFP_ACCOUNT, but not from a KMALLOC_NORMAL cache (e.g. KMALLOC_DMA or KMALLOC_RECLAIM). In this case kmem_cache_charge() should still work, right?Yeah it would work, but that's rather a corner case implementation detail so it's better to just require __GFP_ACCOUNT for kmalloc() in the comment.
Fair enough, thanks!