lkml.org 
[lkml]   [2019]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: slab: make page_cgroup_ino() to recognize non-compound slab pages properly
Hi Roman,

On Fri, Oct 25, 2019 at 04:27:10PM -0700, Roman Gushchin wrote:
> page_cgroup_ino() doesn't return a valid memcg pointer for non-compund
> slab pages, because it depends on PgHead AND PgSlab flags to be set
> to determine the memory cgroup from the kmem_cache.
> It's correct for compound pages, but not for generic small pages. Those
> don't have PgHead set, so it ends up returning zero.
>
> Fix this by replacing the condition to PageSlab() && !PageTail().

You may also want to update the comment above memcg_from_slab_page():

* So this function assumes that the page can pass PageHead() and PageSlab()
* checks.

\
 
 \ /
  Last update: 2019-10-30 22:05    [W:0.041 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site