Skip to contentSkip to conversation

mm: cleanup the comment for head/tail pages of compound pages in mm/page_alloc.c

PATCH Applied Wang Sheng-Hui 3 participants 5 messages Nov 15, 2011 – Nov 17, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: cleanup the comment for head/tail pages of compound pages in mm/page_alloc.c

Per the void prep_compound_page(struct page *page, unsigned long order) code, compound pages use PG_head/PG_tail, and only tail pages point at head page using their ->first_page field.

---
 mm/page_alloc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 6e8ecb6..f645ce8 100644
@@ -332,8 +332,8 @@ out:
  *
  * The remaining PAGE_SIZE pages are called "tail pages".
  *
- * All pages have PG_compound set.  All pages have their ->private pointing at
- * the head page (even the head page has this).
+ * Head page has PG_head set, and all tail pages have PG_tail set. All tail
+ * pages have their ->first_page pointing at the head page.
  *
  * The first tail page's ->lru.next holds the address of the compound page's
  * put_page() function.  Its ->lru.prev holds the order of allocation.
Signature · 1 line
1.7.1
#1 lore raw
Quoted 2 lines · Wang Sheng-Hui

Per the void prep_compound_page(struct page *page, unsigned long order) code, compound pages use PG_head/PG_tail,

This is true only for CONFIG_PAGEFLAGS_EXTENDED otherwise we trick it by PG_compound & ~PG_reclaim = head page
PG_compound & PG_reclaim = tail page

Have a look at PG_head_tail_mask

Quoted 1 line

and only tail pages point at head page using their ->first_page field.

This part is correct.

Quoted 30 lines
---
 mm/page_alloc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 6e8ecb6..f645ce8 100644
@@ -332,8 +332,8 @@ out:
  *
  * The remaining PAGE_SIZE pages are called "tail pages".
  *
- * All pages have PG_compound set.  All pages have their ->private pointing at
- * the head page (even the head page has this).
+ * Head page has PG_head set, and all tail pages have PG_tail set. All tail
+ * pages have their ->first_page pointing at the head page.
  *
  * The first tail page's ->lru.next holds the address of the compound page's
  * put_page() function.  Its ->lru.prev holds the order of allocation.
Signature · 8 lines
1.7.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Signature · 6 lines
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic
#2 lore raw
Quoted 38 lines · Michal Hocko
Quoted 2 lines · Wang Sheng-Hui

Per the void prep_compound_page(struct page *page, unsigned long order) code, compound pages use PG_head/PG_tail,

This is true only for CONFIG_PAGEFLAGS_EXTENDED otherwise we trick it by PG_compound & ~PG_reclaim = head page
PG_compound & PG_reclaim = tail page

Have a look at PG_head_tail_mask

Quoted 1 line

and only tail pages point at head page using their ->first_page field.

This part is correct.

Quoted 24 lines
---
 mm/page_alloc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 6e8ecb6..f645ce8 100644
@@ -332,8 +332,8 @@ out:
  *
  * The remaining PAGE_SIZE pages are called "tail pages".
  *
- * All pages have PG_compound set.  All pages have their ->private pointing at
- * the head page (even the head page has this).
+ * Head page has PG_head set, and all tail pages have PG_tail set. All tail
+ * pages have their ->first_page pointing at the head page.
  *
  * The first tail page's ->lru.next holds the address of the compound page's
  * put_page() function.  Its ->lru.prev holds the order of allocation.
Signature · 1 line
1.7.1
Quoted 7 lines
Quoted 6 lines

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Thanks, Michal.

New patch generated.

[PATCH] mm: cleanup the comment for head/tail pages of compound pages in mm/page_alloc.c

Only tail pages point at the head page using their ->first_page fields.

---
 mm/page_alloc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 6e8ecb6..e7dd848 100644
@@ -332,8 +332,8 @@ out:
  *
  * The remaining PAGE_SIZE pages are called "tail pages".
  *
- * All pages have PG_compound set.  All pages have their ->private pointing at
- * the head page (even the head page has this).
+ * All pages have PG_compound set.  All tail pages have their ->first_page
+ * pointing at the head page.
  *
  * The first tail page's ->lru.next holds the address of the compound page's
  * put_page() function.  Its ->lru.prev holds the order of allocation.
Signature · 1 line
1.7.1
Reviewed-by
#3 lore raw

[CCing trivial tree]

Unquoted patch at https://lkml.org/lkml/2011/11/15/402

On Wed 16-11-11 08:05:07, Wang Sheng-Hui wrote:
[...]

Quoted 10 lines

Thanks, Michal.

New patch generated.

[PATCH] mm: cleanup the comment for head/tail pages of compound pages in mm/page_alloc.c

Only tail pages point at the head page using their ->first_page fields.

Quoted 21 lines
---
 mm/page_alloc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 6e8ecb6..e7dd848 100644
@@ -332,8 +332,8 @@ out:
  *
  * The remaining PAGE_SIZE pages are called "tail pages".
  *
- * All pages have PG_compound set.  All pages have their ->private pointing at
- * the head page (even the head page has this).
+ * All pages have PG_compound set.  All tail pages have their ->first_page
+ * pointing at the head page.
  *
  * The first tail page's ->lru.next holds the address of the compound page's
  * put_page() function.  Its ->lru.prev holds the order of allocation.
Signature · 1 line
1.7.1
Signature · 6 lines
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic
Applied
#4 lore raw
Quoted 11 lines · Michal Hocko

[CCing trivial tree]

Unquoted patch at https://lkml.org/lkml/2011/11/15/402

On Wed 16-11-11 08:05:07, Wang Sheng-Hui wrote:
[...]

Quoted 5 lines

Thanks, Michal.

New patch generated.

Quoted 7 lines
Quoted 5 lines

[PATCH] mm: cleanup the comment for head/tail pages of compound pages in mm/page_alloc.c

Only tail pages point at the head page using their ->first_page fields.

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs