All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>,
	mhocko@suse.cz, linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH -mm 3/3] page-cgroup: fix flags definition
Date: Wed, 25 Jun 2014 00:05:26 -0400	[thread overview]
Message-ID: <20140625040526.GR7331@cmpxchg.org> (raw)
In-Reply-To: <20140624162052.6778a13e3b3f4af251e300e7@linux-foundation.org>

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>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>,
	mhocko@suse.cz, linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH -mm 3/3] page-cgroup: fix flags definition
Date: Wed, 25 Jun 2014 00:05:26 -0400	[thread overview]
Message-ID: <20140625040526.GR7331@cmpxchg.org> (raw)
In-Reply-To: <20140624162052.6778a13e3b3f4af251e300e7@linux-foundation.org>

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>

  reply	other threads:[~2014-06-25  4:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 16:33 [PATCH -mm 1/3] page-cgroup: trivial cleanup Vladimir Davydov
2014-06-24 16:33 ` Vladimir Davydov
2014-06-24 16:33 ` [PATCH -mm 2/3] page-cgroup: get rid of NR_PCG_FLAGS Vladimir Davydov
2014-06-24 16:33   ` Vladimir Davydov
2014-06-25  4:01   ` Johannes Weiner
2014-06-25  4:01     ` Johannes Weiner
2014-06-25  6:55   ` Michal Hocko
2014-06-25  6:55     ` Michal Hocko
2014-06-24 16:33 ` [PATCH -mm 3/3] page-cgroup: fix flags definition Vladimir Davydov
2014-06-24 16:33   ` Vladimir Davydov
2014-06-24 23:20   ` Andrew Morton
2014-06-24 23:20     ` Andrew Morton
2014-06-25  4:05     ` Johannes Weiner [this message]
2014-06-25  4:05       ` Johannes Weiner
2014-06-25  6:58   ` Michal Hocko
2014-06-25  6:58     ` Michal Hocko
2014-06-25  4:01 ` [PATCH -mm 1/3] page-cgroup: trivial cleanup Johannes Weiner
2014-06-25  4:01   ` Johannes Weiner
2014-06-25  6:52 ` Michal Hocko
2014-06-25  6:52   ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140625040526.GR7331@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=vdavydov@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.