All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm 1/3] page-cgroup: trivial cleanup
@ 2014-06-24 16:33 ` Vladimir Davydov
  0 siblings, 0 replies; 20+ messages in thread
From: Vladimir Davydov @ 2014-06-24 16:33 UTC (permalink / raw)
  To: akpm; +Cc: hannes, mhocko, linux-kernel, linux-mm

Add forward declarations for struct pglist_data, mem_cgroup.

Remove __init, __meminit from function prototypes and inline functions.

Remove redundant inclusion of bit_spinlock.h.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
 include/linux/page_cgroup.h |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 97b5c39a31c8..23863edb95ff 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -12,8 +12,10 @@ enum {
 #ifndef __GENERATING_BOUNDS_H
 #include <generated/bounds.h>
 
+struct pglist_data;
+
 #ifdef CONFIG_MEMCG
-#include <linux/bit_spinlock.h>
+struct mem_cgroup;
 
 /*
  * Page Cgroup can be considered as an extended mem_map.
@@ -27,16 +29,16 @@ struct page_cgroup {
 	struct mem_cgroup *mem_cgroup;
 };
 
-void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat);
+extern void pgdat_page_cgroup_init(struct pglist_data *pgdat);
 
 #ifdef CONFIG_SPARSEMEM
-static inline void __init page_cgroup_init_flatmem(void)
+static inline void page_cgroup_init_flatmem(void)
 {
 }
-extern void __init page_cgroup_init(void);
+extern void page_cgroup_init(void);
 #else
-void __init page_cgroup_init_flatmem(void);
-static inline void __init page_cgroup_init(void)
+extern void page_cgroup_init_flatmem(void);
+static inline void page_cgroup_init(void)
 {
 }
 #endif
@@ -48,11 +50,10 @@ static inline int PageCgroupUsed(struct page_cgroup *pc)
 {
 	return test_bit(PCG_USED, &pc->flags);
 }
-
-#else /* CONFIG_MEMCG */
+#else /* !CONFIG_MEMCG */
 struct page_cgroup;
 
-static inline void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat)
+static inline void pgdat_page_cgroup_init(struct pglist_data *pgdat)
 {
 }
 
@@ -65,10 +66,9 @@ static inline void page_cgroup_init(void)
 {
 }
 
-static inline void __init page_cgroup_init_flatmem(void)
+static inline void page_cgroup_init_flatmem(void)
 {
 }
-
 #endif /* CONFIG_MEMCG */
 
 #include <linux/swap.h>
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH -mm 1/3] page-cgroup: trivial cleanup
@ 2014-06-24 16:33 ` Vladimir Davydov
  0 siblings, 0 replies; 20+ messages in thread
From: Vladimir Davydov @ 2014-06-24 16:33 UTC (permalink / raw)
  To: akpm; +Cc: hannes, mhocko, linux-kernel, linux-mm

Add forward declarations for struct pglist_data, mem_cgroup.

Remove __init, __meminit from function prototypes and inline functions.

Remove redundant inclusion of bit_spinlock.h.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
 include/linux/page_cgroup.h |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 97b5c39a31c8..23863edb95ff 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -12,8 +12,10 @@ enum {
 #ifndef __GENERATING_BOUNDS_H
 #include <generated/bounds.h>
 
+struct pglist_data;
+
 #ifdef CONFIG_MEMCG
-#include <linux/bit_spinlock.h>
+struct mem_cgroup;
 
 /*
  * Page Cgroup can be considered as an extended mem_map.
@@ -27,16 +29,16 @@ struct page_cgroup {
 	struct mem_cgroup *mem_cgroup;
 };
 
-void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat);
+extern void pgdat_page_cgroup_init(struct pglist_data *pgdat);
 
 #ifdef CONFIG_SPARSEMEM
-static inline void __init page_cgroup_init_flatmem(void)
+static inline void page_cgroup_init_flatmem(void)
 {
 }
-extern void __init page_cgroup_init(void);
+extern void page_cgroup_init(void);
 #else
-void __init page_cgroup_init_flatmem(void);
-static inline void __init page_cgroup_init(void)
+extern void page_cgroup_init_flatmem(void);
+static inline void page_cgroup_init(void)
 {
 }
 #endif
@@ -48,11 +50,10 @@ static inline int PageCgroupUsed(struct page_cgroup *pc)
 {
 	return test_bit(PCG_USED, &pc->flags);
 }
-
-#else /* CONFIG_MEMCG */
+#else /* !CONFIG_MEMCG */
 struct page_cgroup;
 
-static inline void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat)
+static inline void pgdat_page_cgroup_init(struct pglist_data *pgdat)
 {
 }
 
@@ -65,10 +66,9 @@ static inline void page_cgroup_init(void)
 {
 }
 
-static inline void __init page_cgroup_init_flatmem(void)
+static inline void page_cgroup_init_flatmem(void)
 {
 }
-
 #endif /* CONFIG_MEMCG */
 
 #include <linux/swap.h>
-- 
1.7.10.4

--
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>

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH -mm 2/3] page-cgroup: get rid of NR_PCG_FLAGS
  2014-06-24 16:33 ` Vladimir Davydov
@ 2014-06-24 16:33   ` Vladimir Davydov
  -1 siblings, 0 replies; 20+ messages in thread
From: Vladimir Davydov @ 2014-06-24 16:33 UTC (permalink / raw)
  To: akpm; +Cc: hannes, mhocko, linux-kernel, linux-mm

It's not used anywhere today, so let's remove it.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
 include/linux/page_cgroup.h |    6 ------
 kernel/bounds.c             |    2 --
 2 files changed, 8 deletions(-)

diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 23863edb95ff..fb60e4a466c0 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -6,12 +6,8 @@ enum {
 	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 */
-	__NR_PCG_FLAGS,
 };
 
-#ifndef __GENERATING_BOUNDS_H
-#include <generated/bounds.h>
-
 struct pglist_data;
 
 #ifdef CONFIG_MEMCG
@@ -107,6 +103,4 @@ static inline void swap_cgroup_swapoff(int type)
 
 #endif /* CONFIG_MEMCG_SWAP */
 
-#endif /* !__GENERATING_BOUNDS_H */
-
 #endif /* __LINUX_PAGE_CGROUP_H */
diff --git a/kernel/bounds.c b/kernel/bounds.c
index 9fd4246b04b8..e1d1d1952bfa 100644
--- a/kernel/bounds.c
+++ b/kernel/bounds.c
@@ -9,7 +9,6 @@
 #include <linux/page-flags.h>
 #include <linux/mmzone.h>
 #include <linux/kbuild.h>
-#include <linux/page_cgroup.h>
 #include <linux/log2.h>
 #include <linux/spinlock_types.h>
 
@@ -18,7 +17,6 @@ void foo(void)
 	/* The enum constants to put into include/generated/bounds.h */
 	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
 	DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
-	DEFINE(NR_PCG_FLAGS, __NR_PCG_FLAGS);
 #ifdef CONFIG_SMP
 	DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));
 #endif
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH -mm 2/3] page-cgroup: get rid of NR_PCG_FLAGS
@ 2014-06-24 16:33   ` Vladimir Davydov
  0 siblings, 0 replies; 20+ messages in thread
From: Vladimir Davydov @ 2014-06-24 16:33 UTC (permalink / raw)
  To: akpm; +Cc: hannes, mhocko, linux-kernel, linux-mm

It's not used anywhere today, so let's remove it.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
 include/linux/page_cgroup.h |    6 ------
 kernel/bounds.c             |    2 --
 2 files changed, 8 deletions(-)

diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 23863edb95ff..fb60e4a466c0 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -6,12 +6,8 @@ enum {
 	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 */
-	__NR_PCG_FLAGS,
 };
 
-#ifndef __GENERATING_BOUNDS_H
-#include <generated/bounds.h>
-
 struct pglist_data;
 
 #ifdef CONFIG_MEMCG
@@ -107,6 +103,4 @@ static inline void swap_cgroup_swapoff(int type)
 
 #endif /* CONFIG_MEMCG_SWAP */
 
-#endif /* !__GENERATING_BOUNDS_H */
-
 #endif /* __LINUX_PAGE_CGROUP_H */
diff --git a/kernel/bounds.c b/kernel/bounds.c
index 9fd4246b04b8..e1d1d1952bfa 100644
--- a/kernel/bounds.c
+++ b/kernel/bounds.c
@@ -9,7 +9,6 @@
 #include <linux/page-flags.h>
 #include <linux/mmzone.h>
 #include <linux/kbuild.h>
-#include <linux/page_cgroup.h>
 #include <linux/log2.h>
 #include <linux/spinlock_types.h>
 
@@ -18,7 +17,6 @@ void foo(void)
 	/* The enum constants to put into include/generated/bounds.h */
 	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
 	DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
-	DEFINE(NR_PCG_FLAGS, __NR_PCG_FLAGS);
 #ifdef CONFIG_SMP
 	DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));
 #endif
-- 
1.7.10.4

--
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>

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH -mm 3/3] page-cgroup: fix flags definition
  2014-06-24 16:33 ` Vladimir Davydov
@ 2014-06-24 16:33   ` Vladimir Davydov
  -1 siblings, 0 replies; 20+ messages in thread
From: Vladimir Davydov @ 2014-06-24 16:33 UTC (permalink / raw)
  To: akpm; +Cc: hannes, mhocko, linux-kernel, linux-mm

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.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
 include/linux/page_cgroup.h |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index fb60e4a466c0..9065a61345a1 100644
--- 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;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH -mm 3/3] page-cgroup: fix flags definition
@ 2014-06-24 16:33   ` Vladimir Davydov
  0 siblings, 0 replies; 20+ messages in thread
From: Vladimir Davydov @ 2014-06-24 16:33 UTC (permalink / raw)
  To: akpm; +Cc: hannes, mhocko, linux-kernel, linux-mm

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.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
 include/linux/page_cgroup.h |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index fb60e4a466c0..9065a61345a1 100644
--- 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;
-- 
1.7.10.4

--
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>

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 3/3] page-cgroup: fix flags definition
  2014-06-24 16:33   ` Vladimir Davydov
@ 2014-06-24 23:20     ` Andrew Morton
  -1 siblings, 0 replies; 20+ messages in thread
From: Andrew Morton @ 2014-06-24 23:20 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: hannes, mhocko, linux-kernel, linux-mm

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:

--- a/include/linux/page_cgroup.h~page-cgroup-fix-flags-definition
+++ a/include/linux/page_cgroup.h
@@ -3,9 +3,9 @@
 
 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 */
+	PCG_USED = 0x01,	/* This page is charged to a memcg */
+	PCG_MEM = 0x02,		/* This page holds a memory charge */
+	PCG_MEMSW = 0x04,	/* This page holds a memory+swap charge */
 	__NR_PCG_FLAGS,
 };
 
@@ -46,7 +46,7 @@ struct page *lookup_cgroup_page(struct p
 
 static inline int PageCgroupUsed(struct page_cgroup *pc)
 {
-	return test_bit(PCG_USED, &pc->flags);
+	return !!(pc->flags & PCG_USED);
 }
 
 #else /* CONFIG_MEMCG */
_


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 3/3] page-cgroup: fix flags definition
@ 2014-06-24 23:20     ` Andrew Morton
  0 siblings, 0 replies; 20+ messages in thread
From: Andrew Morton @ 2014-06-24 23:20 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: hannes, mhocko, linux-kernel, linux-mm

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:

--- a/include/linux/page_cgroup.h~page-cgroup-fix-flags-definition
+++ a/include/linux/page_cgroup.h
@@ -3,9 +3,9 @@
 
 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 */
+	PCG_USED = 0x01,	/* This page is charged to a memcg */
+	PCG_MEM = 0x02,		/* This page holds a memory charge */
+	PCG_MEMSW = 0x04,	/* This page holds a memory+swap charge */
 	__NR_PCG_FLAGS,
 };
 
@@ -46,7 +46,7 @@ struct page *lookup_cgroup_page(struct p
 
 static inline int PageCgroupUsed(struct page_cgroup *pc)
 {
-	return test_bit(PCG_USED, &pc->flags);
+	return !!(pc->flags & PCG_USED);
 }
 
 #else /* CONFIG_MEMCG */
_

--
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>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 1/3] page-cgroup: trivial cleanup
  2014-06-24 16:33 ` Vladimir Davydov
@ 2014-06-25  4:01   ` Johannes Weiner
  -1 siblings, 0 replies; 20+ messages in thread
From: Johannes Weiner @ 2014-06-25  4:01 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, mhocko, linux-kernel, linux-mm

On Tue, Jun 24, 2014 at 08:33:04PM +0400, Vladimir Davydov wrote:
> Add forward declarations for struct pglist_data, mem_cgroup.
> 
> Remove __init, __meminit from function prototypes and inline functions.
> 
> Remove redundant inclusion of bit_spinlock.h.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 1/3] page-cgroup: trivial cleanup
@ 2014-06-25  4:01   ` Johannes Weiner
  0 siblings, 0 replies; 20+ messages in thread
From: Johannes Weiner @ 2014-06-25  4:01 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, mhocko, linux-kernel, linux-mm

On Tue, Jun 24, 2014 at 08:33:04PM +0400, Vladimir Davydov wrote:
> Add forward declarations for struct pglist_data, mem_cgroup.
> 
> Remove __init, __meminit from function prototypes and inline functions.
> 
> Remove redundant inclusion of bit_spinlock.h.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

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>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 2/3] page-cgroup: get rid of NR_PCG_FLAGS
  2014-06-24 16:33   ` Vladimir Davydov
@ 2014-06-25  4:01     ` Johannes Weiner
  -1 siblings, 0 replies; 20+ messages in thread
From: Johannes Weiner @ 2014-06-25  4:01 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, mhocko, linux-kernel, linux-mm

On Tue, Jun 24, 2014 at 08:33:05PM +0400, Vladimir Davydov wrote:
> It's not used anywhere today, so let's remove it.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 2/3] page-cgroup: get rid of NR_PCG_FLAGS
@ 2014-06-25  4:01     ` Johannes Weiner
  0 siblings, 0 replies; 20+ messages in thread
From: Johannes Weiner @ 2014-06-25  4:01 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, mhocko, linux-kernel, linux-mm

On Tue, Jun 24, 2014 at 08:33:05PM +0400, Vladimir Davydov wrote:
> It's not used anywhere today, so let's remove it.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

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>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 3/3] page-cgroup: fix flags definition
  2014-06-24 23:20     ` Andrew Morton
@ 2014-06-25  4:05       ` Johannes Weiner
  -1 siblings, 0 replies; 20+ messages in thread
From: Johannes Weiner @ 2014-06-25  4:05 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Vladimir Davydov, mhocko, linux-kernel, linux-mm

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>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 3/3] page-cgroup: fix flags definition
@ 2014-06-25  4:05       ` Johannes Weiner
  0 siblings, 0 replies; 20+ messages in thread
From: Johannes Weiner @ 2014-06-25  4:05 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Vladimir Davydov, mhocko, linux-kernel, linux-mm

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>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 1/3] page-cgroup: trivial cleanup
  2014-06-24 16:33 ` Vladimir Davydov
@ 2014-06-25  6:52   ` Michal Hocko
  -1 siblings, 0 replies; 20+ messages in thread
From: Michal Hocko @ 2014-06-25  6:52 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, hannes, linux-kernel, linux-mm

On Tue 24-06-14 20:33:04, Vladimir Davydov wrote:
> Add forward declarations for struct pglist_data, mem_cgroup.
> 
> Remove __init, __meminit from function prototypes and inline functions.
> 
> Remove redundant inclusion of bit_spinlock.h.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
>  include/linux/page_cgroup.h |   22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
> index 97b5c39a31c8..23863edb95ff 100644
> --- a/include/linux/page_cgroup.h
> +++ b/include/linux/page_cgroup.h
> @@ -12,8 +12,10 @@ enum {
>  #ifndef __GENERATING_BOUNDS_H
>  #include <generated/bounds.h>
>  
> +struct pglist_data;
> +
>  #ifdef CONFIG_MEMCG
> -#include <linux/bit_spinlock.h>
> +struct mem_cgroup;
>  
>  /*
>   * Page Cgroup can be considered as an extended mem_map.
> @@ -27,16 +29,16 @@ struct page_cgroup {
>  	struct mem_cgroup *mem_cgroup;
>  };
>  
> -void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat);
> +extern void pgdat_page_cgroup_init(struct pglist_data *pgdat);
>  
>  #ifdef CONFIG_SPARSEMEM
> -static inline void __init page_cgroup_init_flatmem(void)
> +static inline void page_cgroup_init_flatmem(void)
>  {
>  }
> -extern void __init page_cgroup_init(void);
> +extern void page_cgroup_init(void);
>  #else
> -void __init page_cgroup_init_flatmem(void);
> -static inline void __init page_cgroup_init(void)
> +extern void page_cgroup_init_flatmem(void);
> +static inline void page_cgroup_init(void)
>  {
>  }
>  #endif
> @@ -48,11 +50,10 @@ static inline int PageCgroupUsed(struct page_cgroup *pc)
>  {
>  	return test_bit(PCG_USED, &pc->flags);
>  }
> -
> -#else /* CONFIG_MEMCG */
> +#else /* !CONFIG_MEMCG */
>  struct page_cgroup;
>  
> -static inline void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat)
> +static inline void pgdat_page_cgroup_init(struct pglist_data *pgdat)
>  {
>  }
>  
> @@ -65,10 +66,9 @@ static inline void page_cgroup_init(void)
>  {
>  }
>  
> -static inline void __init page_cgroup_init_flatmem(void)
> +static inline void page_cgroup_init_flatmem(void)
>  {
>  }
> -
>  #endif /* CONFIG_MEMCG */
>  
>  #include <linux/swap.h>
> -- 
> 1.7.10.4
> 

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 1/3] page-cgroup: trivial cleanup
@ 2014-06-25  6:52   ` Michal Hocko
  0 siblings, 0 replies; 20+ messages in thread
From: Michal Hocko @ 2014-06-25  6:52 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, hannes, linux-kernel, linux-mm

On Tue 24-06-14 20:33:04, Vladimir Davydov wrote:
> Add forward declarations for struct pglist_data, mem_cgroup.
> 
> Remove __init, __meminit from function prototypes and inline functions.
> 
> Remove redundant inclusion of bit_spinlock.h.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
>  include/linux/page_cgroup.h |   22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
> index 97b5c39a31c8..23863edb95ff 100644
> --- a/include/linux/page_cgroup.h
> +++ b/include/linux/page_cgroup.h
> @@ -12,8 +12,10 @@ enum {
>  #ifndef __GENERATING_BOUNDS_H
>  #include <generated/bounds.h>
>  
> +struct pglist_data;
> +
>  #ifdef CONFIG_MEMCG
> -#include <linux/bit_spinlock.h>
> +struct mem_cgroup;
>  
>  /*
>   * Page Cgroup can be considered as an extended mem_map.
> @@ -27,16 +29,16 @@ struct page_cgroup {
>  	struct mem_cgroup *mem_cgroup;
>  };
>  
> -void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat);
> +extern void pgdat_page_cgroup_init(struct pglist_data *pgdat);
>  
>  #ifdef CONFIG_SPARSEMEM
> -static inline void __init page_cgroup_init_flatmem(void)
> +static inline void page_cgroup_init_flatmem(void)
>  {
>  }
> -extern void __init page_cgroup_init(void);
> +extern void page_cgroup_init(void);
>  #else
> -void __init page_cgroup_init_flatmem(void);
> -static inline void __init page_cgroup_init(void)
> +extern void page_cgroup_init_flatmem(void);
> +static inline void page_cgroup_init(void)
>  {
>  }
>  #endif
> @@ -48,11 +50,10 @@ static inline int PageCgroupUsed(struct page_cgroup *pc)
>  {
>  	return test_bit(PCG_USED, &pc->flags);
>  }
> -
> -#else /* CONFIG_MEMCG */
> +#else /* !CONFIG_MEMCG */
>  struct page_cgroup;
>  
> -static inline void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat)
> +static inline void pgdat_page_cgroup_init(struct pglist_data *pgdat)
>  {
>  }
>  
> @@ -65,10 +66,9 @@ static inline void page_cgroup_init(void)
>  {
>  }
>  
> -static inline void __init page_cgroup_init_flatmem(void)
> +static inline void page_cgroup_init_flatmem(void)
>  {
>  }
> -
>  #endif /* CONFIG_MEMCG */
>  
>  #include <linux/swap.h>
> -- 
> 1.7.10.4
> 

-- 
Michal Hocko
SUSE Labs

--
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>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 2/3] page-cgroup: get rid of NR_PCG_FLAGS
  2014-06-24 16:33   ` Vladimir Davydov
@ 2014-06-25  6:55     ` Michal Hocko
  -1 siblings, 0 replies; 20+ messages in thread
From: Michal Hocko @ 2014-06-25  6:55 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, hannes, linux-kernel, linux-mm

On Tue 24-06-14 20:33:05, Vladimir Davydov wrote:
> It's not used anywhere today, so let's remove it.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
>  include/linux/page_cgroup.h |    6 ------
>  kernel/bounds.c             |    2 --
>  2 files changed, 8 deletions(-)
> 
> diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
> index 23863edb95ff..fb60e4a466c0 100644
> --- a/include/linux/page_cgroup.h
> +++ b/include/linux/page_cgroup.h
> @@ -6,12 +6,8 @@ enum {
>  	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 */
> -	__NR_PCG_FLAGS,
>  };
>  
> -#ifndef __GENERATING_BOUNDS_H
> -#include <generated/bounds.h>
> -
>  struct pglist_data;
>  
>  #ifdef CONFIG_MEMCG
> @@ -107,6 +103,4 @@ static inline void swap_cgroup_swapoff(int type)
>  
>  #endif /* CONFIG_MEMCG_SWAP */
>  
> -#endif /* !__GENERATING_BOUNDS_H */
> -
>  #endif /* __LINUX_PAGE_CGROUP_H */
> diff --git a/kernel/bounds.c b/kernel/bounds.c
> index 9fd4246b04b8..e1d1d1952bfa 100644
> --- a/kernel/bounds.c
> +++ b/kernel/bounds.c
> @@ -9,7 +9,6 @@
>  #include <linux/page-flags.h>
>  #include <linux/mmzone.h>
>  #include <linux/kbuild.h>
> -#include <linux/page_cgroup.h>
>  #include <linux/log2.h>
>  #include <linux/spinlock_types.h>
>  
> @@ -18,7 +17,6 @@ void foo(void)
>  	/* The enum constants to put into include/generated/bounds.h */
>  	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
>  	DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
> -	DEFINE(NR_PCG_FLAGS, __NR_PCG_FLAGS);
>  #ifdef CONFIG_SMP
>  	DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));
>  #endif
> -- 
> 1.7.10.4
> 
> --
> 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>

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 2/3] page-cgroup: get rid of NR_PCG_FLAGS
@ 2014-06-25  6:55     ` Michal Hocko
  0 siblings, 0 replies; 20+ messages in thread
From: Michal Hocko @ 2014-06-25  6:55 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, hannes, linux-kernel, linux-mm

On Tue 24-06-14 20:33:05, Vladimir Davydov wrote:
> It's not used anywhere today, so let's remove it.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
>  include/linux/page_cgroup.h |    6 ------
>  kernel/bounds.c             |    2 --
>  2 files changed, 8 deletions(-)
> 
> diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
> index 23863edb95ff..fb60e4a466c0 100644
> --- a/include/linux/page_cgroup.h
> +++ b/include/linux/page_cgroup.h
> @@ -6,12 +6,8 @@ enum {
>  	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 */
> -	__NR_PCG_FLAGS,
>  };
>  
> -#ifndef __GENERATING_BOUNDS_H
> -#include <generated/bounds.h>
> -
>  struct pglist_data;
>  
>  #ifdef CONFIG_MEMCG
> @@ -107,6 +103,4 @@ static inline void swap_cgroup_swapoff(int type)
>  
>  #endif /* CONFIG_MEMCG_SWAP */
>  
> -#endif /* !__GENERATING_BOUNDS_H */
> -
>  #endif /* __LINUX_PAGE_CGROUP_H */
> diff --git a/kernel/bounds.c b/kernel/bounds.c
> index 9fd4246b04b8..e1d1d1952bfa 100644
> --- a/kernel/bounds.c
> +++ b/kernel/bounds.c
> @@ -9,7 +9,6 @@
>  #include <linux/page-flags.h>
>  #include <linux/mmzone.h>
>  #include <linux/kbuild.h>
> -#include <linux/page_cgroup.h>
>  #include <linux/log2.h>
>  #include <linux/spinlock_types.h>
>  
> @@ -18,7 +17,6 @@ void foo(void)
>  	/* The enum constants to put into include/generated/bounds.h */
>  	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
>  	DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
> -	DEFINE(NR_PCG_FLAGS, __NR_PCG_FLAGS);
>  #ifdef CONFIG_SMP
>  	DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));
>  #endif
> -- 
> 1.7.10.4
> 
> --
> 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>

-- 
Michal Hocko
SUSE Labs

--
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>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 3/3] page-cgroup: fix flags definition
  2014-06-24 16:33   ` Vladimir Davydov
@ 2014-06-25  6:58     ` Michal Hocko
  -1 siblings, 0 replies; 20+ messages in thread
From: Michal Hocko @ 2014-06-25  6:58 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, hannes, linux-kernel, linux-mm

On Tue 24-06-14 20:33:06, Vladimir Davydov wrote:
> Since commit a9ce315aaec1f ("mm: memcontrol: rewrite uncharge API"),

I guess the sha comes from linux-next. Andrew will probably just fold
this into mm-memcontrol-rewrite-uncharge-api.patch but the sha should be
removed otherwise.

> PCG_* flags are used as bit masks, but they are still defined in a enum
> as bit numbers. Fix it.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
>  include/linux/page_cgroup.h |   12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
> index fb60e4a466c0..9065a61345a1 100644
> --- 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;
> -- 
> 1.7.10.4
> 

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH -mm 3/3] page-cgroup: fix flags definition
@ 2014-06-25  6:58     ` Michal Hocko
  0 siblings, 0 replies; 20+ messages in thread
From: Michal Hocko @ 2014-06-25  6:58 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: akpm, hannes, linux-kernel, linux-mm

On Tue 24-06-14 20:33:06, Vladimir Davydov wrote:
> Since commit a9ce315aaec1f ("mm: memcontrol: rewrite uncharge API"),

I guess the sha comes from linux-next. Andrew will probably just fold
this into mm-memcontrol-rewrite-uncharge-api.patch but the sha should be
removed otherwise.

> PCG_* flags are used as bit masks, but they are still defined in a enum
> as bit numbers. Fix it.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
>  include/linux/page_cgroup.h |   12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
> index fb60e4a466c0..9065a61345a1 100644
> --- 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;
> -- 
> 1.7.10.4
> 

-- 
Michal Hocko
SUSE Labs

--
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>

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-06-25  6:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.