lkml.org 
[lkml]   [2014]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm 3/3] page-cgroup: fix flags definition
On Tue, Jun 24, 2014 at 04:20:52PM -0700, Andrew Morton wrote:
> On Tue, 24 Jun 2014 20:33:06 +0400 Vladimir Davydov <vdavydov@parallels.com> wrote:
>
> > Since commit a9ce315aaec1f ("mm: memcontrol: rewrite uncharge API"),
> > PCG_* flags are used as bit masks, but they are still defined in a enum
> > as bit numbers. Fix it.
> >
> > ...
> >
> > --- a/include/linux/page_cgroup.h
> > +++ b/include/linux/page_cgroup.h
> > @@ -1,12 +1,10 @@
> > #ifndef __LINUX_PAGE_CGROUP_H
> > #define __LINUX_PAGE_CGROUP_H
> >
> > -enum {
> > - /* flags for mem_cgroup */
> > - PCG_USED, /* This page is charged to a memcg */
> > - PCG_MEM, /* This page holds a memory charge */
> > - PCG_MEMSW, /* This page holds a memory+swap charge */
> > -};
> > +/* flags for mem_cgroup */
> > +#define PCG_USED 0x01 /* This page is charged to a memcg */
> > +#define PCG_MEM 0x02 /* This page holds a memory charge */
> > +#define PCG_MEMSW 0x04 /* This page holds a memory+swap charge */
> >
> > struct pglist_data;
> >
> > @@ -44,7 +42,7 @@ struct page *lookup_cgroup_page(struct page_cgroup *pc);
> >
> > static inline int PageCgroupUsed(struct page_cgroup *pc)
> > {
> > - return test_bit(PCG_USED, &pc->flags);
> > + return !!(pc->flags & PCG_USED);
> > }
> > #else /* !CONFIG_MEMCG */
> > struct page_cgroup;
>
> hm, yes, whoops. I think I'll redo this as a fix against
> mm-memcontrol-rewrite-uncharge-api.patch:

Ouch, yes please. Thanks for catching this, Vladimir.

Acked-by: Johannes Weiner <hannes@cmpxchg.org>


\
 
 \ /
  Last update: 2014-06-25 06:46    [W:0.169 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site