[lkml]   [2007]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[06/17] Fix up handling of Compound head pages
Compound pages can be on the LRU. This means that the page pointer
to the head page is on a pagevec. In that case we need full LRU processing
for the page in release_pages().

The check for compound pages in release_pages() was introduced by
Nick Piggin to make sure that the page count in tail pages is not
going negative. Well we can now explicitly check for the tail page.

The head page should be processes like a regular page in order to
support higher order page cache pages.

Signed-off-by: Christoph Lameter <>

mm/swap.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Index: linux-2.6.21-rc7/mm/swap.c
--- linux-2.6.21-rc7.orig/mm/swap.c 2007-04-24 09:40:16.000000000 -0700
+++ linux-2.6.21-rc7/mm/swap.c 2007-04-24 09:42:27.000000000 -0700
@@ -263,7 +263,13 @@ void release_pages(struct page **pages,
for (i = 0; i < nr; i++) {
struct page *page = pages[i];

- if (unlikely(PageCompound(page))) {
+ /*
+ * If we have a tail page on the LRU then we need to
+ * decrement the page count of the head page. There
+ * is no further need to do anything since tail pages
+ * cannot be on the LRU.
+ */
+ if (unlikely(PageTail(page))) {
if (zone) {
zone = NULL;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-04-25 00:27    [W:0.548 / U:2.680 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site