linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] explicitly document overloaded page flags
@ 2008-05-15 17:19 Andy Whitcroft
  2008-05-15 17:19 ` [PATCH 1/3] page-flags: record page flag overlays explicitly Andy Whitcroft
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-05-15 17:19 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Christoph Lameter, KAMEZAWA Hiroyuki,
	KOSAKI Motohiro, Rik van Riel, Jeremy Fitzhardinge, linux-kernel

With the recent page flag reorganisation we have a single enum which
defines the valid page flags and their values, nice and clear.  However
there are a number of bits which are overloaded by different subsystems.
Firstly there is PG_owner_priv_1 which is used by filesystems and by XEN.
Secondly both SLOB and SLUB use a couple of extra page bits to manage
internal state for pages they own; both overlay other bits.  All of these
"aliases" are scattered about the source making it very hard for a reader
to know if the bits are safe to rely on in all contexts; confusion here
is bad.

As we now have a single place where the bits are clearly assigned it makes
sense to clarify the reuse of bits by making the aliases explicit and
visible with the original bit assignments.  This patch creates explicit
aliases within the enum itself for the overloaded bits and uses those
aliases throughout.

Andrew please consider for -mm.

-apw

--
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] 12+ messages in thread

* [PATCH 1/3] page-flags: record page flag overlays explicitly
  2008-05-15 17:19 [PATCH 0/3] explicitly document overloaded page flags Andy Whitcroft
@ 2008-05-15 17:19 ` Andy Whitcroft
  2008-05-15 17:28   ` Christoph Lameter
  2008-05-15 17:19 ` [PATCH 2/3] slub: " Andy Whitcroft
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Andy Whitcroft @ 2008-05-15 17:19 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Christoph Lameter, KAMEZAWA Hiroyuki,
	KOSAKI Motohiro, Rik van Riel, Jeremy Fitzhardinge, linux-kernel

Some page flags are used for more than one purpose, for example
PG_owner_priv_1.  Currently there are individual accessors for each user,
each built using the common flag name far away from the bit definitions.
This makes it hard to see all possible uses of these bits.

Now that we have a single enum to generate the bit orders it makes sense
to express overlays in the same place.  So create per use aliases for
this bit in the main page-flags enum and use those in the accessors.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
 include/linux/page-flags.h |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 590cff3..2cc1fb1 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -96,7 +96,13 @@ enum pageflags {
 #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
 	PG_uncached,		/* Page has been mapped as uncached */
 #endif
-	__NR_PAGEFLAGS
+	__NR_PAGEFLAGS,
+
+	/* Filesystems */
+	PG_checked = PG_owner_priv_1,
+
+	/* XEN */
+	PG_pinned = PG_owner_priv_1,
 };
 
 #ifndef __GENERATING_BOUNDS_H
@@ -155,8 +161,8 @@ PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty)
 PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru)
 PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active)
 __PAGEFLAG(Slab, slab)
-PAGEFLAG(Checked, owner_priv_1)		/* Used by some filesystems */
-PAGEFLAG(Pinned, owner_priv_1) TESTSCFLAG(Pinned, owner_priv_1) /* Xen */
+PAGEFLAG(Checked, checked)		/* Used by some filesystems */
+PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */
 PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved)
 PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private)
 	__SETPAGEFLAG(Private, private)

--
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] 12+ messages in thread

* [PATCH 2/3] slub: record page flag overlays explicitly
  2008-05-15 17:19 [PATCH 0/3] explicitly document overloaded page flags Andy Whitcroft
  2008-05-15 17:19 ` [PATCH 1/3] page-flags: record page flag overlays explicitly Andy Whitcroft
@ 2008-05-15 17:19 ` Andy Whitcroft
  2008-05-15 17:29   ` Christoph Lameter
  2008-05-16  0:21   ` KOSAKI Motohiro
  2008-05-15 17:20 ` [PATCH 3/3] slob: " Andy Whitcroft
  2008-05-15 17:26 ` [PATCH 0/3] explicitly document overloaded page flags Christoph Lameter
  3 siblings, 2 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-05-15 17:19 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Christoph Lameter, KAMEZAWA Hiroyuki,
	KOSAKI Motohiro, Rik van Riel, Jeremy Fitzhardinge, linux-kernel

SLUB reuses two page bits for internal purposes, it overlays PG_active
and PG_error.  This is hidden away in slub.c.  Document these overlays
explicitly in the main page-flags enum along with all the others.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
 include/linux/page-flags.h |    4 ++++
 mm/slub.c                  |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 2cc1fb1..2e88df6 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -103,6 +103,10 @@ enum pageflags {
 
 	/* XEN */
 	PG_pinned = PG_owner_priv_1,
+
+	/* SLUB */
+	PG_slub_frozen = PG_active,
+	PG_slub_debug = PG_error,
 };
 
 #ifndef __GENERATING_BOUNDS_H
diff --git a/mm/slub.c b/mm/slub.c
index a505a82..fd7c61a 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -102,10 +102,10 @@
  * 			the fast path and disables lockless freelists.
  */
 
-#define FROZEN (1 << PG_active)
+#define FROZEN (1 << PG_slub_frozen)
 
 #ifdef CONFIG_SLUB_DEBUG
-#define SLABDEBUG (1 << PG_error)
+#define SLABDEBUG (1 << PG_slub_debug)
 #else
 #define SLABDEBUG 0
 #endif

--
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] 12+ messages in thread

* [PATCH 3/3] slob: record page flag overlays explicitly
  2008-05-15 17:19 [PATCH 0/3] explicitly document overloaded page flags Andy Whitcroft
  2008-05-15 17:19 ` [PATCH 1/3] page-flags: record page flag overlays explicitly Andy Whitcroft
  2008-05-15 17:19 ` [PATCH 2/3] slub: " Andy Whitcroft
@ 2008-05-15 17:20 ` Andy Whitcroft
  2008-05-15 17:37   ` Andy Whitcroft
  2008-05-15 17:42   ` [PATCH] slob: record page flag overlays explicitly v2 Andy Whitcroft
  2008-05-15 17:26 ` [PATCH 0/3] explicitly document overloaded page flags Christoph Lameter
  3 siblings, 2 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-05-15 17:20 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Christoph Lameter, KAMEZAWA Hiroyuki,
	KOSAKI Motohiro, Rik van Riel, Jeremy Fitzhardinge, linux-kernel

SLOB reuses two page bits for internal purposes, it overlays PG_active
and PG_private.  This is hidden away in slob.c.  Document these overlays
explicitly in the main page-flags enum along with all the others.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
 include/linux/page-flags.h |    4 ++++
 mm/slob.c                  |   12 ++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 2e88df6..71aec98 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -104,6 +104,10 @@ enum pageflags {
 	/* XEN */
 	PG_pinned = PG_owner_priv_1,
 
+	/* SLOB */
+	PG_slob_page = PG_active,
+	PG_slob_free = PG_private,
+
 	/* SLUB */
 	PG_slub_frozen = PG_active,
 	PG_slub_debug = PG_error,
diff --git a/mm/slob.c b/mm/slob.c
index 6038cba..9bc3147 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -130,17 +130,17 @@ static LIST_HEAD(free_slob_large);
  */
 static inline int slob_page(struct slob_page *sp)
 {
-	return test_bit(PG_active, &sp->flags);
+	return test_bit(PG_slob_page, &sp->flags);
 }
 
 static inline void set_slob_page(struct slob_page *sp)
 {
-	__set_bit(PG_active, &sp->flags);
+	__set_bit(PG_slob_page, &sp->flags);
 }
 
 static inline void clear_slob_page(struct slob_page *sp)
 {
-	__clear_bit(PG_active, &sp->flags);
+	__clear_bit(PG_slob_free, &sp->flags);
 }
 
 /*
@@ -148,19 +148,19 @@ static inline void clear_slob_page(struct slob_page *sp)
  */
 static inline int slob_page_free(struct slob_page *sp)
 {
-	return test_bit(PG_private, &sp->flags);
+	return test_bit(PG_slob_free, &sp->flags);
 }
 
 static void set_slob_page_free(struct slob_page *sp, struct list_head *list)
 {
 	list_add(&sp->list, list);
-	__set_bit(PG_private, &sp->flags);
+	__set_bit(PG_slob_free, &sp->flags);
 }
 
 static inline void clear_slob_page_free(struct slob_page *sp)
 {
 	list_del(&sp->list);
-	__clear_bit(PG_private, &sp->flags);
+	__clear_bit(PG_slob_free, &sp->flags);
 }
 
 #define SLOB_UNIT sizeof(slob_t)

--
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] 12+ messages in thread

* Re: [PATCH 0/3] explicitly document overloaded page flags
  2008-05-15 17:19 [PATCH 0/3] explicitly document overloaded page flags Andy Whitcroft
                   ` (2 preceding siblings ...)
  2008-05-15 17:20 ` [PATCH 3/3] slob: " Andy Whitcroft
@ 2008-05-15 17:26 ` Christoph Lameter
  3 siblings, 0 replies; 12+ messages in thread
From: Christoph Lameter @ 2008-05-15 17:26 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: linux-mm, Andrew Morton, KAMEZAWA Hiroyuki, KOSAKI Motohiro,
	Rik van Riel, Jeremy Fitzhardinge, linux-kernel

On Thu, 15 May 2008, Andy Whitcroft wrote:

> With the recent page flag reorganisation we have a single enum which
> defines the valid page flags and their values, nice and clear.  However
> there are a number of bits which are overloaded by different subsystems.
> Firstly there is PG_owner_priv_1 which is used by filesystems and by XEN.
> Secondly both SLOB and SLUB use a couple of extra page bits to manage
> internal state for pages they own; both overlay other bits.  All of these
> "aliases" are scattered about the source making it very hard for a reader
> to know if the bits are safe to rely on in all contexts; confusion here
> is bad.
> 
> As we now have a single place where the bits are clearly assigned it makes
> sense to clarify the reuse of bits by making the aliases explicit and
> visible with the original bit assignments.  This patch creates explicit
> aliases within the enum itself for the overloaded bits and uses those
> aliases throughout.

Ahh. Great! I considered doing that work too but never got around to it.

--
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] 12+ messages in thread

* Re: [PATCH 1/3] page-flags: record page flag overlays explicitly
  2008-05-15 17:19 ` [PATCH 1/3] page-flags: record page flag overlays explicitly Andy Whitcroft
@ 2008-05-15 17:28   ` Christoph Lameter
  0 siblings, 0 replies; 12+ messages in thread
From: Christoph Lameter @ 2008-05-15 17:28 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: linux-mm, Andrew Morton, KAMEZAWA Hiroyuki, KOSAKI Motohiro,
	Rik van Riel, Jeremy Fitzhardinge, linux-kernel

On Thu, 15 May 2008, Andy Whitcroft wrote:

> Now that we have a single enum to generate the bit orders it makes sense
> to express overlays in the same place.  So create per use aliases for
> this bit in the main page-flags enum and use those in the accessors.

Well I thought it would be better to have the overlays defined when the 
PAGEFLAGS_xx macro is used. If that is done then every PG_xxx has a unique 
id. The aliasing is then only through PageXXXX() using a PG_yyy

--
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] 12+ messages in thread

* Re: [PATCH 2/3] slub: record page flag overlays explicitly
  2008-05-15 17:19 ` [PATCH 2/3] slub: " Andy Whitcroft
@ 2008-05-15 17:29   ` Christoph Lameter
  2008-05-16  0:21   ` KOSAKI Motohiro
  1 sibling, 0 replies; 12+ messages in thread
From: Christoph Lameter @ 2008-05-15 17:29 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: linux-mm, Andrew Morton, KAMEZAWA Hiroyuki, KOSAKI Motohiro,
	Rik van Riel, Jeremy Fitzhardinge, linux-kernel

On Thu, 15 May 2008, Andy Whitcroft wrote:
 
> SLUB reuses two page bits for internal purposes, it overlays PG_active
> and PG_error.  This is hidden away in slub.c.  Document these overlays
> explicitly in the main page-flags enum along with all the others.

Hmmm.. Add the definitions also to page-flags.h?

SLABFLAG(Frozen, PG_active)
SLABFLAG(Debug, PG_error)
?

--
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] 12+ messages in thread

* Re: [PATCH 3/3] slob: record page flag overlays explicitly
  2008-05-15 17:20 ` [PATCH 3/3] slob: " Andy Whitcroft
@ 2008-05-15 17:37   ` Andy Whitcroft
  2008-05-15 17:42   ` [PATCH] slob: record page flag overlays explicitly v2 Andy Whitcroft
  1 sibling, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-05-15 17:37 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Christoph Lameter, KAMEZAWA Hiroyuki,
	KOSAKI Motohiro, Rik van Riel, Jeremy Fitzhardinge, linux-kernel

On Thu, May 15, 2008 at 06:20:10PM +0100, Andy Whitcroft wrote:

>  static inline void clear_slob_page(struct slob_page *sp)
>  {
> -	__clear_bit(PG_active, &sp->flags);
> +	__clear_bit(PG_slob_free, &sp->flags);
>  }

Bah, this hunk is wrong.  Seems this is not the latest version.  Will
replace this patch momentarily.

-apw

--
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] 12+ messages in thread

* [PATCH] slob: record page flag overlays explicitly v2
  2008-05-15 17:20 ` [PATCH 3/3] slob: " Andy Whitcroft
  2008-05-15 17:37   ` Andy Whitcroft
@ 2008-05-15 17:42   ` Andy Whitcroft
  1 sibling, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-05-15 17:42 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Christoph Lameter, KAMEZAWA Hiroyuki,
	KOSAKI Motohiro, Rik van Riel, Jeremy Fitzhardinge, linux-kernel

SLOB reuses two page bits for internal purposes, it overlays PG_active
and PG_private.  This is hidden away in slob.c.  Document these overlays
explicitly in the main page-flags enum along with all the others.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
 include/linux/page-flags.h |    4 ++++
 mm/slob.c                  |   12 ++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 2e88df6..71aec98 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -104,6 +104,10 @@ enum pageflags {
 	/* XEN */
 	PG_pinned = PG_owner_priv_1,
 
+	/* SLOB */
+	PG_slob_page = PG_active,
+	PG_slob_free = PG_private,
+
 	/* SLUB */
 	PG_slub_frozen = PG_active,
 	PG_slub_debug = PG_error,
diff --git a/mm/slob.c b/mm/slob.c
index 6038cba..0aaf54f 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -130,17 +130,17 @@ static LIST_HEAD(free_slob_large);
  */
 static inline int slob_page(struct slob_page *sp)
 {
-	return test_bit(PG_active, &sp->flags);
+	return test_bit(PG_slob_page, &sp->flags);
 }
 
 static inline void set_slob_page(struct slob_page *sp)
 {
-	__set_bit(PG_active, &sp->flags);
+	__set_bit(PG_slob_page, &sp->flags);
 }
 
 static inline void clear_slob_page(struct slob_page *sp)
 {
-	__clear_bit(PG_active, &sp->flags);
+	__clear_bit(PG_slob_page, &sp->flags);
 }
 
 /*
@@ -148,19 +148,19 @@ static inline void clear_slob_page(struct slob_page *sp)
  */
 static inline int slob_page_free(struct slob_page *sp)
 {
-	return test_bit(PG_private, &sp->flags);
+	return test_bit(PG_slob_free, &sp->flags);
 }
 
 static void set_slob_page_free(struct slob_page *sp, struct list_head *list)
 {
 	list_add(&sp->list, list);
-	__set_bit(PG_private, &sp->flags);
+	__set_bit(PG_slob_free, &sp->flags);
 }
 
 static inline void clear_slob_page_free(struct slob_page *sp)
 {
 	list_del(&sp->list);
-	__clear_bit(PG_private, &sp->flags);
+	__clear_bit(PG_slob_free, &sp->flags);
 }
 
 #define SLOB_UNIT sizeof(slob_t)

--
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] 12+ messages in thread

* Re: [PATCH 2/3] slub: record page flag overlays explicitly
  2008-05-15 17:19 ` [PATCH 2/3] slub: " Andy Whitcroft
  2008-05-15 17:29   ` Christoph Lameter
@ 2008-05-16  0:21   ` KOSAKI Motohiro
  1 sibling, 0 replies; 12+ messages in thread
From: KOSAKI Motohiro @ 2008-05-16  0:21 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: kosaki.motohiro, linux-mm, Andrew Morton, Christoph Lameter,
	KAMEZAWA Hiroyuki, Rik van Riel, Jeremy Fitzhardinge,
	linux-kernel

> SLUB reuses two page bits for internal purposes, it overlays PG_active
> and PG_error.  This is hidden away in slub.c.  Document these overlays
> explicitly in the main page-flags enum along with all the others.
> 
> Signed-off-by: Andy Whitcroft <apw@shadowen.org>

Agreed.
I like your approach :)



--
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] 12+ messages in thread

* [PATCH 1/3] page-flags: record page flag overlays explicitly
  2008-05-23 16:33 [PATCH 0/3] explicitly document overloaded page flags V2 Andy Whitcroft
@ 2008-05-23 16:33 ` Andy Whitcroft
  2008-05-26  4:37   ` KOSAKI Motohiro
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Whitcroft @ 2008-05-23 16:33 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Christoph Lameter, KAMEZAWA Hiroyuki,
	KOSAKI Motohiro, Rik van Riel, Jeremy Fitzhardinge, linux-kernel

Some page flags are used for more than one purpose, for example
PG_owner_priv_1.  Currently there are individual accessors for each user,
each built using the common flag name far away from the bit definitions.
This makes it hard to see all possible uses of these bits.

Now that we have a single enum to generate the bit orders it makes sense
to express overlays in the same place.  So create per use aliases for
this bit in the main page-flags enum and use those in the accessors.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
 include/linux/page-flags.h |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 590cff3..2cc1fb1 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -96,7 +96,13 @@ enum pageflags {
 #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
 	PG_uncached,		/* Page has been mapped as uncached */
 #endif
-	__NR_PAGEFLAGS
+	__NR_PAGEFLAGS,
+
+	/* Filesystems */
+	PG_checked = PG_owner_priv_1,
+
+	/* XEN */
+	PG_pinned = PG_owner_priv_1,
 };
 
 #ifndef __GENERATING_BOUNDS_H
@@ -155,8 +161,8 @@ PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty)
 PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru)
 PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active)
 __PAGEFLAG(Slab, slab)
-PAGEFLAG(Checked, owner_priv_1)		/* Used by some filesystems */
-PAGEFLAG(Pinned, owner_priv_1) TESTSCFLAG(Pinned, owner_priv_1) /* Xen */
+PAGEFLAG(Checked, checked)		/* Used by some filesystems */
+PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */
 PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved)
 PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private)
 	__SETPAGEFLAG(Private, private)

--
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] 12+ messages in thread

* Re: [PATCH 1/3] page-flags: record page flag overlays explicitly
  2008-05-23 16:33 ` [PATCH 1/3] page-flags: record page flag overlays explicitly Andy Whitcroft
@ 2008-05-26  4:37   ` KOSAKI Motohiro
  0 siblings, 0 replies; 12+ messages in thread
From: KOSAKI Motohiro @ 2008-05-26  4:37 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: kosaki.motohiro, linux-mm, Andrew Morton, Christoph Lameter,
	KAMEZAWA Hiroyuki, Rik van Riel, Jeremy Fitzhardinge,
	linux-kernel

Hi

Thank you nice patch.

> Some page flags are used for more than one purpose, for example
> PG_owner_priv_1.  Currently there are individual accessors for each user,
> each built using the common flag name far away from the bit definitions.
> This makes it hard to see all possible uses of these bits.
> 
> Now that we have a single enum to generate the bit orders it makes sense
> to express overlays in the same place.  So create per use aliases for
> this bit in the main page-flags enum and use those in the accessors.
> 
> Signed-off-by: Andy Whitcroft <apw@shadowen.org>

My review found no bug.

Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>



--
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] 12+ messages in thread

end of thread, other threads:[~2008-05-26  4:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 17:19 [PATCH 0/3] explicitly document overloaded page flags Andy Whitcroft
2008-05-15 17:19 ` [PATCH 1/3] page-flags: record page flag overlays explicitly Andy Whitcroft
2008-05-15 17:28   ` Christoph Lameter
2008-05-15 17:19 ` [PATCH 2/3] slub: " Andy Whitcroft
2008-05-15 17:29   ` Christoph Lameter
2008-05-16  0:21   ` KOSAKI Motohiro
2008-05-15 17:20 ` [PATCH 3/3] slob: " Andy Whitcroft
2008-05-15 17:37   ` Andy Whitcroft
2008-05-15 17:42   ` [PATCH] slob: record page flag overlays explicitly v2 Andy Whitcroft
2008-05-15 17:26 ` [PATCH 0/3] explicitly document overloaded page flags Christoph Lameter
  -- strict thread matches above, loose matches on Subject: below --
2008-05-23 16:33 [PATCH 0/3] explicitly document overloaded page flags V2 Andy Whitcroft
2008-05-23 16:33 ` [PATCH 1/3] page-flags: record page flag overlays explicitly Andy Whitcroft
2008-05-26  4:37   ` KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).