lkml.org 
[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/4] mm: introduce page memcg flags
On Wed, Sep 30, 2020 at 04:35:37PM -0700, Shakeel Butt wrote:
> On Tue, Sep 29, 2020 at 4:59 PM Roman Gushchin <guro@fb.com> wrote:
> >
> > The lowest bit in page->memcg_data is used to distinguish between
> > struct memory_cgroup pointer and a pointer to a objcgs array.
> > All checks and modifications of this bit are open-coded.
> >
> > Let's formalize it using page memcg flags, defined in enum
> > page_memcg_data_flags.
> >
> > Additional flags might be added later.
> >
> > Signed-off-by: Roman Gushchin <guro@fb.com>
>
> One nit below:
>
> Reviewed-by: Shakeel Butt <shakeelb@google.com>

Thank you!

>
> > ---
> > include/linux/memcontrol.h | 35 ++++++++++++++++++++++++-----------
> > 1 file changed, 24 insertions(+), 11 deletions(-)
> >
> > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> > index d4d15c04bbaf..35f846c6b89b 100644
> > --- a/include/linux/memcontrol.h
> > +++ b/include/linux/memcontrol.h
> > @@ -343,6 +343,15 @@ struct mem_cgroup {
> >
> > extern struct mem_cgroup *root_mem_cgroup;
> >
> > +enum page_memcg_data_flags {
> > + /* page->memcg_data is a pointer to an objcgs vector */
> > + MEMCG_DATA_OBJCGS,
> > + /* the next bit after the last actual flag */
> > + __NR_MEMCG_DATA_FLAGS,
> > +};
> > +
> > +#define MEMCG_DATA_FLAGS_MASK ((0x1UL << __NR_MEMCG_DATA_FLAGS) - 1)
> > +
>
> Nit:
>
> #define PG_MEMCG_OBJCGS (0x1UL << MEMCG_DATA_OBJCGS)
>
> and use this macro below.

Johannes's pushing on defining flags as bit fields, so I'm sending v4 soon.

Thanks!

\
 
 \ /
  Last update: 2020-10-01 01:45    [W:0.053 / U:2.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site