[06/17] Fix up handling of Compound head pages

clameter
2007-04-24T22:23:40Z

[-- Attachment #1: var_compound_release_pages --]
[-- Type: text/plain, Size: 1343 bytes --]

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 <clameter@sgi.com>

---
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) {
spin_unlock_irq(&zone->lru_lock);
zone = NULL;

--